Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Add map.setPanLimits
Browse files Browse the repository at this point in the history
  • Loading branch information
ansis committed Jul 16, 2012
1 parent 23d78e1 commit 7037c73
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ mapbox.map = function(el, layer) {
};


m.setPanLimits = function(locations) {
if (locations instanceof MM.Extent) {
locations = locations.toArray();
}
this.coordLimits = [
this.locationCoordinate(locations[0]).zoomTo(this.coordLimits[0].zoom),
this.locationCoordinate(locations[1]).zoomTo(this.coordLimits[1].zoom)
];
return this;
};


m.center = function(location, animate) {
if (location && animate) {
this.ease.location(location).zoom(this.zoom())
Expand Down

0 comments on commit 7037c73

Please sign in to comment.