Division By Zero

Get the centre of a Google Map as Latitude and Longitude

Here’s a nice little javascript function to get the Lat / Long coordinates of the centre of Google Maps – I found it prticularly useful once when creating a flash map which showed the locations of a national chain of golf fitting centres.

javascript:void(prompt('',gApplication.getMap().getCenter()));

To use it simply go to Google Maps, centre the map on the place you want the coordinates of, enter the code above into the address bar and hit enter. A nice text field alert will pop up allowing you to copy the Lat / Long values.

If you’re going to be doing this regularly you may find it useful to create a Firefox bookmark with the code set as the location. That way you can simply hit the bookmark and have the coordinates appear (as long as you’re on Google Maps that is).

Spread the word

If you like what you've read, help spread the word on Twitter, Digg, or any of your favourite social sites. Knowledge is power.

About the author

Jonathan Phillips is the founder and main author here on Division by Zero. A PHP developer by trade, Jonathan spends his days building and marketing websites and the rest of the time coming up with ideas for websites and businesses he hasn't got time to implement.

Leave a comment

* denotes a required field

Don't worry, your email address etc. is safe, we won't share it with anyone.

1 Trackback

  1. [...] Here is the original post: Get the centre of a Google Map as Latitude and Longitude [...]

Copyright © 2009 - 2010 Division By Zero - Credits