Don't remove source and layer on unregister
I'm not convinced this is necessary since we are freeing the map itself and its causing a crash on navigation away.
This commit is contained in:
parent
77283b3654
commit
c1a8249dc0
1 changed files with 4 additions and 0 deletions
|
|
@ -57,10 +57,12 @@ provide("registerSource", (id: string, config: any) => {
|
|||
|
||||
provide("unregisterSource", (id: string) => {
|
||||
console.log("unregister source", id);
|
||||
/*
|
||||
sources.delete(id);
|
||||
if (map.value && map.value?.getSource(id)) {
|
||||
map.value.removeSource(id);
|
||||
}
|
||||
*/
|
||||
});
|
||||
|
||||
provide("registerLayer", (id: string, config: any) => {
|
||||
|
|
@ -75,10 +77,12 @@ provide("registerLayer", (id: string, config: any) => {
|
|||
|
||||
provide("unregisterLayer", (id: string) => {
|
||||
console.log("unregister layer", id);
|
||||
/*
|
||||
layers.delete(id);
|
||||
if (map.value?.getLayer(id)) {
|
||||
map.value.removeLayer(id);
|
||||
}
|
||||
*/
|
||||
});
|
||||
|
||||
function initializeMap() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue