Skip to content

Commit

Permalink
Merge branch 'change-cluster-zoom' into 'master'
Browse files Browse the repository at this point in the history
fix(cluster): Prise en compte du markersArea dans le updateCluster

See merge request iot-map-component/iotmapcomp2!1
  • Loading branch information
sandrinegateau committed Oct 4, 2021
2 parents a9ca3ae + 9dde36d commit 34513bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/iotMapManager/src/iot-map-cluster-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 5 additions & 1 deletion src/map/map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)

}
}

0 comments on commit 34513bd

Please sign in to comment.