You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whats the preferred way to remove the hexbinlayer from the map?
When I call
map.removeLayer(hexLayer);
or
hexLayer.remove()
the hexbins of the current zoom level freeze and remain as an artifact on the map canvas.
I can simply remove it on one zoom level only with d3.selectAll("g").remove() but is this really the 'proper' way?
I run into problems as I'm using geoman to draw polygons. It also uses g elements so everytime I call the above function I remove the polygon as well.
You can try with the standard hexbins jsfiddle.
I managed to access the parent element with $( ".hexbin" ).parent( "g" ).remove() so it behaves the way I want but still it doesn't seem elegant to me.
Additionally I noticed that after adding the layer to leaflet layer control the layer can't be turned off and behaves in the same way.
The text was updated successfully, but these errors were encountered:
Whats the preferred way to remove the hexbinlayer from the map?
When I call
or
the hexbins of the current zoom level freeze and remain as an artifact on the map canvas.
I can simply remove it on one zoom level only with
d3.selectAll("g").remove()
but is this really the 'proper' way?I run into problems as I'm using geoman to draw polygons. It also uses
g
elements so everytime I call the above function I remove the polygon as well.You can try with the standard hexbins jsfiddle.
I managed to access the parent element with
$( ".hexbin" ).parent( "g" ).remove()
so it behaves the way I want but still it doesn't seem elegant to me.Additionally I noticed that after adding the layer to leaflet layer control the layer can't be turned off and behaves in the same way.
The text was updated successfully, but these errors were encountered: