-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Geojson layer not clearing (Removal Not noticing) #463
Comments
Hey @InhyeLee-Data, can you please create a fork of this codesandbox or this codesandbox & provide a reproducible example? |
I'm having the same issue: Tell us about your files× {{file.file.name}} {{file.file.type}} {{option.display}}
function readFileAsync(file) {
}) export default {
},
},
I'm allowing users to drag a shapefile or geojson onto the page. Then I show it. But they can deactivate a layer, and it is removed from the Vue inspector, but remains active on the map. Seems no proper destruction is happening when a layer is removed. |
@stefangeorg can you please create a sandbox for better debugging ? |
@vinayakkulkarni I'll try to setup one, but its relatively simple actually. There is no onUnmounted action. So if the VLayerMapboxGeojson is removed from the parent, the layers and source remain on the map eventhough the component is no longer there. We should cleanup on unMounted to remove the layer and source (or have an options to keep the source but remove the layer) |
Here is how I solved it By extending your component, and passing in the map object as a property. export default defineComponent({
If I inactivate a layer, then it will get removed from the map. |
Hi! I'm on a nuxt app with a vue-mapbox wrapper.
One interesting issue I have right now is that a geojson layer that is removed in code still pertains to exist in the rendered page.
This is the scenario.
Anybody has an idea why this would happen and how I may be able to work through this?
The text was updated successfully, but these errors were encountered: