Skip to content

Instantly share code, notes, and snippets.

@ronihcohen
Created May 19, 2015 14:12
Show Gist options
  • Save ronihcohen/d2363cff56901600cfae to your computer and use it in GitHub Desktop.
Save ronihcohen/d2363cff56901600cfae to your computer and use it in GitHub Desktop.
map.fitBounds
var NorthEast = new google.maps.LatLng(
DefaultMapLocation.NorthEast.Latitude,
DefaultMapLocation.NorthEast.Longitude
);
var SouthWest = new google.maps.LatLng(
DefaultMapLocation.SouthWest.Latitude,
DefaultMapLocation.SouthWest.Longitude
);
var bounds = new google.maps.LatLngBounds();
bounds.extend(NorthEast);
bounds.extend(SouthWest);
map.fitBounds(bounds);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment