O'Reilly logo

Google Maps JavaScript API Cookbook by Balkan Uraz, Alper Dincer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Understanding Google Maps JavaScript API Events

In this chapter, we will cover:

  • Creating two synced maps side by side
  • Getting the coordinates of a mouse click
  • Creating a context menu on a map
  • Restricting the map extent
  • Creating a control that shows coordinates
  • Creating your own events

Introduction

If you have ever worked on JavaScript programming, you should know the importance of events. Events are the core of JavaScript. There are events behind interactions in web pages. There can be user interactions or browser actions that can be handled with the help of events.

For example, in every code from the beginning of this book, we have wrote something like the following line of code:

google.maps.event.addDomListener(window, 'load', initMap);

This ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required