Select to view content in your preferred language

suspended attribute on arcgis-map web component

246
2
a week ago
FentonCheng_-_DIT
Emerging Contributor

What causes the "suspended" attribute to change from the default value of "true" to "false"? The documentation says it indicates if the view is visible on the page, so what changes can cause the view to not be visible?

0 Kudos
2 Replies
Sage_Wall
Esri Regular Contributor

This can happen if you remove the view from the dom or otherwise hide it.  For instance if you have two calcite tabs on web page, each with a map with the `auto-distroy-disabled` attribute set.  The map element in the non active tab will be suspended.

https://codepen.io/sagewall/pen/ByjoqXG?editors=1000

FentonCheng_-_DIT
Emerging Contributor

I did have 'auto-destroy-disabled' set on some of the components, so I removed it. There's only one map on the web page though. 

The original is using Angular 20 and ESM; converted the basic functionality over except for one piece that is Angular specific (there's a flag that's used to choose between map and scene). The idea is that the map/scene loads to a preset point, then the user can click a button to go to a new point of interest.

In the Angular version, this line: console.log("button clicked: ", viewElement.suspended) would return true instead of false after the click and the map doesn't load, but the UI (zoom, search) is still there.

https://codepen.io/fentonc/pen/VYevJmX

0 Kudos