From 8e61d9c82999500aeb7717b93966f5ecbb49e299 Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Wed, 25 Mar 2020 11:11:10 +0200 Subject: [PATCH] Fix Map fitBounds method --- .../modules/home/components/widget/lib/maps/leaflet-map.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts b/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts index 5d4465cacc..90bd9341d6 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts +++ b/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); }); } -} \ No newline at end of file +}