mapbox-gl-draw
mapbox-gl-draw copied to clipboard
map.removeControl(draw); throws an error
It seems when trying to remove the control using map.removeControl(draw);
it throws an error. I think removeControl()
is not properly implemented.
I've got that error too
just need to know if this is going to be solved
Uncaught TypeError: can't access property "off", e.map is undefined
where 'map' is my mapbox instance
Any update regarding this? This issue is still persisted till now. Using react-map-gl, I am attempting to remove draw when it unmounts but I get the error can't access property "off"
.
useEffect(() => {
if (!map) return;
map.addControl(...)
return () => {
map.removeControl(...) // throws error
}
}, [map])
This is really proving to be a nuisance as my current method is to completely reload the map between navigations which means higher API usage cc @kkaefer
Noticed this too.