diff --git a/CHANGELOG.md b/CHANGELOG.md index 72b9dcdf..ebdde1b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ An in-progress version being developed on the `stable` branch. * Fixed a regression where `Marker` shadow didn't animate on zoom after using `setIcon`. [#1768](https://github.com/Leaflet/Leaflet/issues/1768) * Fixed a bug where `FeatureGroup` still fired `layerremove` event on `removeLayer` even if the given layer wan't present in the group. [#1847](https://github.com/Leaflet/Leaflet/issues/1847) * Fixed a bug where `Marker` `setOpacity` wasn't returning the marker (by [@freepius44](https://github.com/freepius44)). [#1851](https://github.com/Leaflet/Leaflet/issues/1851) +* Added ability to pass zoom/pan animation options to `setMaxBounds` (by [@davidjb](http://git.io/djb)). [#1834](https://github.com/Leaflet/Leaflet/pull/1834) ## 0.6.2 (June 28, 2013) diff --git a/src/map/Map.js b/src/map/Map.js index 74b1f4ab..8c3b3e52 100644 --- a/src/map/Map.js +++ b/src/map/Map.js @@ -114,7 +114,7 @@ L.Map = L.Class.extend({ return this.fire('moveend'); }, - setMaxBounds: function (bounds) { + setMaxBounds: function (bounds, options) { bounds = L.latLngBounds(bounds); this.options.maxBounds = bounds; @@ -131,7 +131,7 @@ L.Map = L.Class.extend({ if (this._loaded) { if (this._zoom < minZoom) { - this.setView(bounds.getCenter(), minZoom); + this.setView(bounds.getCenter(), minZoom, options); } else { this.panInsideBounds(bounds); }