sugardaddy

JavaScript to get Map Center Coords

Mar 31st, 2011
1,407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. google.maps.event.addListener(
  2.     map, "dblclick", function(
  3.         overlay, latlng, overlaylatlng
  4.     ) {
  5.         // var point = new GLatLng( latlng.y, latlng.x );
  6.         //document.getElementById("log").innerHTML = map.getCenter().toString();
  7.         document.getElementById("log").innerHTML = '|' + map.getCenter().lat().toFixed(6) + ' |' + map.getCenter().lng().toFixed(6);
  8.     });
Advertisement
Add Comment
Please, Sign In to add comment