Browse Source

Fix Map fitBounds method

pull/2549/head
Igor Kulikov 7 years ago
parent
commit
8e61d9c829
  1. 6
      ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts

6
ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts

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

Loading…
Cancel
Save