Esri / esri-leaflet

A lightweight set of tools for working with ArcGIS services in Leaflet. :rocket:
https://developers.arcgis.com/esri-leaflet/
Apache License 2.0
1.61k stars 798 forks source link

Fix performance issue with refreshing features #1346

Closed patrickarlt closed 1 year ago

patrickarlt commented 1 year ago

This should resolve #1340 which is a result of an error I made in #1304.

  1. In #1304 I added a call to redraw.
  2. Internally this eventually called resetStyle
  3. resetStyle calls resetFeatureStyle on every feature in the layer. This ends up causing a huge amount of extra calls since it calls since the happens N * N times.

This PR simply changes this to call resetFeatureStyle directly for the specific feature.

gavinr commented 1 year ago

This has been released in v3.0.9 https://jsbin.com/qubokaculi/1/edit?html,output is the demo case using v3.0.9 and it is working.