Get Lat/Long from Google Maps

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.

8 thoughts on “Get Lat/Long from Google Maps

  1. Timely! I was literally scratching my head trying to understand how to do this, when I saw this post.

    Thanks!

  2. 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.

  3. 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

  4. Great idea!

    If want to copy the Lat/Long it would be better to do javascript:prompt(‘Lat/Long’,window.gApplication.getMap().getCenter());

  5. Not sure how to apply this code. Kindly clarify this part:
    window.gApplication.getMap().getCenter()

    Where to get window.gApplication ?

  6. 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

Leave a Reply

Your email address will not be published. Required fields are marked *