Skip to content

Commit f20f07b

Browse files
committed
DBC22-6776: switch to fixed pixels to cluster icons
1 parent 5f7ae5b commit f20f07b

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

  • src/frontend/src/Components/map/layers

src/frontend/src/Components/map/layers/index.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,13 @@ const layerUpdateFuncMap = {
4141
dms: updateDmsLayer,
4242
}
4343

44-
const CLUSTER_DISTANCE_METERS = 178571; // 178 km converted to about 50 pixel on the map has the best effect when zoom in/out
45-
let pixelDistance = 50; // defalt pixel 50 has the best effect
46-
4744
export const loadLayer = (mapLayers, mapRef, mapContext, key, dataList, filteredDataList, zIndex, referenceData, updateReferenceFeature, setLoadingLayers) => {
4845
// Always remove and regenerate route layer
4946
if (key == 'routeLayer') {
5047
mapRef.current.removeLayer(mapLayers.current[key]);
5148
}
5249

5350
const view = mapRef.current.getView();
54-
55-
function updateClusterDistance() {
56-
const resolution = view.getResolution(); // meters per pixel
57-
// Convert meters to pixels
58-
pixelDistance = CLUSTER_DISTANCE_METERS / resolution;
59-
}
60-
61-
view.on('change:resolution', updateClusterDistance);
62-
updateClusterDistance();
6351

6452
if (dataList) {
6553
if (!mapLayers.current[key] || key == 'routeLayer') {
@@ -71,7 +59,7 @@ export const loadLayer = (mapLayers, mapRef, mapContext, key, dataList, filtered
7159
referenceData,
7260
updateReferenceFeature,
7361
setLoadingLayers,
74-
pixelDistance
62+
50
7563
);
7664

7765
mapRef.current.addLayer(mapLayers.current[key]);

0 commit comments

Comments
 (0)