gis-ops / valhalla-app

This is the demo web app running on https://valhalla.openstreetmap.de
https://valhalla.openstreetmap.de
MIT License
157 stars 87 forks source link

[BUG] Debounce Isochrone API calls when adjusting interval settings by dragging the sliders #121

Closed wcedmisten closed 1 year ago

wcedmisten commented 1 year ago

Description

What is the problem you are facing

Currently when these sliders get adjusted by dragging them (not by clicking on a value), the frontend makes a request for each interval between the previous value and the new value. This results in the page lagging as the ~60 requests return sequentially and each redraw the polygon. This also puts extra strain on the server from this many requests being made in quick succession.

What is your suggested solution

Adjusting the slider should not send a request with the new settings until the mouse click is released.

Screenshots

image

image

nilsnolde commented 1 year ago

Oh yes, good one! There should also be a debounce on the manual input, currently it seems to request for every keystroke. And not only isochrones, also routing, but that'd be implicit since they share the settings.

It's quite a cool feature in the OSRM demo app, that it requests all the time when you move a marker along the map. But it's only routing and OSRM is crazy fast, even on very long routes, Valhalla isn't that much..

sandstone991 commented 1 year ago

Hello @nilsnolde you might remember me from my previous unannounced PRs, so I'm going to ask to be assigned first this time, can I work on this?

nilsnolde commented 1 year ago

Sure, thanks!