encLayer.loadStatusChanged.connect(()=> {
if (encLayer.loadStatus === Enums.LoadStatusLoaded) {
loadedEncLayerCount++;
}
// loop through the layers and zoom to the combined full extent
if (loadedEncLayerCount === datasets.length) {
const fullExtents = [];
map.operationalLayers.forEach(layer => fullExtents.push(layer.fullExtent));
const fullExtentOfLayers = GeometryEngine.combineExtentsOfGeometries(fullExtents);
mapView.setViewpointGeometry(fullExtentOfLayers)
}
});