Is it possible to dynamically switch Markers? #3097
Replies: 3 comments 1 reply
-
Don't just blindly copy the code from examples. onLoad example is just an example of using the map instance. Just remove it from your code. |
Beta Was this translation helpful? Give feedback.
-
Don't blindly make assumptions about people's code Alexey. It's neither helpful nor constructive. I'm not "blindly" copying code, I'm using the suggested code from a question and answer posted on your own Slack channel here Great answer though - "just remove it" 👍🏻 |
Beta Was this translation helpful? Give feedback.
-
I recently implemented the similar interaction. Basically, we show the larger marker either:
Your codes seem logical. You have "selectedCard", we have "selectedPlace". You may try 2 things if you still have this issue:
Good luck. :) |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm trying to show a highlighted marker when global state changes, but I'm unable to get the Marker to alternate. I have tried two methods, first changing the actual icon of the marker:
and second, changing the entire marker:
I presume the way the map is initialised in the onLoad function is preventing the Markers from being reactive after initialisation. This is the onLoad function, where I set bounds:
Does anyone have experience of doing this, please? It works the other way around, where if the user hovers over a marker, we set global state to that marker's id, and the corresponding card is highlighted, I just can't get the markers to change when a product card is hovered.
Any help very much appreciated!
Cheers,
Matt
Beta Was this translation helpful? Give feedback.
All reactions