Hey, so I was working on a custom widget for Experience builder and my code was running perfectly fine up until yesterday, where it stopped being able to access the layers. This is the code:
const viewManager = MapViewManager.getInstance();
const mapView = viewManager.getJimuMapViewById(viewManager.getAllJimuMapViewIds()[0])
const [jimuMapView, setJimuMapView] = useState<JimuMapView>(mapView); // State for JimuMapView
const [mapReady, setMapReady] = useState(false); // State to track map readiness
useEffect(() => {
if (jimuMapView) {
reactiveUtils
.whenOnce(() => jimuMapView.view.ready)
.then(() => {
setMapReady(true)
}
)
}
}, [jimuMapView])
return (
<div className="widget-demo jimu-widget m-2">
{
props.useMapWidgetIds &&
props.useMapWidgetIds.length === 1 && (
<JimuMapViewComponent
useMapWidgetId={props.useMapWidgetIds?.[0]}
onActiveViewChange={activeViewChangeHandler}
/>
)
}
{mapReady ? 'Map ready' : 'Map not ready'}
</div>
);
};
Thanks in advance!