Perspective Map - disable marker when opacity is set to 0?


I currently have about 89 markers on a map and use a dropdown to filter them by area. When a user clicks on a marker, it opens a popup.

I’m turning the opacity of some markers to 0 when they are not in the area that is selected in the dropdown but I’m still able to open the popup when I click in the general area where these hidden markers are.

Is there a way to disable the marker completely?



That is an interesting issue. I would think there would be an easy way to accomplish this. Is the text in the Popup static or is it determined when the user clicks on the marker?

I tried binding the marker[i]["popup"]["enabled"] property to False but it doesn’t affect the popup behavior how I would have expected.

I use a script to get the Site Name (here A and B), Lat, Lng from SQL and the same script also gets the tag value of Flow Rate, Pressure and Active Unack alarms and pushes them to params of the popup. When a user clicks, it just opens the popup, the data is already there.

I did the same but from the script - like: if marker opacity is set to 0 then [popup][enabled] = False but that just closes the popup, it looks like.

I thought setting opacity of an object to 0 would it make it invisible and reject any actions.

I would think setting the opacity of an object to 0 would be like a visibility: hidden instead of a display: none. In other words, the component would still take up space but it would not be visible.

What if on the same script you set the marker opacity to 0 you also remove the marker[i]["popup"]["content"]["view"]["path"] and the marker[i]["popup"]["content"]["text"] properties (set them to None or an empty string)? It seems like when there is no text and no view specified, the marker popup doesn’t open (obviously).

What is determining when the marker is visible?

Thanks @YF129701 , I tried like you suggested and it worked! Since this view is for the perspective app, I don’t have to worry about the hand cursor showing up on markers that are not visible.

We will need to set the params to empty as well for it to work or else it will try to open the popup with “view not found” error.

tempDict['popup']['content']['view']['params'] = {}

1 Like

I know this may have been solved for you already, but I was having a similar issue, and setting the opacity will not work in my case and icon is still clickable and shows text when hovered over. I found that changing the marker icon height and width to 0 works just as well, and bypasses any issues with icons and texts showing up, as well as the background icon shadow still being visible. Hope this helps someone else.