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

Example Interaction: Add URL hash #2308

Open
wants to merge 1 commit into
base: 7.1-release
Choose a base branch
from

Conversation

tordans
Copy link
Contributor

@tordans tordans commented Oct 28, 2023

This make the current zoom visible in https://visgl.github.io/react-map-gl/examples/interaction and with it understanding the options that one can set easier.

@matburnham
Copy link

Is this trying to add the map's position to its page's location hash? I can't seem to get the same to work with react-map-gl@7.1.6.

According to #665 this was previously done with mapOptions={{ hash: true }}. But the upgrade guide for v.7.0 shows "mapOptions is removed. Almost all of the options for the native Map class are exposed as props." That said, I can't find reference to hash in the current codebase, and it's not documented in the Map API reference.

Should this work?

@tordans
Copy link
Contributor Author

tordans commented Dec 2, 2023

That said, I can't find reference to hash in the current codebase, and it's not documented in the Map API reference.

I assume that is because of this...

Aside from the props listed below, the Map component supports all parameters of the Map class constructor (Mapbox | Maplibre). Beware that this is not an exhaustive list of all props. Different base map libraries may offer different options and default values. When in doubt, refer to your base map library's documentation.

Meaning, the docs does not list all props that are just passed to the map library. I was confused by this myself, before.

@matburnham
Copy link

And it does work 🤦. I was just being an idiot. I was running my previously compiled code with yarn run start rather than yarn run dev so nothing was ever changing.

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.

None yet

2 participants