Hacking the map

How to get latitude, longitude of any point from the Google Maps website

While I was looking for a solution to import markers from maps in POIViewer, I found out that a lot of people were looking for the same thing but in the browser.

A common answer is the getMap.getCenter method: Type the following in the address bar while viewing the maps website


It's ok but you need to put the point at the center of the map.

The following hack may be better because it allows you to get the coordinate while clicking anywhere (including the markers):

Copy the following line in your browser address bar and type RETURN (make it a bookmark, if you want).

javascript:GEvent.addListener(gApplication.getMap(), "click", function(overlay, latlng, overlaylatlng){if (typeof(overlaylatlng) != "undefined") {alert (overlaylatlng);}else{alert (latlng);}});