Great tip from J-School multimedia instructor Jeremy Rue:
“If you ever want to find the longitude and latitude of a location on Google Maps, simply center the map to the location you want to find. You can even search an address and this will work. Then paste in this code into the URL field:
javascript:alert(window.gApplication.getMap().getCenter());
A pop-up box will appear with the longitude and latitude.”
Update: It’s not possible to use this trick with Google Chrome, because the Omnibar “steals” the pasted in Javascript and searches for it instead. Fortunately, there’s a more “official” way to get lat/long now:
1) Right-click on the desired spot on the map to bring up a menu with options.
2) In the menu, select What’s here?.
3) Click the green arrow to get the latitude and longitude coordinates.
Timely! I was literally scratching my head trying to understand how to do this, when I saw this post.
Thanks!
Sure would be nice if they’d put a button or link in the UI for this. Even tucked away in the Advanced section or something. I can see it being useful for lots of things, especially with GPSs becoming so common.
Thanks for posting this, very helpful! You’re right – it would be great if Google put a button on their page to do this for you…
Scott
Great idea!
If want to copy the Lat/Long it would be better to do javascript:prompt(‘Lat/Long’,window.gApplication.getMap().getCenter());
Not sure how to apply this code. Kindly clarify this part:
window.gApplication.getMap().getCenter()
Where to get window.gApplication ?
This doesn’t work on Google Chrome. :)
Keith, you’re right – the Omnibar steals the pasted in code, then searches for it. Ah, but there’s a more “official” way to do it now:
I’ll update the post.
I think when you choose “What’s Here?” it also puts the lat/long in the search box. Might be easier to get from there. There’s also a couple of google labs items that relate to getting a lat/long for a given cursor position.
http://maps.google.com/maps?ftr=0