Hi,
I am playing around with the new components in the ArcGIS Maps SDK for JavaScript 4.31 and I wondered:
is there an easy way to show hide/components?
For example the compass: Component Reference / Compass - Docs ⋅ Storybook
As long as the map/view faces north (i.e. heading = 0), I do not need the compass at all. But yes, I want the compass to appear when the user rotates the map, to disappear again the moment the map faces north again, i.e. after the user clicked the compass to reset the view.
With the good old widget I would do something like this:
watchUtils.whenTrue(view, "stationary", function() {
if (view.rotation == 0){
view.ui.remove(compassWidget);
} else {
view.ui.add(compassWidget, "top-left");
}
});
How to accomplish something similar with the new components?
TIA,
Egge-Jan