-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
throttle location.replace() #38
Comments
I think it would help to see an example app that demonstrates the spammy behavior. By default leaflet-hash binds only to the |
We might be getting ahead of ourselves here anyway, as neither of these are "standard" examples, but please bear with me :) In the Leaflet 1.0 (master) branch, For the Tangram renderer (which bridges to leaflet as a plugin), we've used I understand if these are too specific to warrant a change to leaflet-hash, but any related advice would be appreciated. Thanks! |
It sounds like you have some pretty specific needs with Tangram and will probably have to write some custom animation code to get the result you are looking for without generating excessive move events. I would say that it's too specific to warrant a change to leaflet-hash, but @mlevans's call ultimately. :) |
Makes sense, thanks. |
Currently the hash is updated with the onMapMove event, and in Mac Chrome (40.0.2214.69 beta (64-bit) at least), this causes a performance hit to map drawing as the location bar is spammed. I'd like to suggest a throttle on location.replace(), similar to the update() throttle – but everything including the update() is triggered by the onhashchange event, expecting that the hash is being updated constantly during moves. So it seems this would involve reorganizing the whole file, effectively inverting the relationship between onhashchange and onMapMove.
Is there a good reason not to do this? I have a working example that seems to function just as I want it to, but I don't know whether it would break some use case besides my own.
The text was updated successfully, but these errors were encountered: