Select to view content in your preferred language

disable popup on map using map component

196
1
Jump to solution
2 weeks ago
LefterisKoumis
Frequent Contributor

There is a probably a simple solution to this. I just want to disable the popup on the feature layer defined by a url when you use arcgis-map component. I already used the popup-enabled="false" but didn't work. I assume that the popup-enabled is working only for arcgis-map with item-id.

I can click on a feature and view it on the arcgis-features, but I want to remove the popups display on the map

https://codepen.io/lkoumis1/pen/dPogWVR?editors=1111

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Esri Frequent Contributor

This is a good question! Because it highlights one of the changes and nuances of using web components and HTML in general. Documentation on boolean for reference.

In HTML elements, the presence of an attribute is truthy. Even an empty string is truthy, so we don't have an attribute on the map components for `popup-enabled="false"` as that would be seen as true. Hopefully that makes sense.

So what we did in the map-components is make all boolean properties false by default and we have different names for them on the components. In this case, you can just add `popup-disabled` to the element.

Demo: https://codepen.io/odoe/pen/VYLErVR?editors=1000

<arcgis-map
  item-id="45725ba7d9fb47a0925398919b13d1fa"
  popup-disabled
>
</arcgis-map>

 

View solution in original post

0 Kudos
1 Reply
ReneRubalcava
Esri Frequent Contributor

This is a good question! Because it highlights one of the changes and nuances of using web components and HTML in general. Documentation on boolean for reference.

In HTML elements, the presence of an attribute is truthy. Even an empty string is truthy, so we don't have an attribute on the map components for `popup-enabled="false"` as that would be seen as true. Hopefully that makes sense.

So what we did in the map-components is make all boolean properties false by default and we have different names for them on the components. In this case, you can just add `popup-disabled` to the element.

Demo: https://codepen.io/odoe/pen/VYLErVR?editors=1000

<arcgis-map
  item-id="45725ba7d9fb47a0925398919b13d1fa"
  popup-disabled
>
</arcgis-map>

 

0 Kudos