@wenle_2523097/agri-map 1.0.1 → 1.0.3
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/README.md +63 -0
- package/dist/components/ConfigProvider/index.d.ts +15 -0
- package/dist/components/ConfigProvider/index.d.ts.map +1 -0
- package/dist/components/DualScaleControl/index.d.ts +10 -0
- package/dist/components/DualScaleControl/index.d.ts.map +1 -0
- package/dist/components/Icons/SelectIcon.d.ts +68 -0
- package/dist/components/Icons/SelectIcon.d.ts.map +1 -0
- package/dist/components/Icons/index.d.ts +43 -0
- package/dist/components/Icons/index.d.ts.map +1 -0
- package/dist/components/Irrigation/index.d.ts +8 -0
- package/dist/components/Irrigation/index.d.ts.map +1 -0
- package/dist/components/Irrigation/toolbar.d.ts +6 -0
- package/dist/components/Irrigation/toolbar.d.ts.map +1 -0
- package/dist/components/Loading/index.d.ts +40 -0
- package/dist/components/Loading/index.d.ts.map +1 -0
- package/dist/components/MapContent/index.d.ts +17 -0
- package/dist/components/MapContent/index.d.ts.map +1 -0
- package/dist/components/MapSizeHandler/index.d.ts +24 -0
- package/dist/components/MapSizeHandler/index.d.ts.map +1 -0
- package/dist/components/Marker/ClusterView.d.ts +29 -0
- package/dist/components/Marker/ClusterView.d.ts.map +1 -0
- package/dist/components/Marker/MapClickHandler.d.ts +25 -0
- package/dist/components/Marker/MapClickHandler.d.ts.map +1 -0
- package/dist/components/Marker/index.d.ts +61 -0
- package/dist/components/Marker/index.d.ts.map +1 -0
- package/dist/components/Marker/parseClusterConfig.d.ts +25 -0
- package/dist/components/Marker/parseClusterConfig.d.ts.map +1 -0
- package/dist/components/Marker/toolbar.d.ts +6 -0
- package/dist/components/Marker/toolbar.d.ts.map +1 -0
- package/dist/components/Marker/useEditHandlers.d.ts +44 -0
- package/dist/components/Marker/useEditHandlers.d.ts.map +1 -0
- package/dist/components/Marker/useIconConfig.d.ts +23 -0
- package/dist/components/Marker/useIconConfig.d.ts.map +1 -0
- package/dist/components/Marker/useMarkerCommands.d.ts +30 -0
- package/dist/components/Marker/useMarkerCommands.d.ts.map +1 -0
- package/dist/components/Measurement/toolbar.d.ts +20 -0
- package/dist/components/Measurement/toolbar.d.ts.map +1 -0
- package/dist/components/MiniMap/index.d.ts +16 -0
- package/dist/components/MiniMap/index.d.ts.map +1 -0
- package/dist/components/Notification/index.d.ts +12 -0
- package/dist/components/Notification/index.d.ts.map +1 -0
- package/dist/components/PlotGroupLayer/index.d.ts +8 -0
- package/dist/components/PlotGroupLayer/index.d.ts.map +1 -0
- package/dist/components/PlotLayer/index.d.ts +7 -0
- package/dist/components/PlotLayer/index.d.ts.map +1 -0
- package/dist/components/PlotLayer/label.d.ts +12 -0
- package/dist/components/PlotLayer/label.d.ts.map +1 -0
- package/dist/components/PlotLayer/leaflet-types.d.ts +59 -0
- package/dist/components/PlotLayer/leaflet-types.d.ts.map +1 -0
- package/dist/components/PlotLayer/parseConfig.d.ts +15 -0
- package/dist/components/PlotLayer/parseConfig.d.ts.map +1 -0
- package/dist/components/PlotLayer/toolbar.d.ts +6 -0
- package/dist/components/PlotLayer/toolbar.d.ts.map +1 -0
- package/dist/components/PlotLayer/types.d.ts +10 -0
- package/dist/components/PlotLayer/types.d.ts.map +1 -0
- package/dist/components/PlotLayer/usePlotCommands.d.ts +33 -0
- package/dist/components/PlotLayer/usePlotCommands.d.ts.map +1 -0
- package/dist/components/PlotLayer/usePlotData.d.ts +32 -0
- package/dist/components/PlotLayer/usePlotData.d.ts.map +1 -0
- package/dist/components/PlotLayer/usePlotEditMode.d.ts +92 -0
- package/dist/components/PlotLayer/usePlotEditMode.d.ts.map +1 -0
- package/dist/components/Road/index.d.ts +8 -0
- package/dist/components/Road/index.d.ts.map +1 -0
- package/dist/components/Road/toolbar.d.ts +6 -0
- package/dist/components/Road/toolbar.d.ts.map +1 -0
- package/dist/components/TianDiTuLayer/index.d.ts +15 -0
- package/dist/components/TianDiTuLayer/index.d.ts.map +1 -0
- package/dist/components/Track/ClusterView.d.ts +20 -0
- package/dist/components/Track/ClusterView.d.ts.map +1 -0
- package/dist/components/Track/TrackView.d.ts +24 -0
- package/dist/components/Track/TrackView.d.ts.map +1 -0
- package/dist/components/Track/commands.d.ts +53 -0
- package/dist/components/Track/commands.d.ts.map +1 -0
- package/dist/components/Track/constants.d.ts +34 -0
- package/dist/components/Track/constants.d.ts.map +1 -0
- package/dist/components/Track/index.d.ts +54 -0
- package/dist/components/Track/index.d.ts.map +1 -0
- package/dist/components/Track/parseConfig.d.ts +40 -0
- package/dist/components/Track/parseConfig.d.ts.map +1 -0
- package/dist/components/Track/types.d.ts +38 -0
- package/dist/components/Track/types.d.ts.map +1 -0
- package/dist/components/Track/useMarkerIcon.d.ts +14 -0
- package/dist/components/Track/useMarkerIcon.d.ts.map +1 -0
- package/dist/components/Track/useTrackCommands.d.ts +56 -0
- package/dist/components/Track/useTrackCommands.d.ts.map +1 -0
- package/dist/components/shared/BaseEditToolbar.d.ts +100 -0
- package/dist/components/shared/BaseEditToolbar.d.ts.map +1 -0
- package/dist/components/shared/ToolbarButton.d.ts +49 -0
- package/dist/components/shared/ToolbarButton.d.ts.map +1 -0
- package/dist/components/shared/index.d.ts +5 -0
- package/dist/components/shared/index.d.ts.map +1 -0
- package/dist/constants/device.d.ts +14 -0
- package/dist/constants/device.d.ts.map +1 -0
- package/dist/constants/index.d.ts +20 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/map.d.ts +13 -0
- package/dist/constants/map.d.ts.map +1 -0
- package/dist/constants/plot.d.ts +33 -0
- package/dist/constants/plot.d.ts.map +1 -0
- package/dist/constants/road.d.ts +12 -0
- package/dist/constants/road.d.ts.map +1 -0
- package/dist/constants/styles.d.ts +57 -0
- package/dist/constants/styles.d.ts.map +1 -0
- package/dist/constants/theme.d.ts +47 -0
- package/dist/constants/theme.d.ts.map +1 -0
- package/dist/constants/unit.d.ts +11 -0
- package/dist/constants/unit.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useEditMode.d.ts +75 -0
- package/dist/hooks/useEditMode.d.ts.map +1 -0
- package/dist/hooks/useLatestRef.d.ts +17 -0
- package/dist/hooks/useLatestRef.d.ts.map +1 -0
- package/dist/hooks/usePolylineEditor.d.ts +65 -0
- package/dist/hooks/usePolylineEditor.d.ts.map +1 -0
- package/dist/hooks/usePolylineRenderer.d.ts +34 -0
- package/dist/hooks/usePolylineRenderer.d.ts.map +1 -0
- package/dist/hooks/useTheme.d.ts +13 -0
- package/dist/hooks/useTheme.d.ts.map +1 -0
- package/dist/index.css +709 -3
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +312 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +2837 -1888
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2838 -1888
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +2838 -1888
- package/dist/index.umd.js.map +1 -1
- package/dist/types/basic.d.ts +57 -0
- package/dist/types/basic.d.ts.map +1 -0
- package/dist/types/components.d.ts +56 -0
- package/dist/types/components.d.ts.map +1 -0
- package/dist/types/config.d.ts +112 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/decorator.d.ts +26 -0
- package/dist/types/decorator.d.ts.map +1 -0
- package/dist/types/icon.d.ts +52 -0
- package/dist/types/icon.d.ts.map +1 -0
- package/dist/types/index.d.ts +20 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/irrigation.d.ts +315 -0
- package/dist/types/irrigation.d.ts.map +1 -0
- package/dist/types/layer.d.ts +40 -0
- package/dist/types/layer.d.ts.map +1 -0
- package/dist/types/loading.d.ts +62 -0
- package/dist/types/loading.d.ts.map +1 -0
- package/dist/types/marker.d.ts +299 -0
- package/dist/types/marker.d.ts.map +1 -0
- package/dist/types/measurement.d.ts +121 -0
- package/dist/types/measurement.d.ts.map +1 -0
- package/dist/types/notification.d.ts +50 -0
- package/dist/types/notification.d.ts.map +1 -0
- package/dist/types/plot.d.ts +479 -0
- package/dist/types/plot.d.ts.map +1 -0
- package/dist/types/road.d.ts +382 -0
- package/dist/types/road.d.ts.map +1 -0
- package/dist/types/toolbar.d.ts +176 -0
- package/dist/types/toolbar.d.ts.map +1 -0
- package/dist/types/track.d.ts +386 -0
- package/dist/types/track.d.ts.map +1 -0
- package/dist/utils/area.d.ts +57 -0
- package/dist/utils/area.d.ts.map +1 -0
- package/dist/utils/clusterIcon.d.ts +16 -0
- package/dist/utils/clusterIcon.d.ts.map +1 -0
- package/dist/utils/createAntPath.d.ts +13 -0
- package/dist/utils/createAntPath.d.ts.map +1 -0
- package/dist/utils/geometry.d.ts +41 -0
- package/dist/utils/geometry.d.ts.map +1 -0
- package/dist/utils/iconCache.d.ts +49 -0
- package/dist/utils/iconCache.d.ts.map +1 -0
- package/dist/utils/iconUtils.d.ts +46 -0
- package/dist/utils/iconUtils.d.ts.map +1 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/leafletIcons.d.ts +40 -0
- package/dist/utils/leafletIcons.d.ts.map +1 -0
- package/dist/utils/mapAnimation.d.ts +14 -0
- package/dist/utils/mapAnimation.d.ts.map +1 -0
- package/dist/utils/markerSvg.d.ts +19 -0
- package/dist/utils/markerSvg.d.ts.map +1 -0
- package/dist/utils/pulseIcon.d.ts +28 -0
- package/dist/utils/pulseIcon.d.ts.map +1 -0
- package/dist/utils/spatialIndex.d.ts +56 -0
- package/dist/utils/spatialIndex.d.ts.map +1 -0
- package/dist/utils/toggleItemState.d.ts +15 -0
- package/dist/utils/toggleItemState.d.ts.map +1 -0
- package/dist/utils/trackSimplify.d.ts +23 -0
- package/dist/utils/trackSimplify.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测量工具栏组件
|
|
3
|
+
* @description 提供地图上的长度和面积测量功能,基于 @geoman-io/leaflet-geoman-free
|
|
4
|
+
* @features
|
|
5
|
+
* - 测长度:绘制折线,实时显示长度
|
|
6
|
+
* - 测面积:绘制多边形,实时显示面积
|
|
7
|
+
* - 支持多种单位:m/km/ft/mi(长度), sqm/sqkm/sqft/acre/hectare(面积)
|
|
8
|
+
* - 可配置位置:topleft/topright/bottomleft/bottomright
|
|
9
|
+
* - 实时显示测量值
|
|
10
|
+
* - 统一工具栏样式,与 BaseEditToolbar 保持一致
|
|
11
|
+
*/
|
|
12
|
+
import '@geoman-io/leaflet-geoman-free';
|
|
13
|
+
import type { MeasurementToolbarProps, LengthUnit, MeasurementAreaUnit, UnitConfig } from '../../types/measurement';
|
|
14
|
+
export declare const LENGTH_UNITS: Record<LengthUnit, UnitConfig>;
|
|
15
|
+
export declare const AREA_UNITS: Record<MeasurementAreaUnit, UnitConfig>;
|
|
16
|
+
/**
|
|
17
|
+
* 测量工具栏组件
|
|
18
|
+
*/
|
|
19
|
+
declare const MeasurementToolbar: ({ visible, position, lengthUnit, areaUnit, precision, style, className, onStartMeasurement, onEndMeasurement, onMeasurementChange, }: Omit<MeasurementToolbarProps, "showMeasurements">) => null;
|
|
20
|
+
export default MeasurementToolbar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/Measurement/toolbar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,gCAAgC,CAAC;AAExC,OAAO,KAAK,EACV,uBAAuB,EAGvB,UAAU,EACV,mBAAmB,EACnB,UAAU,EACX,MAAM,yBAAyB,CAAC;AAGjC,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,CAKvD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,mBAAmB,EAAE,UAAU,CAM9D,CAAC;AAqCF;;GAEG;AACH,QAAA,MAAM,kBAAkB,GAAI,sIAWzB,IAAI,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,KAAG,IAqetD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview MiniMap 小地图组件
|
|
3
|
+
* @description 在主地图上显示轨迹概览和当前视口位置的小地图
|
|
4
|
+
* @module components/MiniMap
|
|
5
|
+
*/
|
|
6
|
+
import type { MiniMapProps } from '../../types';
|
|
7
|
+
export type { MiniMapProps, TileLayerConfig } from '../../types';
|
|
8
|
+
/**
|
|
9
|
+
* 小地图组件
|
|
10
|
+
* @description 在主地图上显示轨迹概览和当前视口位置
|
|
11
|
+
*/
|
|
12
|
+
declare const MiniMap: {
|
|
13
|
+
({ show, width, height, zoomOffset, showTrackOverview, trackData, visibleTrackKeys, className, viewportColor, viewportBorderColor, tileLayer, }: MiniMapProps): null;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
export default MiniMap;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MiniMap/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAa,YAAY,EAA8B,MAAM,aAAa,CAAC;AAGvF,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEjE;;;GAGG;AACH,QAAA,MAAM,OAAO;qJAYV,YAAY,GAAG,IAAI;;CAqTrB,CAAC;AAIF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 通知提醒组件
|
|
3
|
+
* @description 类似 antd Notification 的通知提醒框,显示在地图右下角
|
|
4
|
+
*/
|
|
5
|
+
import type { NotificationInstance, NotificationProps } from '../../types';
|
|
6
|
+
/**
|
|
7
|
+
* 通知容器组件
|
|
8
|
+
* @param onClose - 通知关闭时的回调
|
|
9
|
+
* @param ref - ref 引用,暴露 open/close 方法
|
|
10
|
+
*/
|
|
11
|
+
declare const Notification: import("react").ForwardRefExoticComponent<NotificationProps & import("react").RefAttributes<NotificationInstance>>;
|
|
12
|
+
export default Notification;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Notification/index.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAyC,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAsElH;;;;GAIG;AACH,QAAA,MAAM,YAAY,oHAwFhB,CAAC;AAIH,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PlotGroupLayer 多类型地块分组编排组件
|
|
3
|
+
* @description 将多种类型的地块分组渲染,每种类型对应一个独立的 PlotLayer 实例,
|
|
4
|
+
* 支持跨类型互斥选中、统一分组高亮、合并渲染统计等功能。
|
|
5
|
+
*/
|
|
6
|
+
import type { PlotGroupLayerProps, PlotGroupRef } from '../../types';
|
|
7
|
+
declare const PlotGroupLayer: import("react").ForwardRefExoticComponent<PlotGroupLayerProps & import("react").RefAttributes<PlotGroupRef>>;
|
|
8
|
+
export default PlotGroupLayer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PlotGroupLayer/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAGV,mBAAmB,EACnB,YAAY,EAQb,MAAM,aAAa,CAAC;AAErB,QAAA,MAAM,cAAc,8GAmZlB,CAAC;AAIH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview 高性能地块图层组件
|
|
3
|
+
*/
|
|
4
|
+
import '@geoman-io/leaflet-geoman-free';
|
|
5
|
+
import type { PlotRef, PlotLayerProps } from '../../types';
|
|
6
|
+
declare const PlotLayer: import("react").ForwardRefExoticComponent<PlotLayerProps & import("react").RefAttributes<PlotRef>>;
|
|
7
|
+
export default PlotLayer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PlotLayer/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,gCAAgC,CAAC;AAOxC,OAAO,KAAK,EAGV,OAAO,EACP,cAAc,EACf,MAAM,aAAa,CAAC;AAkBrB,QAAA,MAAM,SAAS,oGAyiBb,CAAC;AAIH,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
import type L from 'leaflet';
|
|
3
|
+
interface PlotLabelProps {
|
|
4
|
+
selectedIds?: (string | number)[];
|
|
5
|
+
labelFields?: string[];
|
|
6
|
+
layerByIdRef: RefObject<Record<string | number, L.Layer>>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* PlotLabel - 为选中地块显示标签的组件
|
|
10
|
+
*/
|
|
11
|
+
declare const PlotLabel: React.FC<PlotLabelProps>;
|
|
12
|
+
export default PlotLabel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../src/components/PlotLayer/label.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAG7B,UAAU,cAAc;IACtB,WAAW,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;CAC3D;AAQD;;GAEG;AACH,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAgGvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { MutableRefObject } from 'react';
|
|
2
|
+
import L from 'leaflet';
|
|
3
|
+
import type { PlotData, Coordinate } from '../../types';
|
|
4
|
+
/** PlotLayer 图层类型扩展 */
|
|
5
|
+
export interface PlotLayer extends L.Path {
|
|
6
|
+
feature?: GeoJSON.Feature;
|
|
7
|
+
plotData?: PlotData;
|
|
8
|
+
_path?: HTMLElement;
|
|
9
|
+
_moveHandlers?: {
|
|
10
|
+
onMouseDown: (e: L.LeafletMouseEvent) => void;
|
|
11
|
+
onMouseMove: (e: L.LeafletMouseEvent) => void;
|
|
12
|
+
onMouseUp: () => void;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface PmLayerOptions {
|
|
16
|
+
allowSelfIntersection?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface PmLayerInstance {
|
|
19
|
+
enable?: (options?: PmLayerOptions) => void;
|
|
20
|
+
disable?: () => void;
|
|
21
|
+
enableLayerDrag?: () => void;
|
|
22
|
+
disableLayerDrag?: () => void;
|
|
23
|
+
_shape?: string;
|
|
24
|
+
_drawing?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface PmMapInstance {
|
|
27
|
+
setLang: (lang: string) => void;
|
|
28
|
+
enableDraw: (shape: string, options?: Record<string, unknown>) => void;
|
|
29
|
+
disableDraw: () => void;
|
|
30
|
+
globalDrawModeEnabled?: () => boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface EditEventHandlers {
|
|
33
|
+
pmEdit?: ((e: L.LeafletEvent) => void) | null;
|
|
34
|
+
pmDragEnd?: (() => void) | null;
|
|
35
|
+
pmDrag?: (() => void) | null;
|
|
36
|
+
}
|
|
37
|
+
export declare function getPmLayer(layer: L.Layer): PmLayerInstance | undefined;
|
|
38
|
+
export declare function getPmMap(map: L.Map): PmMapInstance | undefined;
|
|
39
|
+
export declare function getLeafletId(layer: L.Layer): number;
|
|
40
|
+
/** 安全计算边界框(避免 Math.min/max spread 栈溢出) */
|
|
41
|
+
export declare function computeBoundsFromCoordinates(boundaries: Coordinate[]): [number, number, number, number] | undefined;
|
|
42
|
+
/** 清理 Geoman 编辑状态(解除事件监听 + 禁用图层编辑/拖拽) */
|
|
43
|
+
export declare function cleanupPmEditing(editingLayerRef: {
|
|
44
|
+
current: PlotLayer | null;
|
|
45
|
+
}, cleanupEditEvents: (layer: L.Layer | null) => void): void;
|
|
46
|
+
/** 禁用地图绘制模式 */
|
|
47
|
+
export declare function disableDrawMode(map: L.Map): void;
|
|
48
|
+
export interface BuildPlotGeoJSONOptions {
|
|
49
|
+
layerByIdRef: MutableRefObject<Record<string | number, PlotLayer>>;
|
|
50
|
+
selectedIdsRef: MutableRefObject<(string | number)[]>;
|
|
51
|
+
getFeatureStyleRef: MutableRefObject<(feature: GeoJSON.Feature | undefined, isSelected: boolean) => L.PathOptions>;
|
|
52
|
+
handlePlotClickRef: MutableRefObject<(layer: L.Layer, feature: GeoJSON.Feature) => void>;
|
|
53
|
+
handleContextMenuRef: MutableRefObject<(layer: L.Layer, feature: GeoJSON.Feature, event: L.LeafletMouseEvent) => void>;
|
|
54
|
+
handleHoverRef: MutableRefObject<(layer: L.Layer, feature: GeoJSON.Feature, type: 'mouseover' | 'mouseout') => void>;
|
|
55
|
+
/** 图层创建后的额外处理(如设置 editingLayerRef) */
|
|
56
|
+
onLayerReady?: (feature: GeoJSON.Feature, layer: PlotLayer) => void;
|
|
57
|
+
}
|
|
58
|
+
/** 构建地块 GeoJSON 图层的标准配置(消除主渲染和 rebuildGeoJSONLayer 中的重复) */
|
|
59
|
+
export declare function buildPlotGeoJSONOptions(params: BuildPlotGeoJSONOptions): L.GeoJSONOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leaflet-types.d.ts","sourceRoot":"","sources":["../../../src/components/PlotLayer/leaflet-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAC9C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,CAAC,CAAC;IACnH,kBAAkB,EAAE,gBAAgB,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC;IACzF,oBAAoB,EAAE,gBAAgB,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,iBAAiB,KAAK,IAAI,CAAC,CAAC;IACvH,cAAc,EAAE,gBAAgB,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,KAAK,IAAI,CAAC,CAAC;IACrH,sCAAsC;IACtC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CACrE;AAED,4DAA4D;AAC5D,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,uBAAuB,GAAG,CAAC,CAAC,cAAc,CAmBzF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview PlotLayer 组件配置解析
|
|
3
|
+
* @module components/PlotLayer/parseConfig
|
|
4
|
+
*/
|
|
5
|
+
import type { ParsedVirtualizationConfig } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* 解析 virtualization 配置
|
|
8
|
+
* - undefined / true → 启用虚拟化(默认参数)
|
|
9
|
+
* - false → 关闭虚拟化
|
|
10
|
+
* - object → 自定义参数
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseVirtualizationConfig(virtualization: boolean | {
|
|
13
|
+
minZoom?: number;
|
|
14
|
+
maxZoom?: number;
|
|
15
|
+
} | undefined): ParsedVirtualizationConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseConfig.d.ts","sourceRoot":"","sources":["../../../src/components/PlotLayer/parseConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAE1D;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,OAAO,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,GAC3E,0BAA0B,CAY5B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 地块编辑工具栏组件
|
|
3
|
+
*/
|
|
4
|
+
import type { PlotEditToolbarProps } from '../../types';
|
|
5
|
+
declare const PlotEditToolbar: ({ visible, selectedPlotId, currentMode, enabledButtons, hintMessage, showHint, warningHint, color, size, iconOnly, children, onEdit, onRedraw, onClip, onMove, onCreate, onCancel, onSave, onDelete, }: PlotEditToolbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default PlotEditToolbar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/PlotLayer/toolbar.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAaxD,QAAA,MAAM,eAAe,GAAI,wMAoBtB,oBAAoB,4CAuCtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/PlotLayer/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,gBAAgB;AAChB,MAAM,WAAW,0BAA0B;IACzC,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview PlotLayer 命令式方法 hook
|
|
3
|
+
* @description 将 useImperativeHandle 中的方法逻辑提取为独立 hook
|
|
4
|
+
* @module components/PlotLayer/usePlotCommands
|
|
5
|
+
*/
|
|
6
|
+
import L from 'leaflet';
|
|
7
|
+
import type { PlotData, PlotRef } from '../../types';
|
|
8
|
+
interface UsePlotCommandsOptions {
|
|
9
|
+
map: L.Map;
|
|
10
|
+
selectedPlotId: string | number | null;
|
|
11
|
+
selectedIds: (string | number)[];
|
|
12
|
+
isControlled: boolean;
|
|
13
|
+
virtualMaxZoom: number;
|
|
14
|
+
normalizedDataSourceRef: React.MutableRefObject<PlotData[]>;
|
|
15
|
+
groupIndexRef: React.MutableRefObject<Map<string, (string | number)[]>>;
|
|
16
|
+
highlightedGroupRef: React.MutableRefObject<string | null>;
|
|
17
|
+
normalizePlot: (plot: PlotData) => {
|
|
18
|
+
boundaries: any[];
|
|
19
|
+
bounds: number[];
|
|
20
|
+
} & PlotData;
|
|
21
|
+
updateLayerSelectionStyles: () => void;
|
|
22
|
+
rebuildGeoJSONLayer: () => void;
|
|
23
|
+
onSelectRef: React.MutableRefObject<((selectedIds: (string | number)[], plotId?: string | number) => void) | undefined>;
|
|
24
|
+
setInternalSelectedIds: React.Dispatch<React.SetStateAction<(string | number)[]>>;
|
|
25
|
+
startEdit: (editType: 'redraw' | 'clip' | 'move', plotId?: string | number) => boolean;
|
|
26
|
+
startCreate: () => void;
|
|
27
|
+
clearTempLayer: () => void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* PlotLayer 命令式方法 hook
|
|
31
|
+
*/
|
|
32
|
+
export declare function usePlotCommands(ref: React.Ref<PlotRef>, options: UsePlotCommandsOptions): void;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePlotCommands.d.ts","sourceRoot":"","sources":["../../../src/components/PlotLayer/usePlotCommands.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,CAAC,MAAM,S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MAAM,KAAK,OAAO,CAAC;IACvF,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EACvB,OAAO,EAAE,sBAAsB,GAC9B,IAAI,CAmHN"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview PlotLayer 数据处理 hook
|
|
3
|
+
* @description 负责数据标准化、GeoJSON 转换、分组索引构建
|
|
4
|
+
* @module components/PlotLayer/usePlotData
|
|
5
|
+
*/
|
|
6
|
+
import type { PlotData, PlotFieldNames, Coordinate } from '../../types';
|
|
7
|
+
interface UsePlotDataOptions {
|
|
8
|
+
fieldNames?: Partial<PlotFieldNames>;
|
|
9
|
+
dataSource: PlotData[] | undefined;
|
|
10
|
+
groupKey?: string;
|
|
11
|
+
}
|
|
12
|
+
interface UsePlotDataResult {
|
|
13
|
+
/** 合并后的字段名配置 */
|
|
14
|
+
mergedFieldNames: Required<PlotFieldNames>;
|
|
15
|
+
/** 标准化后的数据源 */
|
|
16
|
+
normalizedDataSource: PlotData[];
|
|
17
|
+
/** 标准化地块数据:统一 boundaries 为二维数组 */
|
|
18
|
+
normalizePlot: (plot: PlotData) => PlotData & {
|
|
19
|
+
boundaries: Coordinate[];
|
|
20
|
+
bounds: number[];
|
|
21
|
+
};
|
|
22
|
+
/** 从原始数据中推导孔洞坐标 */
|
|
23
|
+
getHoles: (plot: PlotData) => Coordinate[][];
|
|
24
|
+
/** 将 PlotData[] 转换为 GeoJSON FeatureCollection */
|
|
25
|
+
convertToGeoJSON: (plotData: PlotData[]) => GeoJSON.FeatureCollection;
|
|
26
|
+
/** 分组索引 ref(fieldValue → id[]) */
|
|
27
|
+
groupIndexRef: React.MutableRefObject<Map<string, (string | number)[]>>;
|
|
28
|
+
/** 当前高亮分组 ref */
|
|
29
|
+
highlightedGroupRef: React.MutableRefObject<string | null>;
|
|
30
|
+
}
|
|
31
|
+
export declare function usePlotData({ fieldNames, dataSource, groupKey }: UsePlotDataOptions): UsePlotDataResult;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePlotData.d.ts","sourceRoot":"","sources":["../../../src/components/PlotLayer/usePlotData.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIxE,UAAU,kBAAkB;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACrC,UAAU,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,iBAAiB;IACzB,gBAAgB;IAChB,gBAAgB,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IAC3C,eAAe;IACf,oBAAoB,EAAE,QAAQ,EAAE,CAAC;IACjC,kCAAkC;IAClC,aAAa,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,QAAQ,GAAG;QAAE,UAAU,EAAE,UAAU,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC7F,mBAAmB;IACnB,QAAQ,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,UAAU,EAAE,EAAE,CAAC;IAC7C,iDAAiD;IACjD,gBAAgB,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,OAAO,CAAC,iBAAiB,CAAC;IACtE,kCAAkC;IAClC,aAAa,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IACxE,iBAAiB;IACjB,mBAAmB,EAAE,KAAK,CAAC,gBAAgB,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC5D;AAED,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,kBAAkB,GAAG,iBAAiB,CAuIvG"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview PlotLayer 编辑模式 hook
|
|
3
|
+
* @description 管理编辑模式的完整状态机:
|
|
4
|
+
* - 绘制事件监听(pm:drawvertex, pm:create, pm:cut)
|
|
5
|
+
* - 编辑模式切换(create, redraw, clip, move)
|
|
6
|
+
* - 保存/取消/删除等操作处理
|
|
7
|
+
* - 剪切碎片选择
|
|
8
|
+
* - 编辑面积标签
|
|
9
|
+
* @module components/PlotLayer/usePlotEditMode
|
|
10
|
+
*/
|
|
11
|
+
import L from 'leaflet';
|
|
12
|
+
import type { PlotData, PlotEditMode, PlotEditResult, PlotClipResult, PlotMoveResult, PlotCreateResult, PlotDeleteResult, Coordinate, AreaUnit } from '../../types';
|
|
13
|
+
import type { PlotLayer as PlotLayerType } from './leaflet-types';
|
|
14
|
+
/** usePlotEditMode 输入参数 */
|
|
15
|
+
export interface UsePlotEditModeOptions {
|
|
16
|
+
map: L.Map;
|
|
17
|
+
selectedPlotId: string | number | null;
|
|
18
|
+
enabledButtons: string[];
|
|
19
|
+
areaUnit: AreaUnit;
|
|
20
|
+
/** 编辑路径样式(绘制图层、剪切图层使用此样式) */
|
|
21
|
+
editPath: L.PathOptions;
|
|
22
|
+
/** 编辑模式 ref(指向 editMode state 的最新值) */
|
|
23
|
+
editModeStateRef: React.MutableRefObject<PlotEditMode>;
|
|
24
|
+
/** 编辑中的图层 ref(与主组件共享) */
|
|
25
|
+
editingLayerRef: React.MutableRefObject<PlotLayerType | null>;
|
|
26
|
+
/** 选中地块 ID ref */
|
|
27
|
+
selectedPlotIdRef: React.MutableRefObject<string | number | null>;
|
|
28
|
+
/** 标准化数据源 ref(用于 handleEdit 查找地块数据) */
|
|
29
|
+
normalizedDataSourceRef: React.MutableRefObject<PlotData[]>;
|
|
30
|
+
/** 图层 ID 映射 ref(用于 idle 清理和 startEdit) */
|
|
31
|
+
layerByIdRef: React.MutableRefObject<Record<string | number, PlotLayerType>>;
|
|
32
|
+
/** 图层重建函数 ref(clearTempLayer 使用) */
|
|
33
|
+
rebuildGeoJSONLayerRef: React.MutableRefObject<(() => void) | null>;
|
|
34
|
+
/** 编辑回调(通过 ref 传入避免闭包过期) */
|
|
35
|
+
onRedrawRef: React.MutableRefObject<((result: PlotEditResult) => void) | undefined>;
|
|
36
|
+
onClipRef: React.MutableRefObject<((result: PlotClipResult) => void) | undefined>;
|
|
37
|
+
onMoveRef: React.MutableRefObject<((result: PlotMoveResult) => void) | undefined>;
|
|
38
|
+
onCreateRef: React.MutableRefObject<((result: PlotCreateResult) => void) | undefined>;
|
|
39
|
+
onSaveRef: React.MutableRefObject<((result: PlotEditResult) => void) | undefined>;
|
|
40
|
+
onDeleteRef: React.MutableRefObject<((result: PlotDeleteResult) => void) | undefined>;
|
|
41
|
+
onEditRef: React.MutableRefObject<((result: {
|
|
42
|
+
plotId: string | number;
|
|
43
|
+
plot: PlotData;
|
|
44
|
+
}) => void) | undefined>;
|
|
45
|
+
}
|
|
46
|
+
/** usePlotEditMode 返回值 */
|
|
47
|
+
export interface UsePlotEditModeResult {
|
|
48
|
+
/** 当前编辑模式 */
|
|
49
|
+
editMode: PlotEditMode;
|
|
50
|
+
/** 设置编辑模式 */
|
|
51
|
+
setEditMode: React.Dispatch<React.SetStateAction<PlotEditMode>>;
|
|
52
|
+
/** 是否处于预览模式(新建绘制完成但未保存) */
|
|
53
|
+
isPreviewMode: boolean;
|
|
54
|
+
/** 剪切提示信息 */
|
|
55
|
+
clipHintMessage: string;
|
|
56
|
+
/** 绘制中的坐标 ref */
|
|
57
|
+
drawingCoordinatesRef: React.MutableRefObject<Coordinate[] | Coordinate[][]>;
|
|
58
|
+
/** 是否保留临时图层 ref */
|
|
59
|
+
preserveTempLayerRef: React.MutableRefObject<boolean>;
|
|
60
|
+
/** 移除编辑面积标签 */
|
|
61
|
+
removeEditAreaMarker: () => void;
|
|
62
|
+
/** 清理编辑事件 */
|
|
63
|
+
cleanupEditEvents: (layer: L.Layer | null) => void;
|
|
64
|
+
/** 清理剪切碎片图层 */
|
|
65
|
+
cleanupFragmentLayers: () => void;
|
|
66
|
+
/** 保存 */
|
|
67
|
+
handleSave: () => void;
|
|
68
|
+
/** 取消 */
|
|
69
|
+
handleCancel: () => void;
|
|
70
|
+
/** 重绘 */
|
|
71
|
+
handleRedraw: () => void;
|
|
72
|
+
/** 剪切 */
|
|
73
|
+
handleClip: () => void;
|
|
74
|
+
/** 移动 */
|
|
75
|
+
handleMove: () => void;
|
|
76
|
+
/** 新建 */
|
|
77
|
+
handleCreate: () => void;
|
|
78
|
+
/** 编辑属性 */
|
|
79
|
+
handleEdit: () => void;
|
|
80
|
+
/** 删除 */
|
|
81
|
+
handleDelete: () => void;
|
|
82
|
+
/** 命令式:进入编辑模式 */
|
|
83
|
+
startEdit: (editType: 'redraw' | 'clip' | 'move', plotId?: string | number) => boolean;
|
|
84
|
+
/** 命令式:进入新建模式 */
|
|
85
|
+
startCreate: () => void;
|
|
86
|
+
/** 命令式:清除临时图层并刷新 */
|
|
87
|
+
clearTempLayer: () => void;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* PlotLayer 编辑模式管理 hook
|
|
91
|
+
*/
|
|
92
|
+
export declare function usePlotEditMode(options: UsePlotEditModeOptions): UsePlotEditModeResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePlotEditMode.d.ts","sourceRoot":"","sources":["../../../src/components/PlotLayer/usePlotEditMode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,CAAC,MAAM,SAAS,CAAC;AAExB,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAA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AAI,KAAK,IAAI,CAAC;IACnD,eAAe;IACf,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,SAAS;IACT,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS;IACT,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS;IACT,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS;IACT,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS;IACT,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS;IACT,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,WAAW;IACX,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS;IACT,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,iBAAiB;IACjB,SAAS,EAAE,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,OAAO,CAAC;IACvF,iBAAiB;IACjB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,oBAAoB;IACpB,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,qBAAqB,CAyjBtF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 田间道路组件
|
|
3
|
+
*/
|
|
4
|
+
import '@geoman-io/leaflet-geoman-free';
|
|
5
|
+
import 'leaflet-ant-path';
|
|
6
|
+
import type { RoadProps, RoadRef } from '../../types';
|
|
7
|
+
declare const Road: import("react").ForwardRefExoticComponent<RoadProps<Record<string, unknown>> & import("react").RefAttributes<RoadRef>>;
|
|
8
|
+
export default Road;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Road/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,gCAAgC,CAAC;AACxC,OAAO,kBAAkB,CAAC;AAkB1B,OAAO,KAAK,EAEV,SAAS,EACT,OAAO,EAOR,MAAM,aAAa,CAAC;AAkBrB,QAAA,MAAM,IAAI,wHAspBR,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 道路编辑工具栏组件
|
|
3
|
+
*/
|
|
4
|
+
import type { RoadEditToolbarProps } from '../../types';
|
|
5
|
+
declare const RoadEditToolbar: ({ visible, selectedRoadId, currentMode, enabledButtons, pointCount, hintMessage, showHint, color, size, iconOnly, children, onEdit, onRedraw, onCreate, onCancel, onSave, onDelete, }: RoadEditToolbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default RoadEditToolbar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/Road/toolbar.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAWxD,QAAA,MAAM,eAAe,GAAI,uLAkBtB,oBAAoB,4CAoCtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 天地图图层组件
|
|
3
|
+
* @description 封装天地图的矢量图层和标注图层,支持多种图层风格和自定义瓦片URL
|
|
4
|
+
*/
|
|
5
|
+
import type { TianDiTuLayerProps } from '../../types';
|
|
6
|
+
export declare const LAYER_TYPES: {
|
|
7
|
+
readonly VECTOR: "vector";
|
|
8
|
+
readonly SATELLITE: "satellite";
|
|
9
|
+
readonly TERRAIN: "terrain";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* 天地图图层组件
|
|
13
|
+
*/
|
|
14
|
+
export declare function TianDiTuLayer({ apiKey, showAnnotation, layerType: layerTypeProp, tileUrl, annotationUrl, overlayUrl, subdomains, maxZoom, minZoom, attribution, theme: themeProp, showLayerSelector, onLayerTypeChange, }: TianDiTuLayerProps): JSX.Element;
|
|
15
|
+
export default TianDiTuLayer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TianDiTuLayer/index.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAa,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAMjE,eAAO,MAAM,WAAW;;;;CAId,CAAC;AA6GX;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,cAAqB,EACrB,SAAS,EAAE,aAAqC,EAChD,OAAO,EACP,aAAa,EACb,UAAU,EACV,UAAqD,EACrD,OAAY,EACZ,OAAW,EACX,WAAkB,EAClB,KAAK,EAAE,SAAS,EAChB,iBAAyB,EACzB,iBAAiB,GAClB,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CA4HlC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview 聚合模式渲染子组件
|
|
3
|
+
* @module components/Track/ClusterView
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import L from 'leaflet';
|
|
7
|
+
import Supercluster from 'supercluster';
|
|
8
|
+
import type { ClusterIconConfig } from '../../types';
|
|
9
|
+
import type { MiniMapProps } from '../../types';
|
|
10
|
+
interface ClusterViewProps {
|
|
11
|
+
clusterResults: Supercluster.ClusterFeature<any>[];
|
|
12
|
+
markerIcon: L.DivIcon;
|
|
13
|
+
showTooltip: boolean;
|
|
14
|
+
clusterIconConfig?: ClusterIconConfig;
|
|
15
|
+
miniMapConfig: MiniMapProps | null;
|
|
16
|
+
onClusterClick: (feature: Supercluster.ClusterFeature<Supercluster.AnyProps>) => void;
|
|
17
|
+
onMarkerClick: (trackKey: string) => void;
|
|
18
|
+
}
|
|
19
|
+
declare const _default: React.NamedExoticComponent<ClusterViewProps>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClusterView.d.ts","sourceRoot":"","sources":["../../../src/components/Track/ClusterView.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,CAAC,MAAM,SAAS,CAAC;AACxB,OAAO,YAAY,MAAM,cAAc,CAAC;AAExC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,UAAU,gBAAgB;IACxB,cAAc,EAAE,YAAY,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;IACnD,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,aAAa,EAAE,YAAY,GAAG,IAAI,CAAC;IACnC,cAAc,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC,cAAc,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IACtF,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;;AA2ED,wBAAuC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview 轨迹模式渲染子组件
|
|
3
|
+
* @module components/Track/TrackView
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import type { MiniMapProps } from '../../types';
|
|
7
|
+
interface TrackViewProps {
|
|
8
|
+
sortedVisibleTracks: any[];
|
|
9
|
+
simplifiedTrackMap: Map<string, Record<string, [number, number][]>> | null;
|
|
10
|
+
hoveredTrack: string | null;
|
|
11
|
+
miniMapConfig: MiniMapProps | null;
|
|
12
|
+
checkIsSelected: (key: string) => boolean;
|
|
13
|
+
isTrackVisible: (key: string) => boolean;
|
|
14
|
+
getStyles: (state: number, isSelected: boolean, isHovered: boolean) => any;
|
|
15
|
+
handleTrackClick: (trackKey: string) => void;
|
|
16
|
+
handleTrackHover: (trackKey: string, isHovered: boolean) => void;
|
|
17
|
+
renderStartEndMarkers: (trackKey: string, points: Array<{
|
|
18
|
+
position: [number, number];
|
|
19
|
+
state: number;
|
|
20
|
+
}>) => React.ReactNode | null;
|
|
21
|
+
polylineRefs: React.MutableRefObject<Map<string, any>>;
|
|
22
|
+
}
|
|
23
|
+
declare const _default: React.NamedExoticComponent<TrackViewProps>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrackView.d.ts","sourceRoot":"","sources":["../../../src/components/Track/TrackView.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,UAAU,cAAc;IACtB,mBAAmB,EAAE,GAAG,EAAE,CAAC;IAC3B,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;IAC3E,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,YAAY,GAAG,IAAI,CAAC;IACnC,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAC1C,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IACzC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,KAAK,GAAG,CAAC;IAC3E,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACjE,qBAAqB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,KAAK,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;IAClI,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;CACxD;;AA2DD,wBAAqC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Track 组件命令式方法(useImperativeHandle)的纯工具逻辑
|
|
3
|
+
* @module components/Track/commands
|
|
4
|
+
*/
|
|
5
|
+
import L from 'leaflet';
|
|
6
|
+
import type { FilterResult } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* 根据 filter 字符串筛选轨迹
|
|
9
|
+
* 支持 imei、date、imei|date 格式
|
|
10
|
+
*/
|
|
11
|
+
export declare function filterTracksByString<T extends {
|
|
12
|
+
key: string;
|
|
13
|
+
imei: string;
|
|
14
|
+
date: string;
|
|
15
|
+
}>(tracks: T[], filter?: string): T[];
|
|
16
|
+
/**
|
|
17
|
+
* 从轨迹列表计算统计信息
|
|
18
|
+
*/
|
|
19
|
+
export declare function computeTrackStats<T extends {
|
|
20
|
+
key: string;
|
|
21
|
+
imei: string;
|
|
22
|
+
date: string;
|
|
23
|
+
allPoints?: any[];
|
|
24
|
+
bounds?: any;
|
|
25
|
+
}>(tracks: T[]): {
|
|
26
|
+
imeis: string[];
|
|
27
|
+
dates: string[];
|
|
28
|
+
totalPoints: number;
|
|
29
|
+
totalTracks: number;
|
|
30
|
+
bounds: [number, number, number, number] | null;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* 从轨迹列表中提取 bounds 并安全构建 latLngBounds
|
|
34
|
+
*/
|
|
35
|
+
export declare function safeLatLngBounds(tracks: Array<{
|
|
36
|
+
bounds?: any;
|
|
37
|
+
}>): L.LatLngBounds | null;
|
|
38
|
+
/**
|
|
39
|
+
* 飞行到指定 bounds(带动画时长计算)
|
|
40
|
+
*/
|
|
41
|
+
export declare function flyToBounds(map: L.Map, bounds: L.LatLngBounds, options?: {
|
|
42
|
+
padding?: [number, number];
|
|
43
|
+
}): void;
|
|
44
|
+
/**
|
|
45
|
+
* 构建 filter 方法的返回结果
|
|
46
|
+
*/
|
|
47
|
+
export declare function buildFilterResult<T extends {
|
|
48
|
+
key: string;
|
|
49
|
+
imei: string;
|
|
50
|
+
date: string;
|
|
51
|
+
allPoints?: any[];
|
|
52
|
+
bounds?: any;
|
|
53
|
+
}>(filteredTracks: T[]): FilterResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/components/Track/commands.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,CAA4B,MAAM,SAAS,CAAC;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACxF,MAAM,EAAE,CAAC,EAAE,EACX,MAAM,CAAC,EAAE,MAAM,GACd,CAAC,EAAE,CAQL;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,GAAG,CAAA;CAAE,EACtH,MAAM,EAAE,CAAC,EAAE,GACV;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAA;CAAE,CAkCjI;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,KAAK,CAAC;IAAE,MAAM,CAAC,EAAE,GAAG,CAAA;CAAE,CAAC,GAC9B,CAAC,CAAC,YAAY,GAAG,IAAI,CAevB;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,CAAC,CAAC,GAAG,EACV,MAAM,EAAE,CAAC,CAAC,YAAY,EACtB,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GACvC,IAAI,CAYN;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,GAAG,CAAA;CAAE,EACtH,cAAc,EAAE,CAAC,EAAE,GAClB,YAAY,CAiBd"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Track 组件内部常量和工具函数
|
|
3
|
+
* @module components/Track/constants
|
|
4
|
+
*/
|
|
5
|
+
import type { BBox } from '../../utils/spatialIndex';
|
|
6
|
+
import type { TrackMeta } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* 默认的轨迹样式配置
|
|
9
|
+
*/
|
|
10
|
+
export declare const DEFAULT_STYLES: {
|
|
11
|
+
working: {
|
|
12
|
+
color: string;
|
|
13
|
+
weight: number;
|
|
14
|
+
opacity: number;
|
|
15
|
+
};
|
|
16
|
+
nonWorking: {
|
|
17
|
+
color: string;
|
|
18
|
+
weight: number;
|
|
19
|
+
opacity: number;
|
|
20
|
+
dashArray: string;
|
|
21
|
+
};
|
|
22
|
+
selected: {
|
|
23
|
+
weight: number;
|
|
24
|
+
opacity: number;
|
|
25
|
+
};
|
|
26
|
+
hover: {
|
|
27
|
+
weight: number;
|
|
28
|
+
opacity: number;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
/** 从 [[number, number], [number, number]] 转换为 [minLat, minLng, maxLat, maxLng] */
|
|
32
|
+
export declare function toBBox(bounds: [[number, number], [number, number]]): BBox;
|
|
33
|
+
/** 比较两个 TrackMeta Map 是否相等 */
|
|
34
|
+
export declare function areMapsEqual(a: Map<string, TrackMeta>, b: Map<string, TrackMeta>): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/Track/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;CAoB1B,CAAC;AAEF,kFAAkF;AAClF,wBAAgB,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAEzE;AAED,8BAA8B;AAC9B,wBAAgB,YAAY,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,OAAO,CAO1F"}
|