Skip to content

Instantly share code, notes, and snippets.

@cgrymala
Created July 8, 2013 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgrymala/5950109 to your computer and use it in GitHub Desktop.
Save cgrymala/5950109 to your computer and use it in GitHub Desktop.
Old method of getting lat & long from Google Maps marker
// Get the latitude and longitude of the search result
lat = Math.round( lat * 100000 ) / 100000;
long = Math.round( long * 100000 ) / 100000;
for ( var i = 0; i < limit; i++ ) {
// Retrieve the latitude and longitude of the marker
var markLat = Math.round( markers[i].position.Ra * 100000 ) / 100000;
var markLong = Math.round( markers[i].position.Sa * 100000 ) / 100000;
// Compare the search result to the current marker
if ( markLat == lat && markLong == long ) {
markers[i].setMap(umw_map);
google.maps.event.trigger( markers[i], 'click' );
centerPoint = new google.maps.LatLng( markLat, markLong );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment