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.
1 Trackback
-
Get the centre of a Google Map as Latitude and Longitude golf bar November 28, 2009 at 9:14 pm 1
[...] Here is the original post: Get the centre of a Google Map as Latitude and Longitude [...]
- Subscribe to our RSS feed currently serving 84 happy readers
- Follow @divisi0nby0 stay up-to-date with 40 other followers