@evergis/react 2.0.80 → 2.0.83
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/components/EvergisCard/MailValue.d.ts +0 -1
- package/dist/components/EvergisCard/PhoneValue.d.ts +0 -1
- package/dist/components/EvergisCard/UrlValue.d.ts +0 -1
- package/dist/components/MapControls/Fullscreen.d.ts +0 -1
- package/dist/components/MapControls/Measure.d.ts +0 -1
- package/dist/components/MapControls/Search.d.ts +0 -1
- package/dist/components/Noop/index.d.ts +0 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useMapResize.d.ts +1 -0
- package/dist/react.cjs.development.js +16 -0
- package/dist/react.cjs.development.js.map +1 -1
- package/dist/react.cjs.production.min.js +1 -1
- package/dist/react.cjs.production.min.js.map +1 -1
- package/dist/react.esm.js +17 -2
- package/dist/react.esm.js.map +1 -1
- package/package.json +4 -4
package/dist/hooks/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './useFeatureLayer';
|
|
|
10
10
|
export * from './useLayerOrder';
|
|
11
11
|
export * from './useLayerVisibility';
|
|
12
12
|
export * from './useMapBboxChange';
|
|
13
|
+
export * from './useMapResize';
|
|
13
14
|
export * from './useMapPick';
|
|
14
15
|
export * from './useMapState';
|
|
15
16
|
export * from './useMapView';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useMapResize(onResize?: (size: number[]) => void): void;
|
|
@@ -3293,6 +3293,21 @@ function getMapState(map) {
|
|
|
3293
3293
|
};
|
|
3294
3294
|
}
|
|
3295
3295
|
|
|
3296
|
+
function useMapResize(onResize) {
|
|
3297
|
+
const {
|
|
3298
|
+
painter
|
|
3299
|
+
} = useMapContext();
|
|
3300
|
+
const handleMapResize = React.useCallback(() => {
|
|
3301
|
+
onResize && onResize([painter.width, painter.height]); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3302
|
+
}, [onResize, painter]);
|
|
3303
|
+
React.useEffect(() => {
|
|
3304
|
+
painter.on(DomPainter.MapResize.type, handleMapResize);
|
|
3305
|
+
return () => {
|
|
3306
|
+
painter.off(DomPainter.MapResize.type, handleMapResize);
|
|
3307
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3308
|
+
}, [handleMapResize]);
|
|
3309
|
+
}
|
|
3310
|
+
|
|
3296
3311
|
const useMapPick = () => {
|
|
3297
3312
|
const {
|
|
3298
3313
|
map,
|
|
@@ -5514,6 +5529,7 @@ exports.useMapContext = useMapContext;
|
|
|
5514
5529
|
exports.useMapLegend = useMapLegend;
|
|
5515
5530
|
exports.useMapLevel = useMapLevel;
|
|
5516
5531
|
exports.useMapPick = useMapPick;
|
|
5532
|
+
exports.useMapResize = useMapResize;
|
|
5517
5533
|
exports.useMapState = useMapState;
|
|
5518
5534
|
exports.useMapView = useMapView;
|
|
5519
5535
|
exports.useMapViewActions = useMapViewActions;
|