Raruto / leaflet-elevation

Leaflet plugin that allows to add elevation profiles using d3js
GNU General Public License v3.0
254 stars 82 forks source link

Slow zooming animation when loading a large route (~50000 coordinates) #236

Closed gaetano603 closed 1 year ago

gaetano603 commented 1 year ago

I loaded a route on the map which is made up of about 50,000 coordinates (latitude and longitude). The zoom function on the map is very slow. Adding preferCanvas: true to the map options resulted in a clear speed improvement but not enough with that many coordinates. Is there a way to increase its speed?

Your environment

gaetano603 commented 1 year ago

I solved deleting these settings from options.

distanceMarkers: true,
distanceMarkers_options: {
  lazy: true
}
Raruto commented 1 year ago

Hi @gaetano603, thanks for the report (and workaround).

Please can you send two links to two different demos showing the difference in performance between this options turned on and off?

As i remember, the distance markers should also support the canvas renderer:

https://github.com/Raruto/leaflet-elevation/blob/868179234d8e9b8f7beaea57d0e34d8bd79a2622/libs/leaflet-distance-marker.js#L183-L200

👋 Raruto

Raruto commented 1 year ago

I'm closing this due to inactivity