mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-02 08:42:31 +00:00
avoid adding deleted layer to map on layer switch
This commit is contained in:
@@ -115,9 +115,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$: if ($map) {
|
$: if ($map) {
|
||||||
$map.on('style.load', () => {
|
$map.on('style.load', addGPXLayer);
|
||||||
addGPXLayer();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$: if ($selectedFiles.has(file)) {
|
$: if ($selectedFiles.has(file)) {
|
||||||
@@ -174,6 +172,7 @@
|
|||||||
$map.off('click', layerId, selectOnClick);
|
$map.off('click', layerId, selectOnClick);
|
||||||
$map.off('mouseenter', layerId, toPointerCursor);
|
$map.off('mouseenter', layerId, toPointerCursor);
|
||||||
$map.off('mouseleave', layerId, toDefaultCursor);
|
$map.off('mouseleave', layerId, toDefaultCursor);
|
||||||
|
$map.off('style.load', addGPXLayer);
|
||||||
|
|
||||||
$map.removeLayer(layerId);
|
$map.removeLayer(layerId);
|
||||||
$map.removeSource(layerId);
|
$map.removeSource(layerId);
|
||||||
|
Reference in New Issue
Block a user