@evergis/react 4.0.142 → 4.0.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.esm.js
CHANGED
|
@@ -7687,33 +7687,10 @@ const useDataSources = ({ type: widgetType, config, attributes, filters, layerPa
|
|
|
7687
7687
|
});
|
|
7688
7688
|
return newDataSources;
|
|
7689
7689
|
}, []);
|
|
7690
|
-
const zoomToLayersExtent = useCallback(async (layers) => {
|
|
7691
|
-
const newExtent = await api.layers.getBulkExtents({ srId: 4326 }, layers?.map(({ layerName, conditions, parameters }) => ({
|
|
7692
|
-
layerName,
|
|
7693
|
-
conditions,
|
|
7694
|
-
parameters,
|
|
7695
|
-
})));
|
|
7696
|
-
const { coordinates } = newExtent.overall || {};
|
|
7697
|
-
if (!coordinates) {
|
|
7698
|
-
return;
|
|
7699
|
-
}
|
|
7700
|
-
const hasEmptyCoordinate = coordinates.some(([x, y]) => !x && !y);
|
|
7701
|
-
if (hasEmptyCoordinate) {
|
|
7702
|
-
return;
|
|
7703
|
-
}
|
|
7704
|
-
/* const bbox = new Bbox(coordinates[0], coordinates[1], map.crs);
|
|
7705
|
-
const resolution = Math.max(bbox.width / painter.width, bbox.height / painter.height);
|
|
7706
|
-
|
|
7707
|
-
animateTo({
|
|
7708
|
-
position: bbox.center,
|
|
7709
|
-
resolution: map.getAdjustedResolution(resolution),
|
|
7710
|
-
});*/
|
|
7711
|
-
}, [api.layers]);
|
|
7712
7690
|
return {
|
|
7713
7691
|
getDataSourcePromises,
|
|
7714
7692
|
getUpdatingDataSources,
|
|
7715
7693
|
getUpdatedDataSources,
|
|
7716
|
-
zoomToLayersExtent,
|
|
7717
7694
|
};
|
|
7718
7695
|
};
|
|
7719
7696
|
|