Skip to content

Minimal useMap() example? #322

Answered by usefulthink
jezmck asked this question in Q&A
Apr 23, 2024 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

oh damn... That's a mistake that had to happen at some point.

The <Map id='some-id'> and mapId are completely separate concepts, the first id can be used for the useMap hook to find your map if there's more than one map and that map isn't a parent component, and the mapId is the thing you get for the cloud-based map styling (that's the one you need when you want to use AdvancedMarkers).

If you only have a single map, you don't need to set the id prop (it will internally use the id default).

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@jezmck
Comment options

@usefulthink
Comment options

Answer selected by jezmck
@jezmck
Comment options

Comment options

You must be logged in to vote
1 reply
@jezmck
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants