I have to handle a massive quantity of custom markers on react-leaflet map. I tried to follow the answer in this stackoverlow thread React leaflet Canvas It seems to work, a bit. The problem is that i am still trying to understand how to remove the marker layer without break the map when click on a button. I tried the "map.removeLayer" used inside the library but it doesnt seems to work because it gives me back errors. I even tired the removeLayer method inside the library suggested but it works as a "removeMarker" so i think it doesnt work that method.
Anyone know how to do it?
Link to the example https://ejuke.github.io/Leaflet.Canvas-Markers/examples/index.html
Thank you everyone