From 9dde36dd236e3b2e29a1c0f9da7b552e6f39d7aa Mon Sep 17 00:00:00 2001 From: LE DIOURON Kevin Date: Mon, 4 Oct 2021 15:57:29 +0200 Subject: [PATCH] fix(cluster): Prise en compte du markersArea dans le updateCluster --- src/iotMapManager/src/iot-map-cluster-manager.ts | 4 ++++ src/map/map.component.ts | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/iotMapManager/src/iot-map-cluster-manager.ts b/src/iotMapManager/src/iot-map-cluster-manager.ts index 9c96b01b..8a95764c 100644 --- a/src/iotMapManager/src/iot-map-cluster-manager.ts +++ b/src/iotMapManager/src/iot-map-cluster-manager.ts @@ -142,6 +142,10 @@ export class IotMapClusterManager { currentClusterInfos.aggregation = params.aggregation htmlModificationNeeded = true } + // Update cluster zoom + if (params.markersArea !== undefined) { + currentClusterInfos.markersArea = params.markersArea + } // update cluster icon if (htmlModificationNeeded) { diff --git a/src/map/map.component.ts b/src/map/map.component.ts index da1d0b3d..28ce3183 100644 --- a/src/map/map.component.ts +++ b/src/map/map.component.ts @@ -336,7 +336,8 @@ export class MapComponent implements AfterViewInit { lat: 44.882, lng: 4.895 }, - markersArea: new LatLngBounds([44.880, 4.89], [44.885, 4.9]), + // markersArea: new LatLngBounds([44.880, 4.89], [44.885, 4.9]), + markersArea: new LatLngBounds([0,0], [1,1]), contentLabel: 'interfaces', colNumber: 2, childCount: 4860, @@ -676,8 +677,11 @@ export class MapComponent implements AfterViewInit { this.iotMapClusterManager.addClusters(this.clustersList) this.iotMapUserMarkerManager.addUserMarker(this.userMarker) this.iotMapPathManager.addPath(this.chemin) + // Do the same when you want to override the zoom on a clicked cluster + this.iotMapClusterManager.updateCluster('cluster 1', { markersArea: new LatLngBounds([44.880, 4.89], [44.885, 4.9])}) this.iotMapAreaManager.addArea(this.zone) + } }