Commit 8e61d9c82999500aeb7717b93966f5ecbb49e299

Authored by Igor Kulikov
1 parent a1347eb0

Fix Map fitBounds method

@@ -170,8 +170,8 @@ export default abstract class LeafletMap { @@ -170,8 +170,8 @@ export default abstract class LeafletMap {
170 this.map.setZoom(this.options.defaultZoomLevel, { animate: false }); 170 this.map.setZoom(this.options.defaultZoomLevel, { animate: false });
171 this.map.panTo(bounds.getCenter(), { animate: false }); 171 this.map.panTo(bounds.getCenter(), { animate: false });
172 } else { 172 } else {
173 - this.map.once('zoomend', function () {  
174 - if (!this.options.defaultZoomLevel && this.options.map.getZoom() > this.options.minZoomLevel) { 173 + this.map.once('zoomend', () => {
  174 + if (!this.options.defaultZoomLevel && this.map.getZoom() > this.options.minZoomLevel) {
175 this.map.setZoom(this.options.minZoomLevel, { animate: false }); 175 this.map.setZoom(this.options.minZoomLevel, { animate: false });
176 } 176 }
177 }); 177 });
@@ -323,4 +323,4 @@ export default abstract class LeafletMap { @@ -323,4 +323,4 @@ export default abstract class LeafletMap {
323 this.polygons.get(key).updatePolygon(data, dataSources, settings); 323 this.polygons.get(key).updatePolygon(data, dataSources, settings);
324 }); 324 });
325 } 325 }
326 -}  
  326 +}