aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/MapPositions.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/map/MapPositions.js')
-rw-r--r--modern/src/map/MapPositions.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/modern/src/map/MapPositions.js b/modern/src/map/MapPositions.js
index 600a6373..e47f945c 100644
--- a/modern/src/map/MapPositions.js
+++ b/modern/src/map/MapPositions.js
@@ -101,11 +101,11 @@ const MapPositions = ({ positions, onClick, showStatus, selectedPosition, titleF
features: [],
},
});
- [id, selected].forEach((id) => {
+ [id, selected].forEach((source) => {
map.addLayer({
- id,
+ id: source,
type: 'symbol',
- source: id,
+ source,
filter: ['!has', 'point_count'],
layout: {
'icon-image': '{category}-{color}',
@@ -124,9 +124,9 @@ const MapPositions = ({ positions, onClick, showStatus, selectedPosition, titleF
},
});
map.addLayer({
- id: `direction-${id}`,
+ id: `direction-${source}`,
type: 'symbol',
- source: id,
+ source,
filter: [
'all',
['!has', 'point_count'],
@@ -176,15 +176,15 @@ const MapPositions = ({ positions, onClick, showStatus, selectedPosition, titleF
map.removeLayer(clusters);
}
- [id, selected].forEach((id) => {
- if (map.getLayer(id)) {
- map.removeLayer(id);
+ [id, selected].forEach((source) => {
+ if (map.getLayer(source)) {
+ map.removeLayer(source);
}
- if (map.getLayer(`direction-${id}`)) {
- map.removeLayer(`direction-${id}`);
+ if (map.getLayer(`direction-${source}`)) {
+ map.removeLayer(`direction-${source}`);
}
- if (map.getSource(id)) {
- map.removeSource(id);
+ if (map.getSource(source)) {
+ map.removeSource(source);
}
});
};