Created
July 8, 2013 16:01
-
-
Save cgrymala/5950109 to your computer and use it in GitHub Desktop.
Old method of getting lat & long from Google Maps marker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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