From dcf9418304f08416fcbed0ff3589e47d38ebc387 Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Wed, 24 Jun 2020 20:39:48 +0300 Subject: [PATCH] UI: fix maps update --- .../home/components/widget/lib/maps/leaflet-map.ts | 12 ++++++------ .../components/widget/widget-config.component.ts | 5 ++--- 2 files changed, 8 insertions(+), 9 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 23316075db..c45440faee 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 @@ -307,11 +307,11 @@ export default abstract class LeafletMap { keys.push(data.entityName); }); const toDelete: string[] = []; - for (const mKey in this.markers.keys()) { + this.markers.forEach((v, mKey) => { if (!keys.includes(mKey)) { toDelete.push(mKey); } - } + }); toDelete.forEach((key) => { this.deleteMarker(key); }); @@ -408,11 +408,11 @@ export default abstract class LeafletMap { } }); const toDelete: string[] = []; - for (const mKey in this.polylines.keys()) { + this.polylines.forEach((v, mKey) => { if (!keys.includes(mKey)) { toDelete.push(mKey); } - } + }); toDelete.forEach((key) => { this.removePolyline(key); }); @@ -471,11 +471,11 @@ export default abstract class LeafletMap { } }); const toDelete: string[] = []; - for (const mKey in this.polygons.keys()) { + this.polygons.forEach((v, mKey) => { if (!keys.includes(mKey)) { toDelete.push(mKey); } - } + }); toDelete.forEach((key) => { this.removePolygon(key); }); diff --git a/ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts b/ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts index 00ba5b2b8d..4924d48083 100644 --- a/ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts @@ -714,9 +714,8 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, Cont } private fetchEntityKeys(entityAliasId: string, query: string, dataKeyTypes: Array): Observable> { - return this.aliasController.getAliasInfo(entityAliasId).pipe( - mergeMap((aliasInfo) => { - const entity = aliasInfo.currentEntity; + return this.aliasController.resolveSingleEntityInfo(entityAliasId).pipe( + mergeMap((entity) => { if (entity) { const fetchEntityTasks: Array>> = []; for (const dataKeyType of dataKeyTypes) {