Replies: 7 comments
-
Hi @ralbear You'll have to manually control the info windows through refs. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the response, will give a try! |
Beta Was this translation helpful? Give feedback.
-
I give a few tries to this but can't find a working approach, is there any similar example I can base on? I try to find it few times without luck. |
Beta Was this translation helpful? Give feedback.
-
friend after trying to solve your same problem this is my solution I hope it can help you. |
Beta Was this translation helpful? Give feedback.
-
The closeInfoWindows function closes all InfoWindows except the one at the provided index i. This is achieved by iterating through all the InfoWindow references stored in infoWindows and closing each of them except the one at index i. This solution takes into account the opening of InfoWindows and closing of others when clicking on a marker. It also closes all InfoWindows when clicking anywhere on the map, as it still uses the |
Beta Was this translation helpful? Give feedback.
-
@ssantss This works perfect at first attempt! Muchas gracias!😃 |
Beta Was this translation helpful? Give feedback.
-
this approach worked for me! ChatGPT gave me the approach of conditionally displaying info windows based on a ref of marker.id That approach required a double click on markers to get the window to open. Probably some kind of race condition setting the info window marker id ref after the info window is set to display. Thank you @ssantss ! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I have few markers with a
<InfoWindow>
on it. How can I close the open<InfoWindow>
when I click on the map or open other<InfoWindow>
?Thanks :)
Beta Was this translation helpful? Give feedback.
All reactions