Replies: 2 comments 2 replies
-
Actually, the map-prop needs to be removed from the AdvancedMarkerProps type, since assigning the map object to the marker instance is handled automatically. We generally assume that all markers that are rendered should also be displayed on the map, If you want to show a marker at a later point, just don't render it when it shouldn't be shown, something like this: const MyMap = () => {
return (<Map {...mapProps}>
{shouldShowMarker && <AdvancedMarker {...advancedMarkerProps}>Marker Content</AdvancedMarker>}
</Map>);
} |
Beta Was this translation helpful? Give feedback.
2 replies
-
added a bug to adress this: #284 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using translation software to create the text, so sorry if there are any oddities.
AdvancedMarkerComponent receives AdvancedMarkerElementOptions type as props and can pass a map, but the code does not reference the map in the props, but instead sets up a const map in the component.
If I want to display it at an arbitrary time without displaying it at first, I can pass null as a value, but it will be displayed once.
I think I need to set markerRef.map = null in useEffect etc. after that, but am I using it wrong?
myCode
Library Code
Beta Was this translation helpful? Give feedback.
All reactions