mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-10-18 17:02:29 +00:00
avoid adding deleted layer to map on layer switch
This commit is contained in:
1 parent
02f2ace72e
commit
cfbb15c895
1 file changed
+2
-3
@@ -115,9 +115,7 @@
|
||||
}
|
||||
|
||||
$: if ($map) {
|
||||
$map.on('style.load', () => {
|
||||
addGPXLayer();
|
||||
});
|
||||
$map.on('style.load', addGPXLayer);
|
||||
}
|
||||
|
||||
$: if ($selectedFiles.has(file)) {
|
||||
@@ -174,6 +172,7 @@
|
||||
$map.off('click', layerId, selectOnClick);
|
||||
$map.off('mouseenter', layerId, toPointerCursor);
|
||||
$map.off('mouseleave', layerId, toDefaultCursor);
|
||||
$map.off('style.load', addGPXLayer);
|
||||
|
||||
$map.removeLayer(layerId);
|
||||
$map.removeSource(layerId);
|
||||
|
||||
Reference in new issue
Block a user