Optimize setWaypoints performance (#312)

Loading a track as route with lots of waypoints (simplify tolerance of 0) caused a long pause before even handling the first route request.

This seems to be caused by a repaint for every added marker/layer. Adding them all at once in FeatureGroup.addTo(map) helps (although still added in a loop).
This commit is contained in:
Norbert Renner 2020-07-01 10:35:50 +02:00
parent 4892c2a1db
commit bacf60a3ba
3 changed files with 22 additions and 6 deletions

View file

@ -4917,9 +4917,9 @@ leaflet-providers@^1.5.0:
resolved "https://registry.yarnpkg.com/leaflet-providers/-/leaflet-providers-1.5.0.tgz#06d598231ef36f8d0566c219cedf18cef2ff80f5"
integrity sha512-btncloSyOHrgYNexoz2dRpCl+U9iDQME91RsOWQWNAD9jQUPAkq9mxuTvL/O9VOwrqcEtzhvuHBHIOacJAZDxQ==
leaflet-routing@nrenner/leaflet-routing#62bf722:
version "0.1.2"
resolved "https://codeload.github.com/nrenner/leaflet-routing/tar.gz/62bf72277a99d478f7d3f866ca85be0977089c13"
leaflet-routing@nrenner/leaflet-routing#e94e153:
version "0.1.3"
resolved "https://codeload.github.com/nrenner/leaflet-routing/tar.gz/e94e153b7574510313cb0bfefcd8776edebf627e"
leaflet-sidebar-v2@nrenner/leaflet-sidebar-v2#dev:
version "3.0.2"