Last active
August 29, 2015 14:11
-
-
Save xafarali/b8513d312bf2105f6c85 to your computer and use it in GitHub Desktop.
Google Map , zoom to bound
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
// map: an instance of google.maps.Map object | |
// latlng: an array of google.maps.LatLng objects | |
// latlng: needs lat, long as interger , so must parse them to interger first. | |
var latlngbounds = new google.maps.LatLngBounds(); | |
for (var i = 0; i < latlng.length; i++) { | |
latlngbounds.extend(latlng[i]); | |
} | |
map.fitBounds(latlngbounds); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment