From 2f622a2e72fc3bbcdb05c6e7902e9f07863655c9 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Tue, 12 May 2020 23:45:18 +0300 Subject: [PATCH] Fix update tooltip polygon --- .../components/widget/lib/maps/leaflet-map.ts | 16 ++++++++-------- .../home/components/widget/lib/maps/polygon.ts | 4 ++-- 2 files changed, 10 insertions(+), 10 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 40e3948ae3..7e00d16664 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 @@ -20,12 +20,12 @@ import 'leaflet-providers'; import 'leaflet.markercluster/dist/leaflet.markercluster'; import { - FormattedData, - MapSettings, - MarkerSettings, - PolygonSettings, - PolylineSettings, - UnitedMapSettings + FormattedData, + MapSettings, + MarkerSettings, + PolygonSettings, + PolylineSettings, + UnitedMapSettings } from './map-models'; import { Marker } from './markers'; import { BehaviorSubject, Observable } from 'rxjs'; @@ -405,8 +405,8 @@ export default abstract class LeafletMap { updatePolygon(polyData: FormattedData, dataSources: FormattedData[], settings: PolygonSettings) { this.ready$.subscribe(() => { - const poly = this.polygons.get(polyData.datasource.entityName); - poly.updatePolygon(polyData.data, dataSources, settings); + const poly = this.polygons.get(polyData.$datasource.entityName); + poly.updatePolygon(polyData, dataSources, settings); }); } } diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/maps/polygon.ts b/ui-ngx/src/app/modules/home/components/widget/lib/maps/polygon.ts index 9e169f5b8c..3c90db3ba7 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/maps/polygon.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/maps/polygon.ts @@ -14,7 +14,7 @@ /// limitations under the License. /// -import L, { LatLngExpression, LatLngTuple, LeafletMouseEvent } from 'leaflet'; +import L, { LatLngExpression, LeafletMouseEvent } from 'leaflet'; import { createTooltip, parseWithTranslation, safeExecute } from './maps-utils'; import { FormattedData, PolygonSettings } from './map-models'; @@ -61,7 +61,7 @@ export class Polygon { this.tooltip.setContent(parseWithTranslation.parseTemplate(pattern, data, true)); } - updatePolygon(data: LatLngTuple[], dataSources: FormattedData[], settings: PolygonSettings) { + updatePolygon(data: FormattedData, dataSources: FormattedData[], settings: PolygonSettings) { this.data = data; this.dataSources = dataSources; this.leafletPoly.setLatLngs(data[this.settings.polygonKeyName]);