digidem / leaflet-side-by-side

A Leaflet control to add a split screen to compare two map overlays
http://lab.digital-democracy.org/leaflet-side-by-side/
MIT License
344 stars 108 forks source link

Issue with adding and removing the control #8

Open joglr opened 7 years ago

joglr commented 7 years ago

When trying to use Map.removeControl() on sideBySide, I get the following error:

leaflet-src.js:7932 Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. at NewClass.removeFrom (node_modules/leaflet/dist/leaflet-src.js:7932:10) at NewClass.removeControl (node_modules/leaflet/dist/leaflet-src.js:7963:11)

Is this a known issue?

m-mohr commented 6 years ago

I have problems with this, too. When removing I get:

index.js?606c:101 Uncaught TypeError: Cannot read property 'style' of null
    at NewClass.remove (index.js?606c:101)
    at NewClass.removeControl (leaflet-src.js?9eb7:4763)
    at VueComponent.updateLayerTree (eval at ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"c:\\Dev\\openeo-web-editor\\node_modules\\.cache\\cache-loader"}!./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/MapViewer.vue (app.js:1050), <anonymous>:118:18)
    at NewClass.boundFn (vue.runtime.esm.js?ff9b:190)
    at NewClass.fire (leaflet-src.js?9eb7:593)
    at NewClass.removeLayer (leaflet-src.js?9eb7:6572)
    at NewClass._onInputClick (leaflet-src.js?9eb7:5165)
    at HTMLInputElement.handler (leaflet-src.js?9eb7:2280)

The second map gets removed, but the slider is still there...