@m4l/gclick 0.3.7 → 0.3.8
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/components/ReportsViewer/subcomponents/ReportSheetMapFitBounds/ReportSheetMapFitBounds.d.ts +3 -2
- package/components/ReportsViewer/subcomponents/ReportSheetMapFitBounds/ReportSheetMapFitBounds.d.ts.map +1 -1
- package/components/ReportsViewer/subcomponents/ReportSheetMapFitBounds/ReportSheetMapFitBounds.js +16 -20
- package/components/index.d.ts +1 -0
- package/components/index.d.ts.map +1 -1
- package/components/maps/components/GpsMap/constants.d.ts +1 -0
- package/components/maps/components/GpsMap/constants.d.ts.map +1 -1
- package/components/maps/components/GpsMap/constants.js +16 -14
- package/components/maps/components/GpsMap/contexts/MapContext/MapContext.d.ts +2 -1
- package/components/maps/components/GpsMap/contexts/MapContext/MapContext.d.ts.map +1 -1
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/featureObservability.d.ts +28 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/featureObservability.d.ts.map +1 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/featureObservability.js +111 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/geoJsonBounds.d.ts +9 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/geoJsonBounds.d.ts.map +1 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/geoJsonBounds.js +183 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/helpers.d.ts +112 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/helpers.d.ts.map +1 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/helpers.js +87 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/layerDataBounds.d.ts +10 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/layerDataBounds.d.ts.map +1 -0
- package/components/maps/components/GpsMap/contexts/MapContext/helpers/layerDataBounds.js +12 -0
- package/components/maps/components/GpsMap/contexts/MapContext/index.d.ts +2 -1
- package/components/maps/components/GpsMap/contexts/MapContext/index.d.ts.map +1 -1
- package/components/maps/components/GpsMap/contexts/MapContext/store.d.ts +6 -2
- package/components/maps/components/GpsMap/contexts/MapContext/store.d.ts.map +1 -1
- package/components/maps/components/GpsMap/contexts/MapContext/store.js +301 -123
- package/components/maps/components/GpsMap/contexts/MapContext/types.d.ts +191 -20
- package/components/maps/components/GpsMap/contexts/MapContext/types.d.ts.map +1 -1
- package/components/maps/components/GpsMap/contexts/MapContext/types.js +8 -0
- package/components/maps/components/GpsMap/featureRenders/CommonFeatureRender/index.d.ts.map +1 -1
- package/components/maps/components/GpsMap/featureRenders/CommonFeatureRender/index.js +93 -124
- package/components/maps/components/GpsMap/hooks/index.d.ts +3 -0
- package/components/maps/components/GpsMap/hooks/index.d.ts.map +1 -1
- package/components/maps/components/GpsMap/hooks/useAutoFocus/helpers.d.ts +12 -0
- package/components/maps/components/GpsMap/hooks/useAutoFocus/helpers.d.ts.map +1 -0
- package/components/maps/components/GpsMap/hooks/useAutoFocus/helpers.js +29 -0
- package/components/maps/components/GpsMap/hooks/useAutoFocus/index.d.ts +1 -4
- package/components/maps/components/GpsMap/hooks/useAutoFocus/index.d.ts.map +1 -1
- package/components/maps/components/GpsMap/hooks/useAutoFocus/index.js +32 -59
- package/components/maps/components/GpsMap/hooks/useAutoFocus/types.d.ts +4 -13
- package/components/maps/components/GpsMap/hooks/useAutoFocus/types.d.ts.map +1 -1
- package/components/maps/components/GpsMap/hooks/useMapInteractionCapture.d.ts +7 -0
- package/components/maps/components/GpsMap/hooks/useMapInteractionCapture.d.ts.map +1 -0
- package/components/maps/components/GpsMap/hooks/useMapInteractionCapture.js +42 -0
- package/components/maps/components/GpsMap/hooks/useMapInteractionCapture.types.d.ts +19 -0
- package/components/maps/components/GpsMap/hooks/useMapInteractionCapture.types.d.ts.map +1 -0
- package/components/maps/components/GpsMap/hooks/useObservableFeatureEventHandlers.d.ts +12 -0
- package/components/maps/components/GpsMap/hooks/useObservableFeatureEventHandlers.d.ts.map +1 -0
- package/components/maps/components/GpsMap/hooks/useObservableFeatureEventHandlers.js +43 -0
- package/components/maps/components/GpsMap/index.d.ts +1 -0
- package/components/maps/components/GpsMap/index.d.ts.map +1 -1
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/constants.d.ts +5 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/constants.d.ts.map +1 -1
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/constants.js +20 -13
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/hooks/useMeasure/index.d.ts +4 -3
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/hooks/useMeasure/index.d.ts.map +1 -1
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/hooks/useMeasure/index.js +175 -120
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/hooks/useMeasure/types.d.ts +6 -0
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/hooks/useMeasure/types.d.ts.map +1 -1
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/subcomponents/MyActions/MyActions.d.ts.map +1 -1
- package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/subcomponents/MyActions/MyActions.js +26 -12
- package/components/maps/components/GpsMap/subcomponents/LayersContainer/subcomponents/Layer/Layer.js +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/constants.d.ts +6 -0
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/constants.d.ts.map +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/constants.js +38 -26
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useDatagridFiltered.js +26 -26
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useFilterAndSort/useFilterAndSort.js +27 -27
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useMaster.js +4 -4
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useModuleDynamicActions.d.ts +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useModuleDynamicActions.d.ts.map +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useModuleDynamicActions.js +34 -28
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useRowActionsGetter.d.ts.map +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useRowActionsGetter.js +41 -36
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/hooks/useTabFiltered.js +17 -17
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/Form.d.ts.map +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/Form.js +16 -18
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/hooks/useDrawing.d.ts +3 -2
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/hooks/useDrawing.d.ts.map +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/hooks/useDrawing.js +136 -92
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/GeneralData.d.ts.map +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/GeneralData.js +29 -23
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceFeatureRender/GeofenceFeatureRender.d.ts +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceFeatureRender/GeofenceFeatureRender.d.ts.map +1 -1
- package/components/maps/components/GpsMapTools/subcomponents/GeofencesTool/subcomponents/GeofenceFeatureRender/GeofenceFeatureRender.js +60 -95
- package/components/maps/index.d.ts +1 -0
- package/components/maps/index.d.ts.map +1 -1
- package/index.js +143 -136
- package/package.json +3 -4
package/components/ReportsViewer/subcomponents/ReportSheetMapFitBounds/ReportSheetMapFitBounds.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ export interface ReportSheetMapFitBoundsProps {
|
|
|
3
3
|
}
|
|
4
4
|
/**
|
|
5
5
|
* Fits the sheet map view to include all current map features (points, lines, polygons).
|
|
6
|
-
* Must be rendered inside the sheet's
|
|
7
|
-
* When
|
|
6
|
+
* Must be rendered inside the sheet's `MapProvider` so the shared host viewport actions are available.
|
|
7
|
+
* When map features change, routes the fit-bounds request through `MapContext` so the sheet map uses
|
|
8
|
+
* the same host-owned viewport mechanics as other sibling consumers.
|
|
8
9
|
*/
|
|
9
10
|
export declare function ReportSheetMapFitBounds({ sheetIndex }: ReportSheetMapFitBoundsProps): null;
|
|
10
11
|
//# sourceMappingURL=ReportSheetMapFitBounds.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportSheetMapFitBounds.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/ReportsViewer/subcomponents/ReportSheetMapFitBounds/ReportSheetMapFitBounds.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReportSheetMapFitBounds.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/ReportsViewer/subcomponents/ReportSheetMapFitBounds/ReportSheetMapFitBounds.tsx"],"names":[],"mappings":"AAQA,MAAM,WAAW,4BAA4B;IAC3C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,UAAU,EAAE,EAAE,4BAA4B,QAwBnF"}
|
package/components/ReportsViewer/subcomponents/ReportSheetMapFitBounds/ReportSheetMapFitBounds.js
CHANGED
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
import { useEffect as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return a(() => {
|
|
1
|
+
import { useEffect as r } from "react";
|
|
2
|
+
import { useMapStore as a } from "../../../maps/components/GpsMap/hooks/useMapStore/index.js";
|
|
3
|
+
import { useReportSheetMap as m } from "../../hooks/useReportSheetMap/useReportSheetMap.js";
|
|
4
|
+
import { getReportSheetMapBoundsFromFeatures as s } from "../../helpers/getReportSheetMapCenterFromFeatures/getReportSheetMapCenterFromFeatures.js";
|
|
5
|
+
const u = [50, 50];
|
|
6
|
+
function c({ sheetIndex: n }) {
|
|
7
|
+
const { mapFeatures: o } = m(n), e = a((t) => t.mapActions.moveToBounds);
|
|
8
|
+
return r(() => {
|
|
10
9
|
if (o.length === 0)
|
|
11
10
|
return;
|
|
12
|
-
const t =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
[t.maxLat, t.maxLng]
|
|
18
|
-
);
|
|
19
|
-
e.fitBounds(r, {
|
|
11
|
+
const t = s(o);
|
|
12
|
+
t && e({
|
|
13
|
+
southWest: { lat: t.minLat, lng: t.minLng },
|
|
14
|
+
northEast: { lat: t.maxLat, lng: t.maxLng }
|
|
15
|
+
}, {
|
|
20
16
|
animate: !1,
|
|
21
17
|
maxZoom: 22,
|
|
22
|
-
padding:
|
|
18
|
+
padding: u
|
|
23
19
|
});
|
|
24
|
-
}, [
|
|
20
|
+
}, [o, e]), null;
|
|
25
21
|
}
|
|
26
22
|
export {
|
|
27
|
-
|
|
23
|
+
c as ReportSheetMapFitBounds
|
|
28
24
|
};
|
package/components/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './Device';
|
|
|
2
2
|
export * from './DeviceLabel';
|
|
3
3
|
export * from './formatters';
|
|
4
4
|
export * from './maps';
|
|
5
|
+
export { isObservableFeatureEventCaptured } from './maps';
|
|
5
6
|
export * from './indicators';
|
|
6
7
|
export * from './VideoTimeLineSelector';
|
|
7
8
|
export * from './ReportsViewer';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick/src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAe,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick/src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,gCAAgC,EAAE,MAAM,QAAQ,CAAC;AAC1D,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAe,iBAAiB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { RNDDefaultPosition } from '@m4l/components';
|
|
|
2
2
|
export declare const MAP_COMPONENT_TEST_ID = "M4LMap";
|
|
3
3
|
export declare const MAP_COMPONET_KEY_COMPONENT = "M4LMap";
|
|
4
4
|
export declare const EARTH_RADIO = 6378137;
|
|
5
|
+
export declare const EARTH_RADIUS_METERS = 6378137;
|
|
5
6
|
export declare const DN = 500;
|
|
6
7
|
export declare const DE = 500;
|
|
7
8
|
export declare const DLAT: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/maps/components/GpsMap/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,0BAA0B,WAAW,CAAC;AACnD,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,eAAO,MAAM,EAAE,MAAM,CAAC;AACtB,eAAO,MAAM,EAAE,MAAM,CAAC;AACtB,eAAO,MAAM,IAAI,QAAmB,CAAC;AACrC,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,iBAAiB,MAAM,CAAC;AACrC,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C,eAAO,MAAM,uBAAuB,YAAY,CAAC;AACjD,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAC5C,eAAO,MAAM,kBAAkB,aAAa,CAAC;AAC7C,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,eAAO,MAAM,uCAAuC,EAAC,kBAGpD,CAAC;AACF,eAAO,MAAM,sCAAsC,EAAC,kBAGnD,CAAC;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;;;CAG5C,CAAC;AACF,eAAO,MAAM,kCAAkC;;;;;;;;;;CAG9C,CAAC;AAgBF,eAAO,MAAM,gBAAgB,ueAmBtB,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/maps/components/GpsMap/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,0BAA0B,WAAW,CAAC;AACnD,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,eAAO,MAAM,mBAAmB,UAAc,CAAC;AAC/C,eAAO,MAAM,EAAE,MAAM,CAAC;AACtB,eAAO,MAAM,EAAE,MAAM,CAAC;AACtB,eAAO,MAAM,IAAI,QAAmB,CAAC;AACrC,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,iBAAiB,MAAM,CAAC;AACrC,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C,eAAO,MAAM,uBAAuB,YAAY,CAAC;AACjD,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAC5C,eAAO,MAAM,kBAAkB,aAAa,CAAC;AAC7C,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,eAAO,MAAM,uCAAuC,EAAC,kBAGpD,CAAC;AACF,eAAO,MAAM,sCAAsC,EAAC,kBAGnD,CAAC;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;;;CAG5C,CAAC;AACF,eAAO,MAAM,kCAAkC;;;;;;;;;;CAG9C,CAAC;AAgBF,eAAO,MAAM,gBAAgB,ueAmBtB,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const t = "M4LMap", _ =
|
|
1
|
+
const t = "M4LMap", _ = 6378137, e = 6378137, i = 0, n = 1100, O = "#1E96DC", E = "#1E96DC", o = "#FFFFFF", A = 8, L = {
|
|
2
2
|
vertical: { top: 16, height: 430 },
|
|
3
3
|
horizontal: { right: -55, width: 280, magnetize: !0 }
|
|
4
|
-
},
|
|
4
|
+
}, c = {
|
|
5
5
|
vertical: { top: 16, height: 160 },
|
|
6
6
|
horizontal: { right: -55, width: 280, magnetize: !0 }
|
|
7
|
-
},
|
|
7
|
+
}, s = {
|
|
8
8
|
vertical: { top: 16, height: 215 },
|
|
9
9
|
horizontal: { right: -55, width: 280, magnetize: !0 }
|
|
10
|
-
},
|
|
10
|
+
}, F = `<svg viewBox="0 0 640 640" height="32" width="32" xmlns="http://www.w3.org/2000/svg">
|
|
11
11
|
<g>
|
|
12
12
|
<circle
|
|
13
13
|
cx="320"
|
|
@@ -28,15 +28,17 @@ const t = "M4LMap", _ = 0, e = 1100, i = "#1E96DC", n = "#1E96DC", O = "#FFFFFF"
|
|
|
28
28
|
</g>
|
|
29
29
|
</svg>`;
|
|
30
30
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
o as
|
|
31
|
+
_ as EARTH_RADIO,
|
|
32
|
+
e as EARTH_RADIUS_METERS,
|
|
33
|
+
o as LABEL_COLOR_DEFAULT,
|
|
34
|
+
E as LABEL_FILLCOLOR_DEFAULT,
|
|
35
|
+
A as LAT_LON_FIXED_DIGITS,
|
|
34
36
|
t as MAP_COMPONET_KEY_COMPONENT,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
c as MAP_LAYERS_TOOL_POPUP_DEFAULT_POSITION,
|
|
38
|
+
L as MAP_SOURCES_TOOL_POPUP_DEFAULT_POSITION,
|
|
39
|
+
i as MAP_ZINDEX_DEFAULT,
|
|
40
|
+
n as MAP_ZINDEX_OVER_MAP,
|
|
41
|
+
O as MARKER_COLOR_DEFAULT,
|
|
42
|
+
s as MESURE_TOOL_POPUP_DEFAULT_POSITION,
|
|
43
|
+
F as SVG_ICON_DEFAULT
|
|
42
44
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MapProviderProps } from './types';
|
|
2
|
-
|
|
2
|
+
import { MapStore } from './store';
|
|
3
|
+
declare const MapContext: import('react').Context<MapStore | null>;
|
|
3
4
|
/**
|
|
4
5
|
* Provedor del contexto de los mapas
|
|
5
6
|
* Expone el store (MapStore) encargado de gestionar la creación, modificación y borrado de capas.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapContext.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMap/contexts/MapContext/MapContext.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"MapContext.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMap/contexts/MapContext/MapContext.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAkB,MAAM,SAAS,CAAC;AAEnD,QAAA,MAAM,UAAU,0CAAuC,CAAC;AACxD;;;;;GAKG;AACH;;GAEG;AACH,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,oDAsC3C;AACD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC"}
|
package/components/maps/components/GpsMap/contexts/MapContext/helpers/featureObservability.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LeafletEvent } from 'leaflet';
|
|
2
|
+
import { Feature, FeatureId, LayerStore, MapFeatureEventType, MapObservableFeatureEvent, MapObservableFeatureAnchorPurpose, MapObservableFeatureAnchorResult, MapObservableFeaturePickResult } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Returns whether one layer is observable and allows the requested event type.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isObservableFeatureEventEnabled(layer: LayerStore | undefined, eventType: MapFeatureEventType): layer is LayerStore;
|
|
7
|
+
/**
|
|
8
|
+
* Creates one normalized observable-feature event payload from a raw Leaflet event.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createObservableFeatureEvent(eventType: MapFeatureEventType, layerId: string, featureId: FeatureId, event: LeafletEvent): MapObservableFeatureEvent;
|
|
11
|
+
/**
|
|
12
|
+
* Finds one feature by id inside the layer GeoJSON payload.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getFeatureFromLayer(layer: LayerStore, featureId: FeatureId): Feature | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Resolves one deterministic observable-feature anchor using the layer strategy and available geometry metadata.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveObservableFeatureAnchor(layer: LayerStore, feature: Feature, purpose?: MapObservableFeatureAnchorPurpose): MapObservableFeatureAnchorResult | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Resolves one normalized pick result from an observable feature event.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveObservableFeaturePick(layer: LayerStore, feature: Feature, event: MapObservableFeatureEvent, purpose?: MapObservableFeatureAnchorPurpose): MapObservableFeaturePickResult | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Resolves one normalized snap target only when the observable feature is still
|
|
25
|
+
* magnetizable for host consumers.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveObservableFeatureSnapTarget(layer: LayerStore, feature: Feature): MapObservableFeatureAnchorResult | undefined;
|
|
28
|
+
//# sourceMappingURL=featureObservability.d.ts.map
|
package/components/maps/components/GpsMap/contexts/MapContext/helpers/featureObservability.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureObservability.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMap/contexts/MapContext/helpers/featureObservability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,KAAK,EACV,OAAO,EACP,SAAS,EAGT,UAAU,EACV,mBAAmB,EACnB,yBAAyB,EACzB,iCAAiC,EACjC,gCAAgC,EAChC,8BAA8B,EAG/B,MAAM,UAAU,CAAC;AA4IlB;;GAEG;AACH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,UAAU,GAAG,SAAS,EAC7B,SAAS,EAAE,mBAAmB,GAC7B,KAAK,IAAI,UAAU,CAMrB;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,mBAAmB,EAC9B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,YAAY,GAClB,yBAAyB,CAS3B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,GACnB,OAAO,GAAG,SAAS,CAgBrB;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE,iCAA0C,GAClD,gCAAgC,GAAG,SAAS,CAgC9C;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,yBAAyB,EAChC,OAAO,GAAE,iCAA0C,GAClD,8BAA8B,GAAG,SAAS,CAY5C;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,OAAO,GACf,gCAAgC,GAAG,SAAS,CAQ9C"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { computeGeoJsonBounds as b } from "./geoJsonBounds.js";
|
|
2
|
+
function s(e) {
|
|
3
|
+
return typeof e == "number" && Number.isFinite(e);
|
|
4
|
+
}
|
|
5
|
+
function v(e) {
|
|
6
|
+
const t = e.latlng;
|
|
7
|
+
if (t && !(!s(t.lat) || !s(t.lng)))
|
|
8
|
+
return {
|
|
9
|
+
lat: t.lat,
|
|
10
|
+
lng: t.lng
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function a(e) {
|
|
14
|
+
if (!Array.isArray(e) || e.length < 2)
|
|
15
|
+
return;
|
|
16
|
+
const [t, r] = e;
|
|
17
|
+
if (!(!s(t) || !s(r)))
|
|
18
|
+
return { lat: r, lng: t };
|
|
19
|
+
}
|
|
20
|
+
function d(e, t) {
|
|
21
|
+
if (e)
|
|
22
|
+
return a(t === "snap" ? e.snapAnchor : t === "measure" ? e.measureAnchor : e.pickAnchor);
|
|
23
|
+
}
|
|
24
|
+
function g(e) {
|
|
25
|
+
if (e.geometry?.type === "Point")
|
|
26
|
+
return a(e.geometry.coordinates);
|
|
27
|
+
}
|
|
28
|
+
function p(e) {
|
|
29
|
+
const t = b(e.geometry);
|
|
30
|
+
if (t)
|
|
31
|
+
return {
|
|
32
|
+
lat: (t.southWest[0] + t.northEast[0]) / 2,
|
|
33
|
+
lng: (t.southWest[1] + t.northEast[1]) / 2
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function u(e, t, r, n, o) {
|
|
37
|
+
return {
|
|
38
|
+
layerId: e.layerId,
|
|
39
|
+
featureId: t.id,
|
|
40
|
+
anchor: n,
|
|
41
|
+
source: o,
|
|
42
|
+
strategy: r,
|
|
43
|
+
pickable: e.featureObservability?.pickable ?? !0,
|
|
44
|
+
magnetizable: e.featureObservability?.magnetizable ?? !0
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function y(e, t) {
|
|
48
|
+
return {
|
|
49
|
+
...t,
|
|
50
|
+
event: e
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function m(e, t) {
|
|
54
|
+
return e?.featureObservability?.enabled ? e.featureObservability.events?.includes(t) ?? !0 : !1;
|
|
55
|
+
}
|
|
56
|
+
function O(e, t, r, n) {
|
|
57
|
+
return {
|
|
58
|
+
type: e,
|
|
59
|
+
layerId: t,
|
|
60
|
+
featureId: r,
|
|
61
|
+
latlng: v(n),
|
|
62
|
+
sourceTarget: n.sourceTarget,
|
|
63
|
+
originalEvent: n
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function A(e, t) {
|
|
67
|
+
const r = e.geoJsonObject?.object;
|
|
68
|
+
if (r) {
|
|
69
|
+
if (r.type === "Feature")
|
|
70
|
+
return r.id === t ? r : void 0;
|
|
71
|
+
if (r.type === "FeatureCollection")
|
|
72
|
+
return r.features.find((n) => n.id === t);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function f(e, t, r = "pick") {
|
|
76
|
+
if (!e.featureObservability?.enabled)
|
|
77
|
+
return;
|
|
78
|
+
const n = e.featureObservability.anchorStrategy ?? "geometry", o = t.properties, i = d(o, r);
|
|
79
|
+
if (n === "feature_property" && i)
|
|
80
|
+
return u(e, t, n, i, "feature_property");
|
|
81
|
+
if (n !== "bounds_center") {
|
|
82
|
+
const l = g(t);
|
|
83
|
+
if (l)
|
|
84
|
+
return u(e, t, n, l, "point_geometry");
|
|
85
|
+
}
|
|
86
|
+
if (i)
|
|
87
|
+
return u(e, t, n, i, "feature_property");
|
|
88
|
+
const c = p(t);
|
|
89
|
+
if (c)
|
|
90
|
+
return u(e, t, n, c, "geometry_bounds_center");
|
|
91
|
+
}
|
|
92
|
+
function F(e, t, r, n = "pick") {
|
|
93
|
+
if (!m(e, r.type))
|
|
94
|
+
return;
|
|
95
|
+
const o = f(e, t, n);
|
|
96
|
+
if (!(!o || o.pickable === !1))
|
|
97
|
+
return y(r, o);
|
|
98
|
+
}
|
|
99
|
+
function k(e, t) {
|
|
100
|
+
const r = f(e, t, "snap");
|
|
101
|
+
if (!(!r || r.magnetizable === !1))
|
|
102
|
+
return r;
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
O as createObservableFeatureEvent,
|
|
106
|
+
A as getFeatureFromLayer,
|
|
107
|
+
m as isObservableFeatureEventEnabled,
|
|
108
|
+
f as resolveObservableFeatureAnchor,
|
|
109
|
+
F as resolveObservableFeaturePick,
|
|
110
|
+
k as resolveObservableFeatureSnapTarget
|
|
111
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type GeoJsonBounds = {
|
|
2
|
+
southWest: [number, number];
|
|
3
|
+
northEast: [number, number];
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Computes serializable `[lat, lng]` bounds directly from GeoJSON data.
|
|
7
|
+
*/
|
|
8
|
+
export declare function computeGeoJsonBounds(value: unknown): GeoJsonBounds | undefined;
|
|
9
|
+
//# sourceMappingURL=geoJsonBounds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geoJsonBounds.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMap/contexts/MapContext/helpers/geoJsonBounds.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B,CAAC;AAwVF;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,GACb,aAAa,GAAG,SAAS,CA0B3B"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { EARTH_RADIUS_METERS as g } from "../../../constants.js";
|
|
2
|
+
function y(t) {
|
|
3
|
+
return typeof t == "object" && t !== null && "object" in t;
|
|
4
|
+
}
|
|
5
|
+
function b(t) {
|
|
6
|
+
return typeof t == "object" && t !== null && "type" in t && typeof t.type == "string";
|
|
7
|
+
}
|
|
8
|
+
function i(t) {
|
|
9
|
+
return typeof t == "number" && Number.isFinite(t);
|
|
10
|
+
}
|
|
11
|
+
function P(t) {
|
|
12
|
+
return i(t) && t > 0;
|
|
13
|
+
}
|
|
14
|
+
function a(t) {
|
|
15
|
+
return Array.isArray(t) && t.length >= 2 && i(t[0]) && i(t[1]);
|
|
16
|
+
}
|
|
17
|
+
function d(t) {
|
|
18
|
+
const [n, e] = t;
|
|
19
|
+
return {
|
|
20
|
+
south: e,
|
|
21
|
+
west: n,
|
|
22
|
+
north: e,
|
|
23
|
+
east: n
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function p(t, n) {
|
|
27
|
+
const [e, r] = n;
|
|
28
|
+
return {
|
|
29
|
+
south: Math.min(t.south, r),
|
|
30
|
+
west: Math.min(t.west, e),
|
|
31
|
+
north: Math.max(t.north, r),
|
|
32
|
+
east: Math.max(t.east, e)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function l(t, n) {
|
|
36
|
+
return {
|
|
37
|
+
south: Math.min(t.south, n.south),
|
|
38
|
+
west: Math.min(t.west, n.west),
|
|
39
|
+
north: Math.max(t.north, n.north),
|
|
40
|
+
east: Math.max(t.east, n.east)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function u(t) {
|
|
44
|
+
return {
|
|
45
|
+
southWest: [t.south, t.west],
|
|
46
|
+
northEast: [t.north, t.east]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function B(t, n) {
|
|
50
|
+
if (!a(t) || !P(n?.radius))
|
|
51
|
+
return;
|
|
52
|
+
const [e, r] = t, o = n.radius / g * (180 / Math.PI), s = Math.cos(r * Math.PI / 180), f = Math.abs(s) < Number.EPSILON ? 180 : o / Math.abs(s);
|
|
53
|
+
return {
|
|
54
|
+
southWest: [r - o, e - f],
|
|
55
|
+
northEast: [r + o, e + f]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function c(t) {
|
|
59
|
+
if (t) {
|
|
60
|
+
if (t.length === 4) {
|
|
61
|
+
const [n, e, r, o] = t;
|
|
62
|
+
return !i(n) || !i(e) || !i(r) || !i(o) ? void 0 : {
|
|
63
|
+
southWest: [e, n],
|
|
64
|
+
northEast: [o, r]
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
if (t.length === 6) {
|
|
68
|
+
const [n, e, r, o, s] = t;
|
|
69
|
+
return !i(n) || !i(e) || !i(o) || !i(s) ? void 0 : {
|
|
70
|
+
southWest: [e, n],
|
|
71
|
+
northEast: [s, o]
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function m(t, n) {
|
|
77
|
+
if (!Array.isArray(t) || t.length === 0)
|
|
78
|
+
return;
|
|
79
|
+
if (a(t))
|
|
80
|
+
return n ? p(n, t) : d(t);
|
|
81
|
+
let e = n;
|
|
82
|
+
for (const r of t)
|
|
83
|
+
if (e = m(r, e), !e)
|
|
84
|
+
return;
|
|
85
|
+
return e;
|
|
86
|
+
}
|
|
87
|
+
function h(t) {
|
|
88
|
+
const n = c(t.bbox);
|
|
89
|
+
if (n)
|
|
90
|
+
return n;
|
|
91
|
+
switch (t.type) {
|
|
92
|
+
case "Point":
|
|
93
|
+
return a(t.coordinates) ? u(d(t.coordinates)) : void 0;
|
|
94
|
+
case "MultiPoint":
|
|
95
|
+
case "LineString":
|
|
96
|
+
case "MultiLineString":
|
|
97
|
+
case "Polygon":
|
|
98
|
+
case "MultiPolygon": {
|
|
99
|
+
const e = m(t.coordinates);
|
|
100
|
+
return e ? u(e) : void 0;
|
|
101
|
+
}
|
|
102
|
+
case "GeometryCollection": {
|
|
103
|
+
if (t.geometries.length === 0)
|
|
104
|
+
return;
|
|
105
|
+
let e;
|
|
106
|
+
for (const r of t.geometries) {
|
|
107
|
+
const o = h(r);
|
|
108
|
+
if (!o)
|
|
109
|
+
return;
|
|
110
|
+
const s = {
|
|
111
|
+
south: o.southWest[0],
|
|
112
|
+
west: o.southWest[1],
|
|
113
|
+
north: o.northEast[0],
|
|
114
|
+
east: o.northEast[1]
|
|
115
|
+
};
|
|
116
|
+
e = e ? l(e, s) : s;
|
|
117
|
+
}
|
|
118
|
+
return e ? u(e) : void 0;
|
|
119
|
+
}
|
|
120
|
+
default:
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function M(t) {
|
|
125
|
+
const n = c(t.bbox);
|
|
126
|
+
if (n)
|
|
127
|
+
return n;
|
|
128
|
+
if (t.geometry) {
|
|
129
|
+
if (t.geometry.type === "Point") {
|
|
130
|
+
const e = B(
|
|
131
|
+
t.geometry.coordinates,
|
|
132
|
+
t.properties
|
|
133
|
+
);
|
|
134
|
+
if (e)
|
|
135
|
+
return e;
|
|
136
|
+
}
|
|
137
|
+
return h(t.geometry);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function w(t) {
|
|
141
|
+
const n = c(t.bbox);
|
|
142
|
+
if (n)
|
|
143
|
+
return n;
|
|
144
|
+
if (t.features.length === 0)
|
|
145
|
+
return;
|
|
146
|
+
let e;
|
|
147
|
+
for (const r of t.features) {
|
|
148
|
+
const o = M(r);
|
|
149
|
+
if (!o)
|
|
150
|
+
return;
|
|
151
|
+
const s = {
|
|
152
|
+
south: o.southWest[0],
|
|
153
|
+
west: o.southWest[1],
|
|
154
|
+
north: o.northEast[0],
|
|
155
|
+
east: o.northEast[1]
|
|
156
|
+
};
|
|
157
|
+
e = e ? l(e, s) : s;
|
|
158
|
+
}
|
|
159
|
+
return e ? u(e) : void 0;
|
|
160
|
+
}
|
|
161
|
+
function v(t) {
|
|
162
|
+
const n = y(t) ? t.object : t;
|
|
163
|
+
if (b(n))
|
|
164
|
+
switch (n.type) {
|
|
165
|
+
case "Feature":
|
|
166
|
+
return M(n);
|
|
167
|
+
case "FeatureCollection":
|
|
168
|
+
return w(n);
|
|
169
|
+
case "GeometryCollection":
|
|
170
|
+
case "Point":
|
|
171
|
+
case "MultiPoint":
|
|
172
|
+
case "LineString":
|
|
173
|
+
case "MultiLineString":
|
|
174
|
+
case "Polygon":
|
|
175
|
+
case "MultiPolygon":
|
|
176
|
+
return h(n);
|
|
177
|
+
default:
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
export {
|
|
182
|
+
v as computeGeoJsonBounds
|
|
183
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { Map as LeafletMap } from 'leaflet';
|
|
2
|
+
import { DevtoolsOptions } from 'zustand/middleware';
|
|
3
|
+
import { StateCreator } from 'zustand';
|
|
4
|
+
import { InteractionChannel, InteractionOwnerId, InteractionOwnershipState, MapStateWithActions, MoveToBoundsOptions, MoveToPointOptions, SmartMoveToPointOptions, ViewportActionResult, ViewportBounds, ViewportPadding, ViewportPoint } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* Builds the devtools wrapper only when development devtools are enabled.
|
|
7
|
+
*/
|
|
8
|
+
export declare const createDevtools: (immerMiddlewere: StateCreator<MapStateWithActions, [], [["zustand/immer", never]]>, config: DevtoolsOptions) => any;
|
|
9
|
+
/**
|
|
10
|
+
* Returns whether the current channel owner is compatible with the requester.
|
|
11
|
+
*/
|
|
12
|
+
export declare const isInteractionChannelAvailableForOwner: (interactionOwnership: InteractionOwnershipState, channel: InteractionChannel, ownerId?: InteractionOwnerId) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Returns whether all requested channels are simultaneously available.
|
|
15
|
+
*/
|
|
16
|
+
export declare const areInteractionChannelsAvailable: (interactionOwnership: InteractionOwnershipState, channels: InteractionChannel[], ownerId?: InteractionOwnerId) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Releases one owner's channels while preserving unrelated owners.
|
|
19
|
+
*/
|
|
20
|
+
export declare const releaseOwnedInteractionChannels: (interactionOwnership: InteractionOwnershipState, ownerId: InteractionOwnerId, channels: InteractionChannel[]) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a deterministic viewport action result.
|
|
23
|
+
*/
|
|
24
|
+
export declare const createViewportActionResult: (status: ViewportActionResult["status"]) => ViewportActionResult;
|
|
25
|
+
/**
|
|
26
|
+
* Executes one viewport mutation safely so transient Leaflet runtime errors do
|
|
27
|
+
* not break the host flow.
|
|
28
|
+
*/
|
|
29
|
+
export declare const runViewportActionSafely: (action: () => ViewportActionResult | void) => ViewportActionResult;
|
|
30
|
+
/**
|
|
31
|
+
* Validates a serializable viewport point while keeping `0` as a valid value.
|
|
32
|
+
*/
|
|
33
|
+
export declare const isValidViewportPoint: (point: ViewportPoint) => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Validates serializable viewport bounds.
|
|
36
|
+
*/
|
|
37
|
+
export declare const isValidViewportBounds: (bounds: ViewportBounds) => boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Returns whether a viewport action is allowed for the caller.
|
|
40
|
+
*/
|
|
41
|
+
export declare const canRunViewportAction: (interactionOwnership: InteractionOwnershipState, ownerId?: InteractionOwnerId) => boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Returns the current Leaflet map instance only when viewport ownership allows it.
|
|
44
|
+
*/
|
|
45
|
+
export declare const getAllowedViewportMap: (mapRef: LeafletMap | null, interactionOwnership: InteractionOwnershipState, ownerId?: InteractionOwnerId) => {
|
|
46
|
+
map: null;
|
|
47
|
+
result: ViewportActionResult;
|
|
48
|
+
} | {
|
|
49
|
+
map: LeafletMap;
|
|
50
|
+
result: ViewportActionResult;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Invalidates the map size when a viewport action explicitly requests it.
|
|
54
|
+
*/
|
|
55
|
+
export declare const invalidateViewportSizeIfNeeded: (map: LeafletMap, options?: MoveToPointOptions | SmartMoveToPointOptions | MoveToBoundsOptions) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Applies shared default options for explicit point movement.
|
|
58
|
+
*/
|
|
59
|
+
export declare const resolveMoveToPointOptions: (options?: MoveToPointOptions) => {
|
|
60
|
+
animate: boolean;
|
|
61
|
+
duration: number;
|
|
62
|
+
ownerId?: InteractionOwnerId;
|
|
63
|
+
minZoom?: number;
|
|
64
|
+
maxZoom?: number;
|
|
65
|
+
padding?: ViewportPadding;
|
|
66
|
+
invalidateSize?: boolean;
|
|
67
|
+
mode?: "pan" | "fly";
|
|
68
|
+
zoom?: number;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Applies shared default options for smart point movement.
|
|
72
|
+
*/
|
|
73
|
+
export declare const resolveSmartMoveToPointOptions: (options?: SmartMoveToPointOptions) => {
|
|
74
|
+
animate: boolean;
|
|
75
|
+
duration: number;
|
|
76
|
+
minZoom: number;
|
|
77
|
+
zoomThreshold: number;
|
|
78
|
+
ownerId?: InteractionOwnerId;
|
|
79
|
+
maxZoom?: number;
|
|
80
|
+
padding?: ViewportPadding;
|
|
81
|
+
invalidateSize?: boolean;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Applies shared default options for bounds movement.
|
|
85
|
+
*/
|
|
86
|
+
export declare const resolveMoveToBoundsOptions: (options?: MoveToBoundsOptions) => {
|
|
87
|
+
animate: boolean;
|
|
88
|
+
duration: number;
|
|
89
|
+
maxZoom: number;
|
|
90
|
+
padding: ViewportPadding;
|
|
91
|
+
ownerId?: InteractionOwnerId;
|
|
92
|
+
minZoom?: number;
|
|
93
|
+
invalidateSize?: boolean;
|
|
94
|
+
mode?: "fit" | "fly";
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Returns whether two points are close enough to treat as the same viewport target.
|
|
98
|
+
*/
|
|
99
|
+
export declare const areViewportPointsClose: (firstPoint: ViewportPoint, secondPoint: ViewportPoint, tolerance?: number) => boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Returns whether two zoom levels are effectively the same.
|
|
102
|
+
*/
|
|
103
|
+
export declare const areViewportZoomLevelsClose: (firstZoom: number, secondZoom: number, tolerance?: number) => boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Returns whether the map is already positioned at the requested point target.
|
|
106
|
+
*/
|
|
107
|
+
export declare const isPointViewportAlreadyApplied: (map: LeafletMap, point: ViewportPoint, targetZoom?: number) => boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Returns whether the map already matches the requested bounds closely enough.
|
|
110
|
+
*/
|
|
111
|
+
export declare const isBoundsViewportAlreadyApplied: (map: LeafletMap, bounds: ViewportBounds) => boolean;
|
|
112
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../packages/gclick/src/components/maps/components/GpsMap/contexts/MapContext/helpers/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAY,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,aAAa,EACd,MAAM,UAAU,CAAC;AAUlB;;GAEG;AACH,eAAO,MAAM,cAAc,GACzB,iBAAiB,YAAY,CAAC,mBAAmB,EAAE,EAAE,EAAE,CAAC,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC,CAAC,EAClF,QAAQ,eAAe,KACtB,GAMF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qCAAqC,GAChD,sBAAsB,yBAAyB,EAC/C,SAAS,kBAAkB,EAC3B,UAAU,kBAAkB,YAK7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,GAC1C,sBAAsB,yBAAyB,EAC/C,UAAU,kBAAkB,EAAE,EAC9B,UAAU,kBAAkB,YAK7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,GAC1C,sBAAsB,yBAAyB,EAC/C,SAAS,kBAAkB,EAC3B,UAAU,kBAAkB,EAAE,SAO/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACrC,QAAQ,oBAAoB,CAAC,QAAQ,CAAC,KACrC,oBAKF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,QAAQ,MAAM,oBAAoB,GAAG,IAAI,KACxC,oBAQF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,OAAO,aAAa,YASxD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,QAAQ,cAAc,YAO3D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAC/B,sBAAsB,yBAAyB,EAC/C,UAAU,kBAAkB,YAO7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAChC,QAAQ,UAAU,GAAG,IAAI,EACzB,sBAAsB,yBAAyB,EAC/C,UAAU,kBAAkB;;;;;;CAoB7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B,GACzC,KAAK,UAAU,EACf,UAAU,kBAAkB,GAAG,uBAAuB,GAAG,mBAAmB,SAK7E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,GAAI,UAAS,kBAAuB;;;;;;;;;;CAMzE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B,GACzC,UAAS,uBAA4B;;;;;;;;;CAStC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,GAAI,UAAS,mBAAwB;;;;;;;;;CAQ3E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GACjC,YAAY,aAAa,EACzB,aAAa,aAAa,EAC1B,kBAA4C,YAM7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACrC,WAAW,MAAM,EACjB,YAAY,MAAM,EAClB,kBAA2C,YAG5C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B,GACxC,KAAK,UAAU,EACf,OAAO,aAAa,EACpB,aAAa,MAAM,YAiBpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B,GACzC,KAAK,UAAU,EACf,QAAQ,cAAc,YAcvB,CAAC"}
|