Skip to content

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