diff options
author | jcardus <asklocation.net@gmail.com> | 2023-07-30 22:12:24 +0100 |
---|---|---|
committer | jcardus <asklocation.net@gmail.com> | 2023-07-30 22:12:24 +0100 |
commit | 7f639aaa4a424b14d530c13067c5e45922e6f87b (patch) | |
tree | a43fe43c1926ca315ce51a8f65b88dc0c0d01b95 /modern/src | |
parent | b2ca4606ef22eb6980a079b034bfb8f16052e05b (diff) | |
download | trackermap-web-7f639aaa4a424b14d530c13067c5e45922e6f87b.tar.gz trackermap-web-7f639aaa4a424b14d530c13067c5e45922e6f87b.tar.bz2 trackermap-web-7f639aaa4a424b14d530c13067c5e45922e6f87b.zip |
id -> source
Diffstat (limited to 'modern/src')
-rw-r--r-- | modern/src/map/MapPositions.js | 24 |
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); } }); }; |