Forum Academy Marketplace Showcase Pricing Features

Hide element when none googlemap's markers are clicked


I want to show an element if a googlemap’s marker is click and hide this element when none maps markers are clicked.

How to do this in your opinion? Thanks

Try this…

When marker is clicked > set state on map element: label= “clicked”, type = yes/no, value = yes

Condition on element:
when map’s “clicked” is yes > element is visible

By default the state will be “no” on page load, so the element will not be visible.

Gaby | Coaching Bubble

Oh, you could also do when marker is clicked > show element. And have another button to hide element if needed.

You may need to play around with the custom state mentioned in my first reply if you want the user to be able to “unclick” markers to the point of hiding the element again without a button.

Thank you very much for your help @romanmg.

I had already used your first solution but indeed I would like the user could hide the element when he unclicks.
I can’t have a button for hiding the element.

Do you have an other idea?

You could set a custom state (text list, marker labels maybe?) to keep track of which markers have been clicked, and remove them from that list when they have been clicked again. When that list is empty, hide element. I can build out an example later today.

Thank you for your help.

I will test your solution.