Leaflet / Leaflet.draw

Vector drawing and editing plugin for Leaflet
https://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html
MIT License
1.98k stars 994 forks source link

Performance issue when Edit button is clicked for big GeoJSON / How to change default square edit icons #996

Open tahaerden opened 4 years ago

tahaerden commented 4 years ago

What I aim is:

  1. Display a GeoJSON route with 3000+ points/multipoints
  2. Set some styles for each point, and show tooltips
  3. Make this route editable
  4. Make it all work in a highly performant manner.

Here is my current code: https://codepen.io/tahaerden/pen/GRZqJJj

I have managed to get rid of performance issues of initial drawing using 'renderer: myRenderer' in geoJSON pointToLayer function.

Now when the 'Edit layers' button is clicked, the screen freezes a lot, and it's hard to move around on the map. I want to implement the same solution above, or a similar one in order to increase performance.

So my question is, is it possible to change the default square icons in the Edit mode? So that I can use a custom icon, or a renderer option.

I've already tried extending classes (Circle,Marker,Poly,PolyVerticesEdit,Rectangle,SimpleShape) and using setDrawingOptions. But nothing changed the white squares.