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
var LatLngList = new Array (new google.maps.LatLng (52.537,-2.061), new google.maps.LatLng (52.564,-2.017)); | |
// Create a new viewpoint bound | |
var bounds = new google.maps.LatLngBounds (); | |
// Go through each... | |
for (var i = 0, LtLgLen = LatLngList.length; i < LtLgLen; i++) { | |
// And increase the bounds to take this point | |
bounds.extend (LatLngList[i]); | |
} | |
// Fit these bounds to the map | |
map.fitBounds (bounds); |