Last active
August 29, 2015 14:14
-
-
Save thebouv/c1b66a4a42d912cda77f to your computer and use it in GitHub Desktop.
Force google map to zoom so all markers show
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
// gMarkers is your array of markers | |
var bounds = new google.maps.LatLngBounds(); | |
for(i=0;i<gMarkers.length;i++) { | |
bounds.extend(gMarkers[i].getPosition()); | |
} | |
map.fitBounds(bounds); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment