avoid adding deleted layer to map on layer switch
This commit is contained in:
parent
02f2ace72e
commit
cfbb15c895
@ -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);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user