Skip to content
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

event handling, to extend to manage other hash arguments #36

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mikelmaron
Copy link

event handling, to extend to manage other hash arguments and map behaviors.
our use case is representing state of visible tile layers in the hash.

on/off

adding/removing callback functions for when hash "change", or map "update". callback function manipulates hash, or takes action depending on hash.

trigger

after making a change to the map state, triggers a response to a map move

setMovingMap/clearMovingMap

prevent updates while making a series of changes to the map, by bracketing the code block with these calls

@jfirebaugh
Copy link
Contributor

Hi Mikel. I'm not exactly clear on the use case for this. Could you revise (fix formatting) and expand your description a bit?

Also, can you use the same indentation and spacing style as the surrounding code, and include tests?

@mikelmaron
Copy link
Author

@jfirebaugh I've cleaned up the formatting, and added tests. The tests should hopefully illustrate the use case.

Basically, this is used for keeping other elements of the map state in hash. So for instance, #13/51.5050/-0.0900&layers=HOT loads the humanitarian layer, similar to behavior on osm.org, but more integrated with leaflet-hash.

@mikelmaron
Copy link
Author

Could make sense to move the argument parsing functions in the test into leaflet itself, as convenience functions?

useful for updating embed links and such
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants