Search This Blog

Wednesday, July 7, 2010

Get the latitude and longitude of Google Maps

I got this little trick because I needed it myself for my sister website WeirdGlobeNews.com. To grab the latitude and longitude from the Google Maps center, do the following steps.

  1. Go to Google Maps, enter your search term (Such as "Amsterdam, The Netherlands") and press Enter.
  2. Now go to your address bar in your browser en copy the following code and press Enter
    javascript:void(prompt('',gApplication.getMap().getCenter()));
  3. A JavaScript popup box will appear, showing the latitude and longitude of the center point of your map.
    (52.373812, 4.890951)
  4. If you're using Firefox, you can turn this into an bookmark. Create a new bookmark and copy the JavaScript code in the Location. Now you can always get the coördinates with just the press of one button.

No comments: