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

Creating a control that shows coordinates

Geographical coordinates are very important for showing where you are on the earth. Latitudes and longitudes come together to create a two-dimensional grid that simulates the earth's surface. Showing the latitude and longitude in a control on the map while you are moving the mouse can be a good usage of controls and events together.

In Chapter 4, Working with Controls, we have seen recipes such as Adding your own logo as a control, and we have also seen how to use map events in this chapter. In this recipe, we will create a control with the help of the mousemove event of the map that shows the coordinates in real time.

Getting ready

In this recipe, we will use the first recipe defined in Chapter 1, Google ...

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