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

Add toggle callback #5

Merged
merged 2 commits into from
Nov 25, 2022
Merged

Add toggle callback #5

merged 2 commits into from
Nov 25, 2022

Conversation

wipfli
Copy link
Contributor

@wipfli wipfli commented Nov 24, 2022

Adding a callback for toggle events is useful to share the inspect plugin state in the URL hash.

For example http://localhost:3000/examples/url-hash-toggle-callback#map=7.72/34.987/33.34&inspect turns the plugin on and shows this:

image

@acalcutt
Copy link
Collaborator

Is there supposed to be an example file with this. I don't have url-hash-toggle-callback.html

@wipfli
Copy link
Contributor Author

wipfli commented Nov 24, 2022

Oh i did not check it in sorry

Copy link
Collaborator

@acalcutt acalcutt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems useful. I may use this in my own projects

@acalcutt acalcutt merged commit 11b5af2 into maplibre:main Nov 25, 2022
@wipfli wipfli deleted the add-toggle-callback branch November 25, 2022 19:23
@wipfli
Copy link
Contributor Author

wipfli commented Nov 25, 2022

Great, thanks for reviewing

@wipfli
Copy link
Contributor Author

wipfli commented Nov 25, 2022

Can you make a release? Want to use it for swiss-map...

@wipfli
Copy link
Contributor Author

wipfli commented Nov 27, 2022

Thanks for creating the release, @acalcutt! Here is an example showing the inspect state in the URL:

https://wipfli.github.io/swiss-map/#map=12.22/43.56452/3.93222&inspect

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