Friday, 31 July 2015

google map js api, zoom and spin to multi locations



// map: an instance of GMap3
// latlng: an array of instances of GLatLng
var latlngbounds = new google.maps.LatLngBounds();
latlng.each(function(n){
   latlngbounds.extend(n);
});
map.setCenter(latlngbounds.getCenter());
map.fitBounds(latlngbounds); 



http://stackoverflow.com/questions/2818984/google-map-api-v3-center-zoom-on-displayed-markers

No comments:

Post a comment