@mapless/react 0.0.1
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/index.css +622 -0
- package/dist/index.js +4156 -0
- package/dist/types/MapView/index.d.ts +24 -0
- package/dist/types/MapView/index.d.ts.map +1 -0
- package/dist/types/WithMap/WithMapBase.d.ts +33 -0
- package/dist/types/WithMap/WithMapBase.d.ts.map +1 -0
- package/dist/types/WithMap/components/ControlItems/2D3D.d.ts +6 -0
- package/dist/types/WithMap/components/ControlItems/2D3D.d.ts.map +1 -0
- package/dist/types/WithMap/components/ControlItems/DrawTool.d.ts +7 -0
- package/dist/types/WithMap/components/ControlItems/DrawTool.d.ts.map +1 -0
- package/dist/types/WithMap/components/ControlItems/LngLat.d.ts +8 -0
- package/dist/types/WithMap/components/ControlItems/LngLat.d.ts.map +1 -0
- package/dist/types/WithMap/components/ControlItems/MapHand.d.ts +5 -0
- package/dist/types/WithMap/components/ControlItems/MapHand.d.ts.map +1 -0
- package/dist/types/WithMap/components/ControlItems/MapOrigin.d.ts +5 -0
- package/dist/types/WithMap/components/ControlItems/MapOrigin.d.ts.map +1 -0
- package/dist/types/WithMap/components/ControlItems/PositionMkr.d.ts +7 -0
- package/dist/types/WithMap/components/ControlItems/PositionMkr.d.ts.map +1 -0
- package/dist/types/WithMap/components/ControlItems/PositionMus.d.ts +6 -0
- package/dist/types/WithMap/components/ControlItems/PositionMus.d.ts.map +1 -0
- package/dist/types/WithMap/components/ControlItems/SelectTool.d.ts +12 -0
- package/dist/types/WithMap/components/ControlItems/SelectTool.d.ts.map +1 -0
- package/dist/types/WithMap/components/ControlItems/ShowCategory.d.ts +6 -0
- package/dist/types/WithMap/components/ControlItems/ShowCategory.d.ts.map +1 -0
- package/dist/types/WithMap/components/ControlItems/ShowHide.d.ts +8 -0
- package/dist/types/WithMap/components/ControlItems/ShowHide.d.ts.map +1 -0
- package/dist/types/WithMap/components/ControlItems/StyleNames.d.ts +6 -0
- package/dist/types/WithMap/components/ControlItems/StyleNames.d.ts.map +1 -0
- package/dist/types/WithMap/components/ControlItems/StyleSources.d.ts +8 -0
- package/dist/types/WithMap/components/ControlItems/StyleSources.d.ts.map +1 -0
- package/dist/types/WithMap/components/MaplessControlPanel/MaplessControlPanel.d.ts +51 -0
- package/dist/types/WithMap/components/MaplessControlPanel/MaplessControlPanel.d.ts.map +1 -0
- package/dist/types/WithMap/components/MaplessControlPanel/MaplessControlPanelSimple.d.ts +7 -0
- package/dist/types/WithMap/components/MaplessControlPanel/MaplessControlPanelSimple.d.ts.map +1 -0
- package/dist/types/WithMap/components/index.d.ts +19 -0
- package/dist/types/WithMap/components/index.d.ts.map +1 -0
- package/dist/types/WithMap/index.d.ts +9 -0
- package/dist/types/WithMap/index.d.ts.map +1 -0
- package/dist/types/WithMap/utils/StationFuncAdapter.d.ts +3 -0
- package/dist/types/WithMap/utils/StationFuncAdapter.d.ts.map +1 -0
- package/dist/types/WithMap/utils/store.mapState.d.ts +8 -0
- package/dist/types/WithMap/utils/store.mapState.d.ts.map +1 -0
- package/dist/types/WithMap/with/withMapboxMarker.d.ts +30 -0
- package/dist/types/WithMap/with/withMapboxMarker.d.ts.map +1 -0
- package/dist/types/WithMap/with/withMapboxPopup.d.ts +28 -0
- package/dist/types/WithMap/with/withMapboxPopup.d.ts.map +1 -0
- package/dist/types/components/CoordSystemTrans/CoordSystemTrans.d.ts +8 -0
- package/dist/types/components/CoordSystemTrans/CoordSystemTrans.d.ts.map +1 -0
- package/dist/types/components/CoordSystemTrans/demo.d.ts +6 -0
- package/dist/types/components/CoordSystemTrans/demo.d.ts.map +1 -0
- package/dist/types/components/CoordSystemTrans/index.d.ts +4 -0
- package/dist/types/components/CoordSystemTrans/index.d.ts.map +1 -0
- package/dist/types/components/CoordSystemTrans/types.d.ts +45 -0
- package/dist/types/components/CoordSystemTrans/types.d.ts.map +1 -0
- package/dist/types/components/CoordSystemTrans/utils.d.ts +67 -0
- package/dist/types/components/CoordSystemTrans/utils.d.ts.map +1 -0
- package/dist/types/components/CoordinateTrans/CoordinateTrans.d.ts +16 -0
- package/dist/types/components/CoordinateTrans/CoordinateTrans.d.ts.map +1 -0
- package/dist/types/components/CoordinateTrans/components/CoordinateInput/Tips.d.ts +3 -0
- package/dist/types/components/CoordinateTrans/components/CoordinateInput/Tips.d.ts.map +1 -0
- package/dist/types/components/CoordinateTrans/components/CoordinateInput/index.d.ts +5 -0
- package/dist/types/components/CoordinateTrans/components/CoordinateInput/index.d.ts.map +1 -0
- package/dist/types/components/CoordinateTrans/components/CoordinateInput/parseMethods.d.ts +2 -0
- package/dist/types/components/CoordinateTrans/components/CoordinateInput/parseMethods.d.ts.map +1 -0
- package/dist/types/components/CoordinateTrans/components/DDD/index.d.ts +10 -0
- package/dist/types/components/CoordinateTrans/components/DDD/index.d.ts.map +1 -0
- package/dist/types/components/CoordinateTrans/components/DM/index.d.ts +11 -0
- package/dist/types/components/CoordinateTrans/components/DM/index.d.ts.map +1 -0
- package/dist/types/components/CoordinateTrans/components/DMS/index.d.ts +11 -0
- package/dist/types/components/CoordinateTrans/components/DMS/index.d.ts.map +1 -0
- package/dist/types/components/CoordinateTrans/components/FormatChange/index.d.ts +9 -0
- package/dist/types/components/CoordinateTrans/components/FormatChange/index.d.ts.map +1 -0
- package/dist/types/components/CoordinateTrans/components/NWSE/index.d.ts +11 -0
- package/dist/types/components/CoordinateTrans/components/NWSE/index.d.ts.map +1 -0
- package/dist/types/components/CoordinateTrans/components/index.d.ts +37 -0
- package/dist/types/components/CoordinateTrans/components/index.d.ts.map +1 -0
- package/dist/types/components/CoordinateTrans/index.d.ts +7 -0
- package/dist/types/components/CoordinateTrans/index.d.ts.map +1 -0
- package/dist/types/components/CoordinateTrans/weapon.d.ts +35 -0
- package/dist/types/components/CoordinateTrans/weapon.d.ts.map +1 -0
- package/dist/types/components/DraggableMarker/DefaultMarkerChild.d.ts +10 -0
- package/dist/types/components/DraggableMarker/DefaultMarkerChild.d.ts.map +1 -0
- package/dist/types/components/DraggableMarker/DraggableMarker.d.ts +29 -0
- package/dist/types/components/DraggableMarker/DraggableMarker.d.ts.map +1 -0
- package/dist/types/components/DraggableMarker/Group.d.ts +14 -0
- package/dist/types/components/DraggableMarker/Group.d.ts.map +1 -0
- package/dist/types/components/DraggableMarker/index.d.ts +4 -0
- package/dist/types/components/DraggableMarker/index.d.ts.map +1 -0
- package/dist/types/components/DraggableMarker/types.d.ts +11 -0
- package/dist/types/components/DraggableMarker/types.d.ts.map +1 -0
- package/dist/types/components/DraggableMarker/utils.d.ts +6 -0
- package/dist/types/components/DraggableMarker/utils.d.ts.map +1 -0
- package/dist/types/components/ErrorBoundary/ErrorBoundary.d.ts +16 -0
- package/dist/types/components/ErrorBoundary/ErrorBoundary.d.ts.map +1 -0
- package/dist/types/components/ErrorBoundary/index.d.ts +4 -0
- package/dist/types/components/ErrorBoundary/index.d.ts.map +1 -0
- package/dist/types/components/Float/index.d.ts +10 -0
- package/dist/types/components/Float/index.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/2D.d.ts +6 -0
- package/dist/types/components/Icons/generated/2D.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/3D.d.ts +6 -0
- package/dist/types/components/Icons/generated/3D.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/Angle.d.ts +6 -0
- package/dist/types/components/Icons/generated/Angle.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/Area.d.ts +6 -0
- package/dist/types/components/Icons/generated/Area.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/CircleSelect.d.ts +6 -0
- package/dist/types/components/Icons/generated/CircleSelect.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/Copy.d.ts +6 -0
- package/dist/types/components/Icons/generated/Copy.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/Cyber.d.ts +6 -0
- package/dist/types/components/Icons/generated/Cyber.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/FreedomSelect.d.ts +6 -0
- package/dist/types/components/Icons/generated/FreedomSelect.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/GetPosition.d.ts +6 -0
- package/dist/types/components/Icons/generated/GetPosition.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/Hand.d.ts +6 -0
- package/dist/types/components/Icons/generated/Hand.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/Line.d.ts +6 -0
- package/dist/types/components/Icons/generated/Line.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/Marker.d.ts +6 -0
- package/dist/types/components/Icons/generated/Marker.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/Measure.d.ts +6 -0
- package/dist/types/components/Icons/generated/Measure.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/Mode.d.ts +6 -0
- package/dist/types/components/Icons/generated/Mode.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/OriginPosition.d.ts +6 -0
- package/dist/types/components/Icons/generated/OriginPosition.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/Point.d.ts +6 -0
- package/dist/types/components/Icons/generated/Point.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/PointerSelect.d.ts +6 -0
- package/dist/types/components/Icons/generated/PointerSelect.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/Receiver.d.ts +6 -0
- package/dist/types/components/Icons/generated/Receiver.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/RectangleSelect.d.ts +6 -0
- package/dist/types/components/Icons/generated/RectangleSelect.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/Satellite.d.ts +6 -0
- package/dist/types/components/Icons/generated/Satellite.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/SelectTool.d.ts +6 -0
- package/dist/types/components/Icons/generated/SelectTool.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/Streets.d.ts +6 -0
- package/dist/types/components/Icons/generated/Streets.d.ts.map +1 -0
- package/dist/types/components/Icons/generated/index.d.ts +23 -0
- package/dist/types/components/Icons/generated/index.d.ts.map +1 -0
- package/dist/types/components/Icons/index.d.ts +3 -0
- package/dist/types/components/Icons/index.d.ts.map +1 -0
- package/dist/types/components/Icons/types.d.ts +4 -0
- package/dist/types/components/Icons/types.d.ts.map +1 -0
- package/dist/types/components/MapboxMarker/MapboxMarker.d.ts +21 -0
- package/dist/types/components/MapboxMarker/MapboxMarker.d.ts.map +1 -0
- package/dist/types/components/MapboxMarker/index.d.ts +5 -0
- package/dist/types/components/MapboxMarker/index.d.ts.map +1 -0
- package/dist/types/components/MapboxPopup/MapboxPopup.d.ts +15 -0
- package/dist/types/components/MapboxPopup/MapboxPopup.d.ts.map +1 -0
- package/dist/types/components/MapboxPopup/index.d.ts +5 -0
- package/dist/types/components/MapboxPopup/index.d.ts.map +1 -0
- package/dist/types/components/StationMana/index.d.ts +9 -0
- package/dist/types/components/StationMana/index.d.ts.map +1 -0
- package/dist/types/components/StationsClickPanel/StationsClickPanel.d.ts +9 -0
- package/dist/types/components/StationsClickPanel/StationsClickPanel.d.ts.map +1 -0
- package/dist/types/components/StationsClickPanel/StationsClickPanelMarker.d.ts +16 -0
- package/dist/types/components/StationsClickPanel/StationsClickPanelMarker.d.ts.map +1 -0
- package/dist/types/components/StationsClickPanel/index.d.ts +5 -0
- package/dist/types/components/StationsClickPanel/index.d.ts.map +1 -0
- package/dist/types/components/TestPopup/TestPopup.d.ts +8 -0
- package/dist/types/components/TestPopup/TestPopup.d.ts.map +1 -0
- package/dist/types/components/TestPopup/index.d.ts +4 -0
- package/dist/types/components/TestPopup/index.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +12 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/context/MapContext.d.ts +9 -0
- package/dist/types/context/MapContext.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +5 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/hooks/useCoordSystem.d.ts +7 -0
- package/dist/types/hooks/useCoordSystem.d.ts.map +1 -0
- package/dist/types/hooks/useSize.d.ts +12 -0
- package/dist/types/hooks/useSize.d.ts.map +1 -0
- package/dist/types/hooks/useTest.d.ts +3 -0
- package/dist/types/hooks/useTest.d.ts.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +64 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,4156 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import react, { forwardRef, memo, useCallback, useContext, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import "mapbox-gl/dist/mapbox-gl.css";
|
|
4
|
+
import { Draw, Lang, LngLat, Mapless, Marker, PaintBoard, Popup, PositionMarker, PositionMouse, QuickTrans, Singleton, attachMarker, attachOldStation as core_attachOldStation, calculateObjectsInPolygon, darkSource, defaultSource, detachOldStation, getCoordDisplayName, getMarker, getNewStation, getOldStation, getPaintCenter, lightSource, maplessPreset, sourcesMap, throttle, transformCoordinate } from "@mapless/core";
|
|
5
|
+
import { Button, Flex, FloatButton, Input, InputNumber, Popover, Select, Space, Tooltip, Typography, message } from "antd";
|
|
6
|
+
import _ant_design_icons, { ArrowRightOutlined, ClearOutlined, CloseOutlined, DeleteOutlined, EnvironmentOutlined, EyeInvisibleOutlined, EyeOutlined, FlagOutlined, InfoCircleOutlined, MoonOutlined, QuestionCircleOutlined, StopOutlined, SunOutlined } from "@ant-design/icons";
|
|
7
|
+
import { createPortal } from "react-dom";
|
|
8
|
+
const popup_module = {
|
|
9
|
+
"map-popup": "map-popup-_D5VrV",
|
|
10
|
+
mapPopup: "map-popup-_D5VrV"
|
|
11
|
+
};
|
|
12
|
+
const index_module = {
|
|
13
|
+
MapView: "MapView-Xb444g",
|
|
14
|
+
mapView: "MapView-Xb444g",
|
|
15
|
+
map: "map-yhSRxV"
|
|
16
|
+
};
|
|
17
|
+
const MapContext = react.createContext({
|
|
18
|
+
mapless: void 0,
|
|
19
|
+
isMapReady: false
|
|
20
|
+
});
|
|
21
|
+
const useCoordSystem = (mapless)=>{
|
|
22
|
+
const [coordSystem, setCoordSystem] = useState(mapless?.CoordSystem || void 0);
|
|
23
|
+
const [prevCoordSystem, setPrevCoordSystem] = useState(mapless?.CoordSystem || void 0);
|
|
24
|
+
const onCoordSystemChange = useCallback((system, prev)=>{
|
|
25
|
+
setCoordSystem(system);
|
|
26
|
+
setPrevCoordSystem(prev);
|
|
27
|
+
}, []);
|
|
28
|
+
useEffect(()=>{
|
|
29
|
+
mapless?.on('coordSystemChange', onCoordSystemChange);
|
|
30
|
+
return ()=>{
|
|
31
|
+
mapless?.off('coordSystemChange', onCoordSystemChange);
|
|
32
|
+
};
|
|
33
|
+
}, [
|
|
34
|
+
mapless
|
|
35
|
+
]);
|
|
36
|
+
return {
|
|
37
|
+
coordSystem,
|
|
38
|
+
prevCoordSystem
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
const hooks_useCoordSystem = useCoordSystem;
|
|
42
|
+
const useSize = (sizeProps)=>{
|
|
43
|
+
const { resizable, mapviewRef, mapContainer, maplessInstanceRef } = sizeProps;
|
|
44
|
+
useEffect(()=>{
|
|
45
|
+
if (!resizable) return;
|
|
46
|
+
if (!mapviewRef.current || !mapContainer.current || maplessInstanceRef.current) return;
|
|
47
|
+
const resizeObserver = new ResizeObserver(()=>{
|
|
48
|
+
if (mapviewRef.current && mapContainer.current) maplessInstanceRef.current?.resize();
|
|
49
|
+
});
|
|
50
|
+
resizeObserver.observe(mapviewRef.current);
|
|
51
|
+
return ()=>{
|
|
52
|
+
resizeObserver.disconnect();
|
|
53
|
+
};
|
|
54
|
+
}, [
|
|
55
|
+
resizable
|
|
56
|
+
]);
|
|
57
|
+
const resizeOnce = useCallback(()=>{
|
|
58
|
+
setTimeout(()=>maplessInstanceRef.current?.resize, 0);
|
|
59
|
+
}, []);
|
|
60
|
+
return {
|
|
61
|
+
resizeOnce
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
const hooks_useSize = useSize;
|
|
65
|
+
const useTest = ()=>{
|
|
66
|
+
const testRef = useRef(null);
|
|
67
|
+
useEffect(()=>{
|
|
68
|
+
setTimeout(()=>{
|
|
69
|
+
testRef.current = 'test';
|
|
70
|
+
}, 1000);
|
|
71
|
+
}, []);
|
|
72
|
+
};
|
|
73
|
+
const hooks_useTest = useTest;
|
|
74
|
+
const MapView = ({ accessToken, style = 'streets', children = null, center = maplessPreset.DEFAULT_MAP_CENTER, zoom = maplessPreset.DEFAULT_MAP_ZOOM, className = '', onLoad, onChange, resizable = false })=>{
|
|
75
|
+
const mapviewRef = useRef(null);
|
|
76
|
+
const mapContainer = useRef(null);
|
|
77
|
+
const maplessInstanceRef = useRef(void 0);
|
|
78
|
+
const [isMapReady, setIsMapReady] = useState(false);
|
|
79
|
+
hooks_useSize({
|
|
80
|
+
resizable,
|
|
81
|
+
mapviewRef,
|
|
82
|
+
mapContainer,
|
|
83
|
+
maplessInstanceRef
|
|
84
|
+
});
|
|
85
|
+
useEffect(()=>{
|
|
86
|
+
if (!mapContainer.current || maplessInstanceRef.current) return;
|
|
87
|
+
if (!mapContainer.current) return;
|
|
88
|
+
const instance = new Mapless(mapContainer.current, {
|
|
89
|
+
accessToken,
|
|
90
|
+
style,
|
|
91
|
+
center,
|
|
92
|
+
zoom,
|
|
93
|
+
onMapInit () {},
|
|
94
|
+
onMapReady () {
|
|
95
|
+
maplessInstanceRef.current = instance;
|
|
96
|
+
setIsMapReady(true);
|
|
97
|
+
onLoad?.(instance);
|
|
98
|
+
onChange?.({
|
|
99
|
+
type: 'ready',
|
|
100
|
+
target: instance
|
|
101
|
+
});
|
|
102
|
+
},
|
|
103
|
+
onMapZoom (zoom) {
|
|
104
|
+
onChange?.({
|
|
105
|
+
type: 'zoom',
|
|
106
|
+
target: instance,
|
|
107
|
+
others: {
|
|
108
|
+
zoom
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
debug: true
|
|
113
|
+
});
|
|
114
|
+
return ()=>{
|
|
115
|
+
instance.destroy();
|
|
116
|
+
maplessInstanceRef.current = void 0;
|
|
117
|
+
};
|
|
118
|
+
}, [
|
|
119
|
+
accessToken
|
|
120
|
+
]);
|
|
121
|
+
return /*#__PURE__*/ jsx(MapContext.Provider, {
|
|
122
|
+
value: {
|
|
123
|
+
mapless: maplessInstanceRef.current,
|
|
124
|
+
isMapReady
|
|
125
|
+
},
|
|
126
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
127
|
+
ref: mapviewRef,
|
|
128
|
+
className: `${index_module.MapView} ${popup_module["map-popup"]} ${className}`,
|
|
129
|
+
children: [
|
|
130
|
+
/*#__PURE__*/ jsx("div", {
|
|
131
|
+
ref: mapContainer,
|
|
132
|
+
className: `${index_module.map}`
|
|
133
|
+
}),
|
|
134
|
+
children
|
|
135
|
+
]
|
|
136
|
+
})
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
const src_MapView = MapView;
|
|
140
|
+
const DDD = (props)=>{
|
|
141
|
+
const { className, maximum, minimum, value, onChange } = props;
|
|
142
|
+
return /*#__PURE__*/ jsx("div", {
|
|
143
|
+
className: `${className}`,
|
|
144
|
+
children: /*#__PURE__*/ jsx(InputNumber, {
|
|
145
|
+
value: value || null,
|
|
146
|
+
style: {
|
|
147
|
+
width: 264,
|
|
148
|
+
marginRight: 5
|
|
149
|
+
},
|
|
150
|
+
precision: 6,
|
|
151
|
+
max: maximum,
|
|
152
|
+
min: minimum,
|
|
153
|
+
suffix: "\xb0",
|
|
154
|
+
placeholder: "+ DD.DDDDDD",
|
|
155
|
+
onChange: onChange
|
|
156
|
+
})
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
const components_DDD = DDD;
|
|
160
|
+
const Format = {
|
|
161
|
+
DDD: 0x00,
|
|
162
|
+
DMS: 0x01,
|
|
163
|
+
DM: 0x02,
|
|
164
|
+
NWSE: 0x03,
|
|
165
|
+
STAR: 0x04,
|
|
166
|
+
MAX: 0x05
|
|
167
|
+
};
|
|
168
|
+
const getNextFormat = (form)=>{
|
|
169
|
+
let next = form + 1;
|
|
170
|
+
if (next === Format.MAX) next = Format.DDD;
|
|
171
|
+
return next;
|
|
172
|
+
};
|
|
173
|
+
const getFormatStr = (form)=>{
|
|
174
|
+
const strs = [
|
|
175
|
+
'DDD',
|
|
176
|
+
'DMS',
|
|
177
|
+
'DM',
|
|
178
|
+
'NWSE',
|
|
179
|
+
'* *'
|
|
180
|
+
];
|
|
181
|
+
return strs[form];
|
|
182
|
+
};
|
|
183
|
+
const getDDMMSS = (val)=>{
|
|
184
|
+
if (null !== val) {
|
|
185
|
+
const trueVal = Number(val < 0 ? -val : val);
|
|
186
|
+
const degree = parseInt(trueVal.toString(), 10);
|
|
187
|
+
const minute = parseInt((60 * trueVal - 60 * degree).toString(), 10);
|
|
188
|
+
const second = (3600 * trueVal - 3600 * degree - 60 * minute).toFixed(2);
|
|
189
|
+
return {
|
|
190
|
+
degree,
|
|
191
|
+
minute,
|
|
192
|
+
second: Number(second)
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
return {};
|
|
196
|
+
};
|
|
197
|
+
const getDDMM = (val)=>{
|
|
198
|
+
if (null !== val) {
|
|
199
|
+
const trueVal = Number(val < 0 ? -val : val);
|
|
200
|
+
const degree = parseInt(trueVal.toString(), 10);
|
|
201
|
+
const minute = (60 * trueVal - 60 * degree).toFixed(5);
|
|
202
|
+
return {
|
|
203
|
+
degree,
|
|
204
|
+
minute: Number(minute)
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
return {};
|
|
208
|
+
};
|
|
209
|
+
const getFloat = (dms, neg)=>{
|
|
210
|
+
const { degree, minute, second } = dms || {};
|
|
211
|
+
if (null === degree || null === minute || void 0 === degree || void 0 === minute) return null;
|
|
212
|
+
if (null === second) return degree + minute / 60;
|
|
213
|
+
let result = 0;
|
|
214
|
+
result = degree + Number(minute) / 60 + (void 0 !== second ? Number(second) / 3600 : 0);
|
|
215
|
+
return Number(neg ? (-result).toFixed(6) : result.toFixed(6));
|
|
216
|
+
};
|
|
217
|
+
const gps2Degree = (gpsStr)=>{
|
|
218
|
+
let str = gpsStr.trim();
|
|
219
|
+
if (!str) return [
|
|
220
|
+
null,
|
|
221
|
+
null
|
|
222
|
+
];
|
|
223
|
+
const dirMatch = str.match(/^\s*([NnEeWwSs])\s*/);
|
|
224
|
+
let dir = null;
|
|
225
|
+
let flag = 1;
|
|
226
|
+
if (dirMatch) {
|
|
227
|
+
dir = dirMatch[1].toUpperCase();
|
|
228
|
+
str = str.slice(dirMatch[0].length).trim();
|
|
229
|
+
if ('W' === dir || 'S' === dir) flag = -1;
|
|
230
|
+
}
|
|
231
|
+
const dmsMatch = str.match(/^(\d+)[°\s]*(\d+)[′'\s]*(\d+(?:\.\d+)?)[″"\s]*$/);
|
|
232
|
+
if (dmsMatch) {
|
|
233
|
+
const degrees = parseInt(dmsMatch[1], 10);
|
|
234
|
+
const minutes = parseInt(dmsMatch[2], 10);
|
|
235
|
+
const seconds = parseFloat(dmsMatch[3]);
|
|
236
|
+
if (!Number.isNaN(degrees) && !Number.isNaN(minutes) && !Number.isNaN(seconds)) {
|
|
237
|
+
const decimalDegrees = degrees + minutes / 60 + seconds / 3600;
|
|
238
|
+
return [
|
|
239
|
+
dir,
|
|
240
|
+
Number((decimalDegrees * flag).toFixed(6))
|
|
241
|
+
];
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
const dmMatch = str.match(/^(\d+)[°\s]*(\d+(?:\.\d+)?)[′'\s]*$/);
|
|
245
|
+
if (dmMatch) {
|
|
246
|
+
const degrees = parseInt(dmMatch[1], 10);
|
|
247
|
+
const minutes = parseFloat(dmMatch[2]);
|
|
248
|
+
if (!Number.isNaN(degrees) && !Number.isNaN(minutes)) {
|
|
249
|
+
const decimalDegrees = degrees + minutes / 60;
|
|
250
|
+
return [
|
|
251
|
+
dir,
|
|
252
|
+
Number((decimalDegrees * flag).toFixed(6))
|
|
253
|
+
];
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
const degreeMatch = str.match(/^(-?\d+(?:\.\d+)?)$/);
|
|
257
|
+
if (degreeMatch) {
|
|
258
|
+
const degrees = parseFloat(degreeMatch[1]);
|
|
259
|
+
if (!Number.isNaN(degrees)) return [
|
|
260
|
+
dir,
|
|
261
|
+
Number((degrees * flag).toFixed(6))
|
|
262
|
+
];
|
|
263
|
+
}
|
|
264
|
+
return [
|
|
265
|
+
null,
|
|
266
|
+
null
|
|
267
|
+
];
|
|
268
|
+
};
|
|
269
|
+
const degree2DMS = (degreeStr, dirStr)=>{
|
|
270
|
+
const degree = parseFloat(degreeStr);
|
|
271
|
+
if (Number.isNaN(degree)) return null;
|
|
272
|
+
const dir = dirStr.toUpperCase();
|
|
273
|
+
const absDegree = Math.abs(degree);
|
|
274
|
+
const deg = Math.floor(absDegree);
|
|
275
|
+
const minFloat = (absDegree - deg) * 60;
|
|
276
|
+
const min = Math.floor(minFloat);
|
|
277
|
+
const sec = ((minFloat - min) * 60).toFixed(2);
|
|
278
|
+
return `${dir} ${deg}°${min}′${sec}″`;
|
|
279
|
+
};
|
|
280
|
+
const degree2DM = (degreeStr, dirStr)=>{
|
|
281
|
+
let str = degreeStr.toLowerCase();
|
|
282
|
+
str = str.replace(/\s+/g, '');
|
|
283
|
+
const dir = dirStr.toUpperCase();
|
|
284
|
+
const strLength = str.length;
|
|
285
|
+
const tempStrArray = [];
|
|
286
|
+
let tempString = '';
|
|
287
|
+
let tempCount = 0;
|
|
288
|
+
let tempPointFlag = 0;
|
|
289
|
+
let gpsDM = null;
|
|
290
|
+
for(let i = 0; i <= strLength; i += 1)if (str[i] >= '0' && str[i] <= '9') tempString += str[i];
|
|
291
|
+
else if ('.' === str[i]) {
|
|
292
|
+
tempStrArray[tempCount] = tempString;
|
|
293
|
+
tempString = '';
|
|
294
|
+
tempCount += 1;
|
|
295
|
+
tempStrArray[tempCount] = '.';
|
|
296
|
+
tempPointFlag = 1;
|
|
297
|
+
tempCount += 1;
|
|
298
|
+
} else if (tempString.length > 0) {
|
|
299
|
+
tempStrArray[tempCount] = tempString;
|
|
300
|
+
tempString = '';
|
|
301
|
+
tempCount += 1;
|
|
302
|
+
}
|
|
303
|
+
if (1 === tempPointFlag) {
|
|
304
|
+
const num1 = tempStrArray[0];
|
|
305
|
+
const num2 = 60 * parseFloat(`0${tempStrArray[1]}${tempStrArray[2]}`);
|
|
306
|
+
gpsDM = `${dir} ${num1}°${num2}′`;
|
|
307
|
+
}
|
|
308
|
+
return gpsDM;
|
|
309
|
+
};
|
|
310
|
+
const DM_index_module = {
|
|
311
|
+
unit: "unit-mzGhpy"
|
|
312
|
+
};
|
|
313
|
+
const DM = (props)=>{
|
|
314
|
+
const { className, maximum, minimum, value, units, onChange } = props;
|
|
315
|
+
const [transData, setTransData] = useState({
|
|
316
|
+
degree: null,
|
|
317
|
+
minute: null
|
|
318
|
+
});
|
|
319
|
+
const [nonDegDisabled, setNonDegDisabled] = useState(false);
|
|
320
|
+
const [negtive, setNegtive] = useState(false);
|
|
321
|
+
const [isEditing, setIsEditing] = useState(false);
|
|
322
|
+
useEffect(()=>{
|
|
323
|
+
if (isEditing || null === value) {
|
|
324
|
+
if (!isEditing && null === value) {
|
|
325
|
+
setNegtive(false);
|
|
326
|
+
setTransData(null);
|
|
327
|
+
}
|
|
328
|
+
} else {
|
|
329
|
+
setNegtive(value < 0);
|
|
330
|
+
setTransData(getDDMM(value));
|
|
331
|
+
}
|
|
332
|
+
}, [
|
|
333
|
+
value,
|
|
334
|
+
isEditing
|
|
335
|
+
]);
|
|
336
|
+
const handleFocus = ()=>{
|
|
337
|
+
setIsEditing(true);
|
|
338
|
+
};
|
|
339
|
+
const handleBlur = ()=>{
|
|
340
|
+
setIsEditing(false);
|
|
341
|
+
if (transData) {
|
|
342
|
+
const fval = getFloat(transData, negtive);
|
|
343
|
+
onChange(fval);
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
const handleUpdateTransData = (val, type)=>{
|
|
347
|
+
const temp = {
|
|
348
|
+
...transData
|
|
349
|
+
};
|
|
350
|
+
try {
|
|
351
|
+
if (Array.isArray(type) && Array.isArray(val)) type.forEach((t, i)=>{
|
|
352
|
+
temp[t] = val?.[i];
|
|
353
|
+
});
|
|
354
|
+
else temp[type] = val;
|
|
355
|
+
setTransData(temp);
|
|
356
|
+
if (!isEditing) {
|
|
357
|
+
const fval = getFloat(temp, negtive);
|
|
358
|
+
onChange(fval);
|
|
359
|
+
}
|
|
360
|
+
} catch (err) {
|
|
361
|
+
window.console.error(err);
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
365
|
+
className: `${DM_index_module.root} ${className}`,
|
|
366
|
+
children: [
|
|
367
|
+
/*#__PURE__*/ jsx(InputNumber, {
|
|
368
|
+
value: transData?.degree || '',
|
|
369
|
+
style: {
|
|
370
|
+
width: 115,
|
|
371
|
+
marginRight: 5
|
|
372
|
+
},
|
|
373
|
+
precision: 0,
|
|
374
|
+
max: maximum,
|
|
375
|
+
min: 0,
|
|
376
|
+
suffix: "\xb0",
|
|
377
|
+
placeholder: "DD",
|
|
378
|
+
onFocus: handleFocus,
|
|
379
|
+
onBlur: handleBlur,
|
|
380
|
+
onChange: (val)=>{
|
|
381
|
+
if (val) if (val >= maximum || val <= minimum) {
|
|
382
|
+
handleUpdateTransData([
|
|
383
|
+
val,
|
|
384
|
+
0,
|
|
385
|
+
0
|
|
386
|
+
], [
|
|
387
|
+
'degree',
|
|
388
|
+
'minute',
|
|
389
|
+
'second'
|
|
390
|
+
]);
|
|
391
|
+
setNonDegDisabled(true);
|
|
392
|
+
} else {
|
|
393
|
+
handleUpdateTransData(val, 'degree');
|
|
394
|
+
setNonDegDisabled(false);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}),
|
|
398
|
+
/*#__PURE__*/ jsx(InputNumber, {
|
|
399
|
+
value: transData?.minute || '',
|
|
400
|
+
style: {
|
|
401
|
+
width: 115,
|
|
402
|
+
marginRight: 5
|
|
403
|
+
},
|
|
404
|
+
precision: 5,
|
|
405
|
+
max: 60,
|
|
406
|
+
min: 0,
|
|
407
|
+
suffix: "′",
|
|
408
|
+
placeholder: "MM",
|
|
409
|
+
disabled: nonDegDisabled,
|
|
410
|
+
onFocus: handleFocus,
|
|
411
|
+
onBlur: handleBlur,
|
|
412
|
+
onChange: (val)=>{
|
|
413
|
+
handleUpdateTransData(val, 'minute');
|
|
414
|
+
}
|
|
415
|
+
}),
|
|
416
|
+
/*#__PURE__*/ jsx("div", {
|
|
417
|
+
className: DM_index_module.unit,
|
|
418
|
+
onClick: ()=>{
|
|
419
|
+
const neg = !negtive;
|
|
420
|
+
setNegtive(neg);
|
|
421
|
+
const val = getFloat(transData, neg);
|
|
422
|
+
onChange(val);
|
|
423
|
+
},
|
|
424
|
+
children: negtive ? units[0] : units[1]
|
|
425
|
+
})
|
|
426
|
+
]
|
|
427
|
+
});
|
|
428
|
+
};
|
|
429
|
+
const components_DM = DM;
|
|
430
|
+
const DMS_index_module = {
|
|
431
|
+
unit: "unit-Un4QdU"
|
|
432
|
+
};
|
|
433
|
+
const DMS = (props)=>{
|
|
434
|
+
const { className, maximum, minimum, value, units, onChange } = props;
|
|
435
|
+
const [transData, setTransData] = useState({
|
|
436
|
+
degree: null,
|
|
437
|
+
minute: null,
|
|
438
|
+
second: null
|
|
439
|
+
});
|
|
440
|
+
const [nonDegDisabled, setNonDegDisabled] = useState(false);
|
|
441
|
+
const [negtive, setNegtive] = useState(false);
|
|
442
|
+
const [isEditing, setIsEditing] = useState(false);
|
|
443
|
+
useEffect(()=>{
|
|
444
|
+
if (isEditing || null === value) {
|
|
445
|
+
if (!isEditing && null === value) {
|
|
446
|
+
setNegtive(false);
|
|
447
|
+
setTransData(null);
|
|
448
|
+
}
|
|
449
|
+
} else {
|
|
450
|
+
setNegtive(value < 0);
|
|
451
|
+
setTransData(getDDMMSS(value));
|
|
452
|
+
}
|
|
453
|
+
}, [
|
|
454
|
+
value,
|
|
455
|
+
isEditing
|
|
456
|
+
]);
|
|
457
|
+
const handleUpdateTransData = (val, type)=>{
|
|
458
|
+
const temp = {
|
|
459
|
+
...transData
|
|
460
|
+
};
|
|
461
|
+
try {
|
|
462
|
+
if (Array.isArray(type) && Array.isArray(val)) type.forEach((t, i)=>{
|
|
463
|
+
temp[t] = val[i];
|
|
464
|
+
});
|
|
465
|
+
else temp[type] = val;
|
|
466
|
+
setTransData(temp);
|
|
467
|
+
if (!isEditing) {
|
|
468
|
+
const fval = getFloat(temp, negtive);
|
|
469
|
+
onChange(fval);
|
|
470
|
+
}
|
|
471
|
+
} catch (err) {
|
|
472
|
+
window.console.error(err);
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
const handleFocus = ()=>{
|
|
476
|
+
setIsEditing(true);
|
|
477
|
+
};
|
|
478
|
+
const handleBlur = ()=>{
|
|
479
|
+
setIsEditing(false);
|
|
480
|
+
if (transData) {
|
|
481
|
+
const fval = getFloat(transData, negtive);
|
|
482
|
+
onChange(fval);
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
486
|
+
className: `${DMS_index_module.root} ${className}`,
|
|
487
|
+
children: [
|
|
488
|
+
/*#__PURE__*/ jsx(InputNumber, {
|
|
489
|
+
value: transData?.degree || '',
|
|
490
|
+
style: {
|
|
491
|
+
width: 75,
|
|
492
|
+
marginRight: 5
|
|
493
|
+
},
|
|
494
|
+
precision: 0,
|
|
495
|
+
max: maximum,
|
|
496
|
+
min: 0,
|
|
497
|
+
suffix: "\xb0",
|
|
498
|
+
placeholder: "DD",
|
|
499
|
+
onFocus: handleFocus,
|
|
500
|
+
onBlur: handleBlur,
|
|
501
|
+
onChange: (val)=>{
|
|
502
|
+
if (val) if (val >= maximum || val <= minimum) {
|
|
503
|
+
handleUpdateTransData([
|
|
504
|
+
val,
|
|
505
|
+
0,
|
|
506
|
+
0
|
|
507
|
+
], [
|
|
508
|
+
'degree',
|
|
509
|
+
'minute',
|
|
510
|
+
'second'
|
|
511
|
+
]);
|
|
512
|
+
setNonDegDisabled(true);
|
|
513
|
+
} else {
|
|
514
|
+
handleUpdateTransData(val, 'degree');
|
|
515
|
+
setNonDegDisabled(false);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}),
|
|
519
|
+
/*#__PURE__*/ jsx(InputNumber, {
|
|
520
|
+
value: transData?.minute || '',
|
|
521
|
+
style: {
|
|
522
|
+
width: 75,
|
|
523
|
+
marginRight: 5
|
|
524
|
+
},
|
|
525
|
+
precision: 0,
|
|
526
|
+
max: 60,
|
|
527
|
+
min: 0,
|
|
528
|
+
suffix: "′",
|
|
529
|
+
placeholder: "MM",
|
|
530
|
+
disabled: nonDegDisabled,
|
|
531
|
+
onFocus: handleFocus,
|
|
532
|
+
onBlur: handleBlur,
|
|
533
|
+
onChange: (val)=>{
|
|
534
|
+
handleUpdateTransData(val, 'minute');
|
|
535
|
+
}
|
|
536
|
+
}),
|
|
537
|
+
/*#__PURE__*/ jsx(InputNumber, {
|
|
538
|
+
value: transData?.second || '',
|
|
539
|
+
style: {
|
|
540
|
+
width: 75,
|
|
541
|
+
marginRight: 5
|
|
542
|
+
},
|
|
543
|
+
precision: 2,
|
|
544
|
+
max: 60,
|
|
545
|
+
min: 0,
|
|
546
|
+
suffix: "″",
|
|
547
|
+
placeholder: "SS",
|
|
548
|
+
disabled: nonDegDisabled,
|
|
549
|
+
onFocus: handleFocus,
|
|
550
|
+
onBlur: handleBlur,
|
|
551
|
+
onChange: (val)=>{
|
|
552
|
+
handleUpdateTransData(val, 'second');
|
|
553
|
+
}
|
|
554
|
+
}),
|
|
555
|
+
/*#__PURE__*/ jsx("div", {
|
|
556
|
+
className: DMS_index_module.unit,
|
|
557
|
+
onClick: ()=>{
|
|
558
|
+
const neg = !negtive;
|
|
559
|
+
setNegtive(neg);
|
|
560
|
+
const val = getFloat(transData, neg);
|
|
561
|
+
onChange(val);
|
|
562
|
+
},
|
|
563
|
+
children: negtive ? units[0] : units[1]
|
|
564
|
+
})
|
|
565
|
+
]
|
|
566
|
+
});
|
|
567
|
+
};
|
|
568
|
+
const components_DMS = DMS;
|
|
569
|
+
const FormatChange_index_module = {
|
|
570
|
+
switch: "switch-bZwK8Q"
|
|
571
|
+
};
|
|
572
|
+
const FormatChange = (props)=>{
|
|
573
|
+
const { type = 'select', showFormat, onFormatChange } = props;
|
|
574
|
+
const getSample = useMemo(()=>{
|
|
575
|
+
if (showFormat === Format.STAR) return `例:113.27 23.13 或 113.27,23.13`;
|
|
576
|
+
if (showFormat === Format.DDD) return `例:120.270000`;
|
|
577
|
+
if (showFormat === Format.DMS) return `例:120 30 30.00 E`;
|
|
578
|
+
if (showFormat === Format.DM) return `例:120 30.2000 E`;
|
|
579
|
+
if (showFormat === Format.NWSE) return `例:E 113°16′12.00″`;
|
|
580
|
+
return `例:120,30`;
|
|
581
|
+
}, [
|
|
582
|
+
showFormat
|
|
583
|
+
]);
|
|
584
|
+
return /*#__PURE__*/ jsxs(Tooltip, {
|
|
585
|
+
title: getSample,
|
|
586
|
+
placement: "top",
|
|
587
|
+
trigger: [
|
|
588
|
+
'hover'
|
|
589
|
+
],
|
|
590
|
+
children: [
|
|
591
|
+
'button' === type && /*#__PURE__*/ jsx("div", {
|
|
592
|
+
className: FormatChange_index_module["switch"],
|
|
593
|
+
onClick: ()=>{
|
|
594
|
+
onFormatChange?.(getNextFormat(showFormat));
|
|
595
|
+
},
|
|
596
|
+
children: getFormatStr(showFormat)
|
|
597
|
+
}),
|
|
598
|
+
'select' === type && /*#__PURE__*/ jsx(Select, {
|
|
599
|
+
size: "small",
|
|
600
|
+
style: {
|
|
601
|
+
width: 120
|
|
602
|
+
},
|
|
603
|
+
popupMatchSelectWidth: false,
|
|
604
|
+
value: showFormat,
|
|
605
|
+
onChange: onFormatChange,
|
|
606
|
+
options: Object.values(Format).filter((format)=>format !== Format.MAX).map((format)=>({
|
|
607
|
+
label: getFormatStr(format),
|
|
608
|
+
value: format
|
|
609
|
+
}))
|
|
610
|
+
})
|
|
611
|
+
]
|
|
612
|
+
});
|
|
613
|
+
};
|
|
614
|
+
const components_FormatChange = FormatChange;
|
|
615
|
+
const handleError = (error)=>{
|
|
616
|
+
console.error('坐标解析错误:', error);
|
|
617
|
+
message.error('坐标格式不正确,请使用格式如: E 103°58′44.56″ 或 N 40°26′21″ 或 W 74°0′0″');
|
|
618
|
+
};
|
|
619
|
+
const NWSE = (props)=>{
|
|
620
|
+
const { className, maximum, minimum, value, units, onChange } = props;
|
|
621
|
+
const [text, setText] = useState('');
|
|
622
|
+
const [isEditing, setIsEditing] = useState(false);
|
|
623
|
+
useEffect(()=>{
|
|
624
|
+
if (!isEditing && null != value && units) {
|
|
625
|
+
const dir = value < 0 ? units[0] : units[1];
|
|
626
|
+
setText(degree2DMS(value.toFixed(6), dir));
|
|
627
|
+
} else if (!isEditing && null == value) setText('');
|
|
628
|
+
}, [
|
|
629
|
+
value,
|
|
630
|
+
isEditing
|
|
631
|
+
]);
|
|
632
|
+
const onTextChange = (e)=>{
|
|
633
|
+
const txt = e.target.value;
|
|
634
|
+
setText(txt);
|
|
635
|
+
if ('' === txt.trim()) return void onChange?.(null);
|
|
636
|
+
};
|
|
637
|
+
const handleBlur = ()=>{
|
|
638
|
+
setIsEditing(false);
|
|
639
|
+
if (text && '' !== text.trim()) try {
|
|
640
|
+
const [dir, val] = gps2Degree(text);
|
|
641
|
+
const idx = units?.indexOf(dir?.toString() || '');
|
|
642
|
+
if (-1 === idx || null === val || Number.isNaN(val)) return void handleError(new Error('无效的坐标格式'));
|
|
643
|
+
let num = (0 === idx ? -1 : 1) * val;
|
|
644
|
+
if (void 0 !== maximum) {
|
|
645
|
+
if (num > maximum) num = maximum;
|
|
646
|
+
}
|
|
647
|
+
if (void 0 !== minimum) {
|
|
648
|
+
if (num < minimum) num = minimum;
|
|
649
|
+
}
|
|
650
|
+
onChange?.(num);
|
|
651
|
+
} catch (error) {
|
|
652
|
+
handleError(error);
|
|
653
|
+
}
|
|
654
|
+
else onChange?.(null);
|
|
655
|
+
};
|
|
656
|
+
const handleFocus = ()=>{
|
|
657
|
+
setIsEditing(true);
|
|
658
|
+
};
|
|
659
|
+
return /*#__PURE__*/ jsx("div", {
|
|
660
|
+
className: `${className}`,
|
|
661
|
+
children: /*#__PURE__*/ jsx(Input, {
|
|
662
|
+
style: {
|
|
663
|
+
width: 264,
|
|
664
|
+
marginRight: 5
|
|
665
|
+
},
|
|
666
|
+
placeholder: "N DD\xb0MM′SS″",
|
|
667
|
+
value: text || '',
|
|
668
|
+
onChange: onTextChange,
|
|
669
|
+
onBlur: handleBlur,
|
|
670
|
+
onFocus: handleFocus
|
|
671
|
+
})
|
|
672
|
+
});
|
|
673
|
+
};
|
|
674
|
+
const components_NWSE = NWSE;
|
|
675
|
+
const components = {
|
|
676
|
+
DDD: components_DDD,
|
|
677
|
+
DMS: components_DMS,
|
|
678
|
+
DM: components_DM,
|
|
679
|
+
NWSE: components_NWSE
|
|
680
|
+
};
|
|
681
|
+
const CoordinateTrans_index_module = {
|
|
682
|
+
root: "root-XBwuFZ",
|
|
683
|
+
container: "container-bZBWZn",
|
|
684
|
+
hide: "hide-BZ1cCE"
|
|
685
|
+
};
|
|
686
|
+
const { DDD: CoordinateTrans_DDD, DMS: CoordinateTrans_DMS, DM: CoordinateTrans_DM, NWSE: CoordinateTrans_NWSE } = components;
|
|
687
|
+
const CoordinateTrans_CoordinateTrans = (props)=>{
|
|
688
|
+
const { maximum, minimum, value, units, onChange, showFormat = Format.DDD, showFormatChangeBtn = false, onFormatChange, children } = props;
|
|
689
|
+
const [dddValue, setValue] = useState(null);
|
|
690
|
+
const onChanged = (val)=>{
|
|
691
|
+
if (val) {
|
|
692
|
+
onChange(Number(val));
|
|
693
|
+
setValue(Number(val));
|
|
694
|
+
} else {
|
|
695
|
+
onChange(val);
|
|
696
|
+
setValue(null);
|
|
697
|
+
}
|
|
698
|
+
};
|
|
699
|
+
useEffect(()=>{
|
|
700
|
+
null !== value ? setValue(Number(value.toFixed(6))) : setValue(null);
|
|
701
|
+
}, [
|
|
702
|
+
value
|
|
703
|
+
]);
|
|
704
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
705
|
+
className: CoordinateTrans_index_module.root,
|
|
706
|
+
children: [
|
|
707
|
+
/*#__PURE__*/ jsx(CoordinateTrans_DDD, {
|
|
708
|
+
className: `${CoordinateTrans_index_module.container} ${showFormat === Format.DDD ? null : CoordinateTrans_index_module.hide}`,
|
|
709
|
+
maximum: maximum,
|
|
710
|
+
minimum: minimum,
|
|
711
|
+
value: dddValue,
|
|
712
|
+
onChange: onChanged
|
|
713
|
+
}),
|
|
714
|
+
/*#__PURE__*/ jsx(CoordinateTrans_DMS, {
|
|
715
|
+
className: `${CoordinateTrans_index_module.container} ${showFormat === Format.DMS ? null : CoordinateTrans_index_module.hide}`,
|
|
716
|
+
maximum: maximum,
|
|
717
|
+
minimum: minimum,
|
|
718
|
+
units: units,
|
|
719
|
+
value: dddValue,
|
|
720
|
+
onChange: onChanged
|
|
721
|
+
}),
|
|
722
|
+
/*#__PURE__*/ jsx(CoordinateTrans_DM, {
|
|
723
|
+
className: `${CoordinateTrans_index_module.container} ${showFormat === Format.DM ? null : CoordinateTrans_index_module.hide}`,
|
|
724
|
+
maximum: maximum,
|
|
725
|
+
minimum: minimum,
|
|
726
|
+
units: units,
|
|
727
|
+
value: dddValue,
|
|
728
|
+
onChange: onChanged
|
|
729
|
+
}),
|
|
730
|
+
/*#__PURE__*/ jsx(CoordinateTrans_NWSE, {
|
|
731
|
+
className: `${CoordinateTrans_index_module.container} ${showFormat === Format.NWSE ? null : CoordinateTrans_index_module.hide}`,
|
|
732
|
+
maximum: maximum,
|
|
733
|
+
minimum: minimum,
|
|
734
|
+
units: units,
|
|
735
|
+
value: dddValue,
|
|
736
|
+
onChange: onChanged
|
|
737
|
+
}),
|
|
738
|
+
showFormatChangeBtn && /*#__PURE__*/ jsx("div", {
|
|
739
|
+
className: CoordinateTrans_index_module["switch"],
|
|
740
|
+
onClick: ()=>{
|
|
741
|
+
onFormatChange?.(getNextFormat(showFormat));
|
|
742
|
+
},
|
|
743
|
+
children: getFormatStr(showFormat)
|
|
744
|
+
}),
|
|
745
|
+
children
|
|
746
|
+
]
|
|
747
|
+
});
|
|
748
|
+
};
|
|
749
|
+
const components_CoordinateTrans_CoordinateTrans = CoordinateTrans_CoordinateTrans;
|
|
750
|
+
const CoordinateInput_index_module = {
|
|
751
|
+
info: "info-FBqJ2N"
|
|
752
|
+
};
|
|
753
|
+
const parseMethods_parseCoordinate = (input)=>{
|
|
754
|
+
const cleaned = input.trim().replace(/\s+/g, ' ');
|
|
755
|
+
const decimalMatch = cleaned.match(/^(-?\d+\.?\d*)[, ]+(-?\d+\.?\d*)$/);
|
|
756
|
+
if (decimalMatch) {
|
|
757
|
+
const lon = parseFloat(decimalMatch[1]);
|
|
758
|
+
const lat = parseFloat(decimalMatch[2]);
|
|
759
|
+
if (!Number.isNaN(lon) && !Number.isNaN(lat)) return [
|
|
760
|
+
lon,
|
|
761
|
+
lat
|
|
762
|
+
];
|
|
763
|
+
}
|
|
764
|
+
const cardinalMatch = cleaned.match(/^([EW])\s*(-?\d+\.?\d*)[, ]([NS])\s*(-?\d+\.?\d*)$/i);
|
|
765
|
+
if (cardinalMatch) {
|
|
766
|
+
const lonSign = 'E' === cardinalMatch[1].toUpperCase() ? 1 : -1;
|
|
767
|
+
const latSign = 'N' === cardinalMatch[3].toUpperCase() ? 1 : -1;
|
|
768
|
+
const lon = parseFloat(cardinalMatch[2]) * lonSign;
|
|
769
|
+
const lat = parseFloat(cardinalMatch[4]) * latSign;
|
|
770
|
+
if (!Number.isNaN(lon) && !Number.isNaN(lat)) return [
|
|
771
|
+
lon,
|
|
772
|
+
lat
|
|
773
|
+
];
|
|
774
|
+
}
|
|
775
|
+
const dmsMatch = cleaned.match(/^(-?\d+)°(\d+)[′'](\d+\.?\d*)["″]?\s*(-?\d+)°(\d+)[′'](\d+\.?\d*)["″]?$/);
|
|
776
|
+
if (dmsMatch) {
|
|
777
|
+
const lonDeg = parseFloat(dmsMatch[1]);
|
|
778
|
+
const lonMin = parseFloat(dmsMatch[2]);
|
|
779
|
+
const lonSec = parseFloat(dmsMatch[3]);
|
|
780
|
+
const latDeg = parseFloat(dmsMatch[4]);
|
|
781
|
+
const latMin = parseFloat(dmsMatch[5]);
|
|
782
|
+
const latSec = parseFloat(dmsMatch[6]);
|
|
783
|
+
if (!Number.isNaN(lonDeg) && !Number.isNaN(lonMin) && !Number.isNaN(lonSec) && !Number.isNaN(latDeg) && !Number.isNaN(latMin) && !Number.isNaN(latSec)) {
|
|
784
|
+
const lon = lonDeg + lonMin / 60 + lonSec / 3600;
|
|
785
|
+
const lat = latDeg + latMin / 60 + latSec / 3600;
|
|
786
|
+
return [
|
|
787
|
+
lon,
|
|
788
|
+
lat
|
|
789
|
+
];
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
const dmsCardinalMatch = cleaned.match(/^(\d+)°(\d+)'(\d+\.?\d*)["″]?([NS])\s+(\d+)°(\d+)'(\d+\.?\d*)["″]?([EW])$|^(\d+)°(\d+)'(\d+\.?\d*)["″]?([EW])\s+(\d+)°(\d+)'(\d+\.?\d*)["″]?([NS])$/i);
|
|
793
|
+
if (dmsCardinalMatch) {
|
|
794
|
+
let lat, lon;
|
|
795
|
+
if (dmsCardinalMatch[1]) {
|
|
796
|
+
const latDeg = parseFloat(dmsCardinalMatch[1]);
|
|
797
|
+
const latMin = parseFloat(dmsCardinalMatch[2]);
|
|
798
|
+
const latSec = parseFloat(dmsCardinalMatch[3]);
|
|
799
|
+
const latDir = dmsCardinalMatch[4].toUpperCase();
|
|
800
|
+
const lonDeg = parseFloat(dmsCardinalMatch[5]);
|
|
801
|
+
const lonMin = parseFloat(dmsCardinalMatch[6]);
|
|
802
|
+
const lonSec = parseFloat(dmsCardinalMatch[7]);
|
|
803
|
+
const lonDir = dmsCardinalMatch[8].toUpperCase();
|
|
804
|
+
lat = (latDeg + latMin / 60 + latSec / 3600) * ('N' === latDir ? 1 : -1);
|
|
805
|
+
lon = (lonDeg + lonMin / 60 + lonSec / 3600) * ('E' === lonDir ? 1 : -1);
|
|
806
|
+
} else {
|
|
807
|
+
const lonDeg = parseFloat(dmsCardinalMatch[9]);
|
|
808
|
+
const lonMin = parseFloat(dmsCardinalMatch[10]);
|
|
809
|
+
const lonSec = parseFloat(dmsCardinalMatch[11]);
|
|
810
|
+
const lonDir = dmsCardinalMatch[12].toUpperCase();
|
|
811
|
+
const latDeg = parseFloat(dmsCardinalMatch[13]);
|
|
812
|
+
const latMin = parseFloat(dmsCardinalMatch[14]);
|
|
813
|
+
const latSec = parseFloat(dmsCardinalMatch[15]);
|
|
814
|
+
const latDir = dmsCardinalMatch[16].toUpperCase();
|
|
815
|
+
lat = (latDeg + latMin / 60 + latSec / 3600) * ('N' === latDir ? 1 : -1);
|
|
816
|
+
lon = (lonDeg + lonMin / 60 + lonSec / 3600) * ('E' === lonDir ? 1 : -1);
|
|
817
|
+
}
|
|
818
|
+
if (!Number.isNaN(lat) && !Number.isNaN(lon)) return [
|
|
819
|
+
lon,
|
|
820
|
+
lat
|
|
821
|
+
];
|
|
822
|
+
}
|
|
823
|
+
const chineseFormatMatch = cleaned.match(/^经度\s*[::]\s*(-?\d+\.?\d*)\s*[,,]\s*纬度\s*[::]\s*(-?\d+\.?\d*)$/i);
|
|
824
|
+
if (chineseFormatMatch) {
|
|
825
|
+
const lon = parseFloat(chineseFormatMatch[1]);
|
|
826
|
+
const lat = parseFloat(chineseFormatMatch[2]);
|
|
827
|
+
if (!Number.isNaN(lon) && !Number.isNaN(lat)) return [
|
|
828
|
+
lon,
|
|
829
|
+
lat
|
|
830
|
+
];
|
|
831
|
+
}
|
|
832
|
+
return null;
|
|
833
|
+
};
|
|
834
|
+
const Tips = ()=>/*#__PURE__*/ jsxs("div", {
|
|
835
|
+
style: {
|
|
836
|
+
maxWidth: '300px'
|
|
837
|
+
},
|
|
838
|
+
children: [
|
|
839
|
+
/*#__PURE__*/ jsx("h4", {
|
|
840
|
+
children: "支持的坐标格式规则:"
|
|
841
|
+
}),
|
|
842
|
+
/*#__PURE__*/ jsxs("ol", {
|
|
843
|
+
style: {
|
|
844
|
+
margin: 0,
|
|
845
|
+
paddingLeft: '16px'
|
|
846
|
+
},
|
|
847
|
+
children: [
|
|
848
|
+
/*#__PURE__*/ jsxs("li", {
|
|
849
|
+
children: [
|
|
850
|
+
/*#__PURE__*/ jsx("strong", {
|
|
851
|
+
children: "十进制格式"
|
|
852
|
+
}),
|
|
853
|
+
":-134.5,44.56 或 -134.5 44.56"
|
|
854
|
+
]
|
|
855
|
+
}),
|
|
856
|
+
/*#__PURE__*/ jsxs("li", {
|
|
857
|
+
children: [
|
|
858
|
+
/*#__PURE__*/ jsx("strong", {
|
|
859
|
+
children: "方向指示格式"
|
|
860
|
+
}),
|
|
861
|
+
":E 134.5 N 44.56 或 W134.5 S44.56"
|
|
862
|
+
]
|
|
863
|
+
}),
|
|
864
|
+
/*#__PURE__*/ jsxs("li", {
|
|
865
|
+
children: [
|
|
866
|
+
/*#__PURE__*/ jsx("strong", {
|
|
867
|
+
children: "度分秒格式"
|
|
868
|
+
}),
|
|
869
|
+
":134\xb06′ 44\xb056′ 或 134\xb06' 44\xb056'"
|
|
870
|
+
]
|
|
871
|
+
}),
|
|
872
|
+
/*#__PURE__*/ jsxs("li", {
|
|
873
|
+
children: [
|
|
874
|
+
/*#__PURE__*/ jsx("strong", {
|
|
875
|
+
children: "带方向的度分秒格式"
|
|
876
|
+
}),
|
|
877
|
+
":23\xb019'13\"N 113\xb017'1\"E 或 113\xb017'1\"E 23\xb019'13\"N"
|
|
878
|
+
]
|
|
879
|
+
}),
|
|
880
|
+
/*#__PURE__*/ jsxs("li", {
|
|
881
|
+
children: [
|
|
882
|
+
/*#__PURE__*/ jsx("strong", {
|
|
883
|
+
children: "中文格式"
|
|
884
|
+
}),
|
|
885
|
+
":经度: 103.984535, 纬度: 30.627030"
|
|
886
|
+
]
|
|
887
|
+
})
|
|
888
|
+
]
|
|
889
|
+
}),
|
|
890
|
+
/*#__PURE__*/ jsxs("p", {
|
|
891
|
+
style: {
|
|
892
|
+
margin: '8px 0 0 0',
|
|
893
|
+
fontSize: '12px',
|
|
894
|
+
color: '#666'
|
|
895
|
+
},
|
|
896
|
+
children: [
|
|
897
|
+
"经度范围:-180 到 180",
|
|
898
|
+
/*#__PURE__*/ jsx("br", {}),
|
|
899
|
+
"纬度范围:-90 到 90"
|
|
900
|
+
]
|
|
901
|
+
})
|
|
902
|
+
]
|
|
903
|
+
});
|
|
904
|
+
const CoordinateInput_Tips = /*#__PURE__*/ memo(Tips);
|
|
905
|
+
const CoordinateInput = ({ value, onChange })=>{
|
|
906
|
+
const [inputValue, setInputValue] = useState('');
|
|
907
|
+
useEffect(()=>{
|
|
908
|
+
if (null === value) setInputValue('');
|
|
909
|
+
else if ('' === inputValue) setInputValue(value?.toString() || '');
|
|
910
|
+
}, [
|
|
911
|
+
value
|
|
912
|
+
]);
|
|
913
|
+
const [errorMessage, setErrorMessage] = useState('');
|
|
914
|
+
const [valueStr, setValueStr] = useState('');
|
|
915
|
+
const handleChange = (e)=>{
|
|
916
|
+
const val = e.target.value;
|
|
917
|
+
setInputValue(val);
|
|
918
|
+
if ('' === val.trim()) {
|
|
919
|
+
onChange(null);
|
|
920
|
+
setErrorMessage('');
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
923
|
+
const parsed = parseMethods_parseCoordinate(val);
|
|
924
|
+
if (null === parsed) setErrorMessage('Invalid coordinate format');
|
|
925
|
+
else {
|
|
926
|
+
const [lon, lat] = parsed;
|
|
927
|
+
if (lon < -180 || lon > 180) setErrorMessage('Longitude must be between -180 and 180');
|
|
928
|
+
else if (lat < -90 || lat > 90) setErrorMessage('Latitude must be between -90 and 90');
|
|
929
|
+
else {
|
|
930
|
+
setErrorMessage('');
|
|
931
|
+
setValueStr(`经度:${lon.toFixed(6)} , 纬度:${lat.toFixed(6)}`);
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
onChange(parsed);
|
|
935
|
+
};
|
|
936
|
+
return /*#__PURE__*/ jsxs(Flex, {
|
|
937
|
+
gap: 8,
|
|
938
|
+
vertical: true,
|
|
939
|
+
children: [
|
|
940
|
+
/*#__PURE__*/ jsx(Input, {
|
|
941
|
+
type: "text",
|
|
942
|
+
value: inputValue,
|
|
943
|
+
onChange: handleChange,
|
|
944
|
+
style: {
|
|
945
|
+
flex: 1,
|
|
946
|
+
marginRight: 5
|
|
947
|
+
},
|
|
948
|
+
title: "Enter coordinates (e.g. -134.5,44.56 or E 134.5 N 44.56 or 23\xb019'13N 113\xb017'1E or 经度: 103.984535, 纬度: 30.627030)",
|
|
949
|
+
placeholder: "Enter coordinates (e.g. -134.5,44.56 or E 134.5 N 44.56 or 23\xb019'13N 113\xb017'1E or 经度: 103.984535, 纬度: 30.627030)"
|
|
950
|
+
}),
|
|
951
|
+
/*#__PURE__*/ jsxs(Flex, {
|
|
952
|
+
children: [
|
|
953
|
+
/*#__PURE__*/ jsx("div", {
|
|
954
|
+
className: CoordinateInput_index_module.info,
|
|
955
|
+
style: {
|
|
956
|
+
color: errorMessage ? 'red' : 'inherit'
|
|
957
|
+
},
|
|
958
|
+
children: errorMessage || valueStr || (value ? `${value}` : '(e.g. -134.5,44.56 or E 134.5 N 44.56 or 23°19\'13"N 113°17\'1"E or 经度: 103.984535, 纬度: 30.627030)')
|
|
959
|
+
}),
|
|
960
|
+
/*#__PURE__*/ jsx(Popover, {
|
|
961
|
+
content: /*#__PURE__*/ jsx(CoordinateInput_Tips, {}),
|
|
962
|
+
children: /*#__PURE__*/ jsx(InfoCircleOutlined, {})
|
|
963
|
+
})
|
|
964
|
+
]
|
|
965
|
+
})
|
|
966
|
+
]
|
|
967
|
+
});
|
|
968
|
+
};
|
|
969
|
+
const CoordSystemTrans_index_module = {
|
|
970
|
+
container: "container-IqB0iy"
|
|
971
|
+
};
|
|
972
|
+
class CoordinateParser {
|
|
973
|
+
constructor(){
|
|
974
|
+
console.log('CoordinateParser 实例化');
|
|
975
|
+
}
|
|
976
|
+
static parse(input) {
|
|
977
|
+
if (!input || '' === input.trim()) return {
|
|
978
|
+
lng: 0,
|
|
979
|
+
lat: 0,
|
|
980
|
+
isValid: false,
|
|
981
|
+
error: '输入不能为空'
|
|
982
|
+
};
|
|
983
|
+
const trimmed = input.trim();
|
|
984
|
+
try {
|
|
985
|
+
return CoordinateParser.parseSmart(trimmed);
|
|
986
|
+
} catch (error) {
|
|
987
|
+
return {
|
|
988
|
+
lng: 0,
|
|
989
|
+
lat: 0,
|
|
990
|
+
isValid: false,
|
|
991
|
+
error: `解析失败: ${error instanceof Error ? error.message : '未知错误'}`
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
static parseSmart(input) {
|
|
996
|
+
const smartResult = CoordinateParser.parseSmartBySeparator(input);
|
|
997
|
+
if (smartResult.isValid) return smartResult;
|
|
998
|
+
return CoordinateParser.parseAuto(input);
|
|
999
|
+
}
|
|
1000
|
+
static parseSmartBySeparator(input) {
|
|
1001
|
+
const chineseLabelResult = CoordinateParser.parseChineseLabelFormat(input);
|
|
1002
|
+
if (chineseLabelResult.isValid) return chineseLabelResult;
|
|
1003
|
+
const hasComma = input.includes(',');
|
|
1004
|
+
const hasSpace = /\s+/.test(input);
|
|
1005
|
+
const hasDegree = input.includes('°');
|
|
1006
|
+
let parts = [];
|
|
1007
|
+
if (hasComma) parts = input.split(',').map((part)=>part.trim());
|
|
1008
|
+
else if (hasDegree) parts = input.split(/°+/).map((part)=>part.trim()).filter((part)=>'' !== part);
|
|
1009
|
+
else if (hasSpace) parts = input.split(/\s+/).map((part)=>part.trim());
|
|
1010
|
+
else {
|
|
1011
|
+
const numberMatches = input.match(/[-+]?\d*\.?\d+/g);
|
|
1012
|
+
if (numberMatches && numberMatches.length >= 2) parts = numberMatches.slice(0, 2);
|
|
1013
|
+
}
|
|
1014
|
+
if (parts.length < 2) return {
|
|
1015
|
+
lng: 0,
|
|
1016
|
+
lat: 0,
|
|
1017
|
+
isValid: false,
|
|
1018
|
+
error: '需要两个坐标值'
|
|
1019
|
+
};
|
|
1020
|
+
const lng = parseFloat(parts[0]);
|
|
1021
|
+
const lat = parseFloat(parts[1]);
|
|
1022
|
+
return CoordinateParser.validateAndReturn(lng, lat);
|
|
1023
|
+
}
|
|
1024
|
+
static parseAuto(input) {
|
|
1025
|
+
const formats = [
|
|
1026
|
+
'lng,lat',
|
|
1027
|
+
'lat,lng',
|
|
1028
|
+
'lng lat',
|
|
1029
|
+
'lat lng',
|
|
1030
|
+
'lng°lat°',
|
|
1031
|
+
'lat°lng°',
|
|
1032
|
+
'lng° lat°',
|
|
1033
|
+
'lat° lng°'
|
|
1034
|
+
];
|
|
1035
|
+
for (const format of formats){
|
|
1036
|
+
const result = CoordinateParser.parseWithFormat(input, format);
|
|
1037
|
+
if (result.isValid) return result;
|
|
1038
|
+
}
|
|
1039
|
+
return {
|
|
1040
|
+
lng: 0,
|
|
1041
|
+
lat: 0,
|
|
1042
|
+
isValid: false,
|
|
1043
|
+
error: '无法识别坐标格式'
|
|
1044
|
+
};
|
|
1045
|
+
}
|
|
1046
|
+
static parseWithFormat(input, format) {
|
|
1047
|
+
switch(format){
|
|
1048
|
+
case 'lng,lat':
|
|
1049
|
+
return CoordinateParser.parseLngLatComma(input);
|
|
1050
|
+
case 'lat,lng':
|
|
1051
|
+
return CoordinateParser.parseLatLngComma(input);
|
|
1052
|
+
case 'lng lat':
|
|
1053
|
+
return CoordinateParser.parseLngLatSpace(input);
|
|
1054
|
+
case 'lat lng':
|
|
1055
|
+
return CoordinateParser.parseLatLngSpace(input);
|
|
1056
|
+
case 'lng°lat°':
|
|
1057
|
+
return CoordinateParser.parseLngLatDegree(input, false);
|
|
1058
|
+
case 'lat°lng°':
|
|
1059
|
+
return CoordinateParser.parseLatLngDegree(input, false);
|
|
1060
|
+
case 'lng° lat°':
|
|
1061
|
+
return CoordinateParser.parseLngLatDegree(input, true);
|
|
1062
|
+
case 'lat° lng°':
|
|
1063
|
+
return CoordinateParser.parseLatLngDegree(input, true);
|
|
1064
|
+
default:
|
|
1065
|
+
return {
|
|
1066
|
+
lng: 0,
|
|
1067
|
+
lat: 0,
|
|
1068
|
+
isValid: false,
|
|
1069
|
+
error: '未知格式'
|
|
1070
|
+
};
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
static parseLngLatComma(input) {
|
|
1074
|
+
const parts = input.split(',');
|
|
1075
|
+
if (2 !== parts.length) return {
|
|
1076
|
+
lng: 0,
|
|
1077
|
+
lat: 0,
|
|
1078
|
+
isValid: false,
|
|
1079
|
+
error: '格式应为"经度,纬度"'
|
|
1080
|
+
};
|
|
1081
|
+
const lng = parseFloat(parts[0].trim());
|
|
1082
|
+
const lat = parseFloat(parts[1].trim());
|
|
1083
|
+
return CoordinateParser.validateAndReturn(lng, lat);
|
|
1084
|
+
}
|
|
1085
|
+
static parseLatLngComma(input) {
|
|
1086
|
+
const parts = input.split(',');
|
|
1087
|
+
if (2 !== parts.length) return {
|
|
1088
|
+
lng: 0,
|
|
1089
|
+
lat: 0,
|
|
1090
|
+
isValid: false,
|
|
1091
|
+
error: '格式应为"纬度,经度"'
|
|
1092
|
+
};
|
|
1093
|
+
const lat = parseFloat(parts[0].trim());
|
|
1094
|
+
const lng = parseFloat(parts[1].trim());
|
|
1095
|
+
return CoordinateParser.validateAndReturn(lng, lat);
|
|
1096
|
+
}
|
|
1097
|
+
static parseLngLatSpace(input) {
|
|
1098
|
+
const parts = input.split(/\s+/);
|
|
1099
|
+
if (2 !== parts.length) return {
|
|
1100
|
+
lng: 0,
|
|
1101
|
+
lat: 0,
|
|
1102
|
+
isValid: false,
|
|
1103
|
+
error: '格式应为"经度 纬度"'
|
|
1104
|
+
};
|
|
1105
|
+
const lng = parseFloat(parts[0].trim());
|
|
1106
|
+
const lat = parseFloat(parts[1].trim());
|
|
1107
|
+
return CoordinateParser.validateAndReturn(lng, lat);
|
|
1108
|
+
}
|
|
1109
|
+
static parseLatLngSpace(input) {
|
|
1110
|
+
const parts = input.split(/\s+/);
|
|
1111
|
+
if (2 !== parts.length) return {
|
|
1112
|
+
lng: 0,
|
|
1113
|
+
lat: 0,
|
|
1114
|
+
isValid: false,
|
|
1115
|
+
error: '格式应为"纬度 经度"'
|
|
1116
|
+
};
|
|
1117
|
+
const lat = parseFloat(parts[0].trim());
|
|
1118
|
+
const lng = parseFloat(parts[1].trim());
|
|
1119
|
+
return CoordinateParser.validateAndReturn(lng, lat);
|
|
1120
|
+
}
|
|
1121
|
+
static parseChineseLabelFormat(input) {
|
|
1122
|
+
const chineseLabelRegex = /经度\s*[::]\s*([-+]?\d*\.?\d+)\s*[,,]\s*纬度\s*[::]\s*([-+]?\d*\.?\d+)/;
|
|
1123
|
+
const match = input.match(chineseLabelRegex);
|
|
1124
|
+
if (match) {
|
|
1125
|
+
const lng = parseFloat(match[1]);
|
|
1126
|
+
const lat = parseFloat(match[2]);
|
|
1127
|
+
return CoordinateParser.validateAndReturn(lng, lat);
|
|
1128
|
+
}
|
|
1129
|
+
const chineseLabelReverseRegex = /纬度\s*[::]\s*([-+]?\d*\.?\d+)\s*[,,]\s*经度\s*[::]\s*([-+]?\d*\.?\d+)/;
|
|
1130
|
+
const reverseMatch = input.match(chineseLabelReverseRegex);
|
|
1131
|
+
if (reverseMatch) {
|
|
1132
|
+
const lat = parseFloat(reverseMatch[1]);
|
|
1133
|
+
const lng = parseFloat(reverseMatch[2]);
|
|
1134
|
+
return CoordinateParser.validateAndReturn(lng, lat);
|
|
1135
|
+
}
|
|
1136
|
+
return {
|
|
1137
|
+
lng: 0,
|
|
1138
|
+
lat: 0,
|
|
1139
|
+
isValid: false,
|
|
1140
|
+
error: '不匹配中文标签格式'
|
|
1141
|
+
};
|
|
1142
|
+
}
|
|
1143
|
+
static parseLngLatDegree(input, hasSpace) {
|
|
1144
|
+
const separator = hasSpace ? '°s*' : '°';
|
|
1145
|
+
const regex = new RegExp(`^(d+(?:.d+)?)${separator}(d+(?:.d+)?)°?$`);
|
|
1146
|
+
const match = input.match(regex);
|
|
1147
|
+
if (!match) return {
|
|
1148
|
+
lng: 0,
|
|
1149
|
+
lat: 0,
|
|
1150
|
+
isValid: false,
|
|
1151
|
+
error: '格式应为"经度°纬度°"'
|
|
1152
|
+
};
|
|
1153
|
+
const lng = parseFloat(match[1]);
|
|
1154
|
+
const lat = parseFloat(match[2]);
|
|
1155
|
+
return CoordinateParser.validateAndReturn(lng, lat);
|
|
1156
|
+
}
|
|
1157
|
+
static parseLatLngDegree(input, hasSpace) {
|
|
1158
|
+
const separator = hasSpace ? '°s*' : '°';
|
|
1159
|
+
const regex = new RegExp(`^(d+(?:.d+)?)${separator}(d+(?:.d+)?)°?$`);
|
|
1160
|
+
const match = input.match(regex);
|
|
1161
|
+
if (!match) return {
|
|
1162
|
+
lng: 0,
|
|
1163
|
+
lat: 0,
|
|
1164
|
+
isValid: false,
|
|
1165
|
+
error: '格式应为"纬度°经度°"'
|
|
1166
|
+
};
|
|
1167
|
+
const lat = parseFloat(match[1]);
|
|
1168
|
+
const lng = parseFloat(match[2]);
|
|
1169
|
+
return CoordinateParser.validateAndReturn(lng, lat);
|
|
1170
|
+
}
|
|
1171
|
+
static validateAndReturn(lng, lat) {
|
|
1172
|
+
if (Number.isNaN(lng) || Number.isNaN(lat)) return {
|
|
1173
|
+
lng: 0,
|
|
1174
|
+
lat: 0,
|
|
1175
|
+
isValid: false,
|
|
1176
|
+
error: '坐标值必须为数字'
|
|
1177
|
+
};
|
|
1178
|
+
if (lng < -180 || lng > 180) return {
|
|
1179
|
+
lng,
|
|
1180
|
+
lat,
|
|
1181
|
+
isValid: false,
|
|
1182
|
+
error: '经度范围应为-180到180'
|
|
1183
|
+
};
|
|
1184
|
+
if (lat < -90 || lat > 90) return {
|
|
1185
|
+
lng,
|
|
1186
|
+
lat,
|
|
1187
|
+
isValid: false,
|
|
1188
|
+
error: '纬度范围应为-90到90'
|
|
1189
|
+
};
|
|
1190
|
+
return {
|
|
1191
|
+
lng,
|
|
1192
|
+
lat,
|
|
1193
|
+
isValid: true
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
static format(lng, lat, precision = 6) {
|
|
1197
|
+
return `${lng.toFixed(precision)}, ${lat.toFixed(precision)}`;
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
const { Option } = Select;
|
|
1201
|
+
const { Text } = Typography;
|
|
1202
|
+
const COORD_SYSTEMS = [
|
|
1203
|
+
'wgs84',
|
|
1204
|
+
'gcj02',
|
|
1205
|
+
'bd09'
|
|
1206
|
+
];
|
|
1207
|
+
const DEFAULT_PRECISION = 8;
|
|
1208
|
+
const CoordSystemTrans = ({ initialSourceSystem = 'wgs84', initialTargetSystem = 'gcj02', className, onTransform })=>{
|
|
1209
|
+
const [inputValue, setInputValue] = useState('');
|
|
1210
|
+
const [sourceSystem, setSourceSystem] = useState(initialSourceSystem);
|
|
1211
|
+
const [targetSystem, setTargetSystem] = useState(initialTargetSystem);
|
|
1212
|
+
const [parseResult, setParseResult] = useState({
|
|
1213
|
+
lng: 0,
|
|
1214
|
+
lat: 0,
|
|
1215
|
+
isValid: false
|
|
1216
|
+
});
|
|
1217
|
+
const [transformedCoord, setTransformedCoord] = useState(null);
|
|
1218
|
+
const parseCoordinate = useCallback((value)=>{
|
|
1219
|
+
const result = CoordinateParser.parse(value);
|
|
1220
|
+
setParseResult(result);
|
|
1221
|
+
return result;
|
|
1222
|
+
}, []);
|
|
1223
|
+
const performTransform = useCallback((result)=>{
|
|
1224
|
+
if (!result.isValid) return void setTransformedCoord(null);
|
|
1225
|
+
try {
|
|
1226
|
+
const sourceCoord = [
|
|
1227
|
+
result.lng,
|
|
1228
|
+
result.lat
|
|
1229
|
+
];
|
|
1230
|
+
const targetCoord = transformCoordinate(sourceCoord, {
|
|
1231
|
+
from: sourceSystem,
|
|
1232
|
+
to: targetSystem,
|
|
1233
|
+
precision: DEFAULT_PRECISION
|
|
1234
|
+
});
|
|
1235
|
+
setTransformedCoord(targetCoord);
|
|
1236
|
+
onTransform?.({
|
|
1237
|
+
sourceCoord,
|
|
1238
|
+
targetCoord,
|
|
1239
|
+
sourceSystem,
|
|
1240
|
+
targetSystem
|
|
1241
|
+
});
|
|
1242
|
+
} catch (error) {
|
|
1243
|
+
console.error('坐标转换失败:', error);
|
|
1244
|
+
setTransformedCoord(null);
|
|
1245
|
+
}
|
|
1246
|
+
}, [
|
|
1247
|
+
sourceSystem,
|
|
1248
|
+
targetSystem,
|
|
1249
|
+
onTransform
|
|
1250
|
+
]);
|
|
1251
|
+
const handleInputChange = (value)=>{
|
|
1252
|
+
setInputValue(value);
|
|
1253
|
+
const result = parseCoordinate(value);
|
|
1254
|
+
performTransform(result);
|
|
1255
|
+
};
|
|
1256
|
+
const handleSystemChange = (type, system)=>{
|
|
1257
|
+
if ('source' === type) {
|
|
1258
|
+
setSourceSystem(system);
|
|
1259
|
+
if (parseResult.isValid) {
|
|
1260
|
+
const sourceCoord = [
|
|
1261
|
+
parseResult.lng,
|
|
1262
|
+
parseResult.lat
|
|
1263
|
+
];
|
|
1264
|
+
const targetCoord = transformCoordinate(sourceCoord, {
|
|
1265
|
+
from: system,
|
|
1266
|
+
to: targetSystem,
|
|
1267
|
+
precision: DEFAULT_PRECISION
|
|
1268
|
+
});
|
|
1269
|
+
setTransformedCoord(targetCoord);
|
|
1270
|
+
}
|
|
1271
|
+
} else {
|
|
1272
|
+
setTargetSystem(system);
|
|
1273
|
+
if (parseResult.isValid) {
|
|
1274
|
+
const sourceCoord = [
|
|
1275
|
+
parseResult.lng,
|
|
1276
|
+
parseResult.lat
|
|
1277
|
+
];
|
|
1278
|
+
const targetCoord = transformCoordinate(sourceCoord, {
|
|
1279
|
+
from: sourceSystem,
|
|
1280
|
+
to: system,
|
|
1281
|
+
precision: DEFAULT_PRECISION
|
|
1282
|
+
});
|
|
1283
|
+
setTransformedCoord(targetCoord);
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
};
|
|
1287
|
+
const copyCoordinate = async ()=>{
|
|
1288
|
+
if (!transformedCoord) return;
|
|
1289
|
+
const coordinateText = CoordinateParser.format(transformedCoord[0], transformedCoord[1], DEFAULT_PRECISION);
|
|
1290
|
+
try {
|
|
1291
|
+
await navigator.clipboard.writeText(coordinateText);
|
|
1292
|
+
} catch (_error) {}
|
|
1293
|
+
};
|
|
1294
|
+
useEffect(()=>{
|
|
1295
|
+
if (inputValue) {
|
|
1296
|
+
const result = parseCoordinate(inputValue);
|
|
1297
|
+
performTransform(result);
|
|
1298
|
+
}
|
|
1299
|
+
}, []);
|
|
1300
|
+
return /*#__PURE__*/ jsx("div", {
|
|
1301
|
+
className: `${CoordSystemTrans_index_module.container} ${className || ''}`,
|
|
1302
|
+
children: /*#__PURE__*/ jsxs(Space, {
|
|
1303
|
+
orientation: "vertical",
|
|
1304
|
+
size: "middle",
|
|
1305
|
+
style: {
|
|
1306
|
+
width: '100%'
|
|
1307
|
+
},
|
|
1308
|
+
children: [
|
|
1309
|
+
/*#__PURE__*/ jsxs(Flex, {
|
|
1310
|
+
vertical: true,
|
|
1311
|
+
gap: 8,
|
|
1312
|
+
children: [
|
|
1313
|
+
/*#__PURE__*/ jsxs(Flex, {
|
|
1314
|
+
gap: 8,
|
|
1315
|
+
children: [
|
|
1316
|
+
/*#__PURE__*/ jsx(Text, {
|
|
1317
|
+
style: {
|
|
1318
|
+
alignSelf: 'flex-start'
|
|
1319
|
+
},
|
|
1320
|
+
children: "坐标输入:"
|
|
1321
|
+
}),
|
|
1322
|
+
/*#__PURE__*/ jsx(Select, {
|
|
1323
|
+
value: sourceSystem,
|
|
1324
|
+
onChange: (value)=>handleSystemChange('source', value),
|
|
1325
|
+
popupMatchSelectWidth: false,
|
|
1326
|
+
size: "small",
|
|
1327
|
+
style: {
|
|
1328
|
+
flex: 1
|
|
1329
|
+
},
|
|
1330
|
+
children: COORD_SYSTEMS.map((system)=>/*#__PURE__*/ jsx(Option, {
|
|
1331
|
+
value: system,
|
|
1332
|
+
children: getCoordDisplayName(system)
|
|
1333
|
+
}, system))
|
|
1334
|
+
})
|
|
1335
|
+
]
|
|
1336
|
+
}),
|
|
1337
|
+
/*#__PURE__*/ jsx(Input, {
|
|
1338
|
+
value: inputValue,
|
|
1339
|
+
onChange: (e)=>handleInputChange(e.target.value),
|
|
1340
|
+
placeholder: "请输入坐标 (支持多种格式,如: 114.56,30.2 或 114.56 30.2)",
|
|
1341
|
+
status: parseResult.isValid ? '' : inputValue ? 'error' : ''
|
|
1342
|
+
}),
|
|
1343
|
+
!parseResult.isValid && inputValue && /*#__PURE__*/ jsxs(Text, {
|
|
1344
|
+
type: "danger",
|
|
1345
|
+
style: {
|
|
1346
|
+
marginTop: 4,
|
|
1347
|
+
display: 'block'
|
|
1348
|
+
},
|
|
1349
|
+
children: [
|
|
1350
|
+
"解析失败: ",
|
|
1351
|
+
parseResult.error
|
|
1352
|
+
]
|
|
1353
|
+
}),
|
|
1354
|
+
parseResult.isValid && /*#__PURE__*/ jsxs(Text, {
|
|
1355
|
+
type: "success",
|
|
1356
|
+
style: {
|
|
1357
|
+
marginTop: 4,
|
|
1358
|
+
display: 'block'
|
|
1359
|
+
},
|
|
1360
|
+
children: [
|
|
1361
|
+
"解析成功:",
|
|
1362
|
+
' ',
|
|
1363
|
+
CoordinateParser.format(parseResult.lng, parseResult.lat, DEFAULT_PRECISION)
|
|
1364
|
+
]
|
|
1365
|
+
})
|
|
1366
|
+
]
|
|
1367
|
+
}),
|
|
1368
|
+
/*#__PURE__*/ jsxs(Flex, {
|
|
1369
|
+
gap: 8,
|
|
1370
|
+
children: [
|
|
1371
|
+
/*#__PURE__*/ jsx(Text, {
|
|
1372
|
+
children: "转换结果:"
|
|
1373
|
+
}),
|
|
1374
|
+
/*#__PURE__*/ jsx(Select, {
|
|
1375
|
+
value: targetSystem,
|
|
1376
|
+
onChange: (value)=>handleSystemChange('target', value),
|
|
1377
|
+
popupMatchSelectWidth: false,
|
|
1378
|
+
size: "small",
|
|
1379
|
+
style: {
|
|
1380
|
+
flex: 1
|
|
1381
|
+
},
|
|
1382
|
+
children: COORD_SYSTEMS.map((system)=>/*#__PURE__*/ jsx(Option, {
|
|
1383
|
+
value: system,
|
|
1384
|
+
children: getCoordDisplayName(system)
|
|
1385
|
+
}, system))
|
|
1386
|
+
})
|
|
1387
|
+
]
|
|
1388
|
+
}),
|
|
1389
|
+
/*#__PURE__*/ jsxs(Flex, {
|
|
1390
|
+
vertical: true,
|
|
1391
|
+
gap: 8,
|
|
1392
|
+
children: [
|
|
1393
|
+
/*#__PURE__*/ jsx(Flex, {
|
|
1394
|
+
justify: "center",
|
|
1395
|
+
style: {
|
|
1396
|
+
padding: 8,
|
|
1397
|
+
border: '1px solid var(--theme-border-base)',
|
|
1398
|
+
borderRadius: 6
|
|
1399
|
+
},
|
|
1400
|
+
children: transformedCoord ? /*#__PURE__*/ jsx(Tooltip, {
|
|
1401
|
+
title: "点击复制坐标",
|
|
1402
|
+
children: /*#__PURE__*/ jsx(Text, {
|
|
1403
|
+
strong: true,
|
|
1404
|
+
style: {
|
|
1405
|
+
fontSize: '20px',
|
|
1406
|
+
userSelect: 'text',
|
|
1407
|
+
textAlign: 'center'
|
|
1408
|
+
},
|
|
1409
|
+
onClick: copyCoordinate,
|
|
1410
|
+
children: CoordinateParser.format(transformedCoord[0], transformedCoord[1], DEFAULT_PRECISION)
|
|
1411
|
+
})
|
|
1412
|
+
}) : /*#__PURE__*/ jsx(Text, {
|
|
1413
|
+
type: "secondary",
|
|
1414
|
+
children: "请输入有效坐标进行转换"
|
|
1415
|
+
})
|
|
1416
|
+
}),
|
|
1417
|
+
/*#__PURE__*/ jsxs(Text, {
|
|
1418
|
+
type: "secondary",
|
|
1419
|
+
style: {
|
|
1420
|
+
fontSize: '12px',
|
|
1421
|
+
textAlign: 'center'
|
|
1422
|
+
},
|
|
1423
|
+
children: [
|
|
1424
|
+
"从 ",
|
|
1425
|
+
getCoordDisplayName(sourceSystem),
|
|
1426
|
+
" 转换到",
|
|
1427
|
+
' ',
|
|
1428
|
+
getCoordDisplayName(targetSystem)
|
|
1429
|
+
]
|
|
1430
|
+
})
|
|
1431
|
+
]
|
|
1432
|
+
})
|
|
1433
|
+
]
|
|
1434
|
+
})
|
|
1435
|
+
});
|
|
1436
|
+
};
|
|
1437
|
+
class ErrorBoundary extends react.Component {
|
|
1438
|
+
state = {
|
|
1439
|
+
hasError: false
|
|
1440
|
+
};
|
|
1441
|
+
static getDerivedStateFromError(_) {
|
|
1442
|
+
return {
|
|
1443
|
+
hasError: true
|
|
1444
|
+
};
|
|
1445
|
+
}
|
|
1446
|
+
componentDidCatch(error, errorInfo) {
|
|
1447
|
+
console.error('Error caught by ErrorBoundary:', error, errorInfo);
|
|
1448
|
+
}
|
|
1449
|
+
render() {
|
|
1450
|
+
if (this.state.hasError) return /*#__PURE__*/ jsx("div", {
|
|
1451
|
+
children: /*#__PURE__*/ jsx("h1", {
|
|
1452
|
+
children: this.props.message || 'Something went wrong.'
|
|
1453
|
+
})
|
|
1454
|
+
});
|
|
1455
|
+
return this.props.children;
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
const ErrorBoundary_ErrorBoundary = ErrorBoundary;
|
|
1459
|
+
const components_ErrorBoundary = ErrorBoundary_ErrorBoundary;
|
|
1460
|
+
const Svg2D = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
1461
|
+
className: "icon",
|
|
1462
|
+
viewBox: "0 0 1024 1024",
|
|
1463
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1464
|
+
width: "1em",
|
|
1465
|
+
height: "1em",
|
|
1466
|
+
...props,
|
|
1467
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
1468
|
+
d: "M1019.815253 635.448889c-7.168 23.381333-20.48 42.268444-35.84 57.856a320.739556 320.739556 0 0 1-51.143111 41.130667c-73.671111 47.843556-158.606222 74.467556-234.382222 92.273777a1189.546667 1189.546667 0 0 1-91.079111 15.587556v-119.011556c23.552 0 50.119111 0 77.767111-2.218666 70.599111-4.437333 152.519111-15.587556 221.070222-43.349334 33.792-14.449778 65.536-33.393778 78.848-58.936889a55.239111 55.239111 0 0 0 5.12-40.049777 112.753778 112.753778 0 0 0-19.512889-36.693334 255.772444 255.772444 0 0 0-48.071111-44.487111c-13.312-8.817778-20.48-13.312-20.48-13.312s8.192 2.218667 22.528 8.931556c14.336 6.656 35.84 15.530667 58.311111 34.474666 11.264 8.817778 23.552 21.105778 32.768 42.211556 9.216 17.806222 11.264 43.406222 4.096 65.592889z m-366.193777-102.684445h-117.76V121.799111h113.322666c126.122667 0 204.288 64.967111 204.288 203.776 0 138.296889-78.165333 207.189333-199.850666 207.189333z m-9.443556-345.429333h-25.713778v279.324445h25.713778c76.970667 0 124.984889-41.073778 124.984889-141.084445 0-100.465778-48.014222-138.24-124.984889-138.24zM397.564587 838.940444c-24.064-3.527111-47.900444-7.964444-71.623111-13.312-75.776-17.749333-160.711111-44.487111-234.382223-92.273777a269.312 269.312 0 0 1-50.176-41.130667c-15.416889-16.725333-29.696-35.612444-36.864-57.856A95.175111 95.175111 0 0 1 7.591253 568.775111c8.248889-17.806222 20.48-30.037333 31.687111-40.049778 23.552-18.887111 44.088889-27.818667 58.424889-34.474666a157.013333 157.013333 0 0 1 22.471111-8.874667s-8.192 4.437333-20.48 13.312c-13.255111 10.012444-31.744 23.381333-48.071111 44.544-8.192 9.955556-15.36 23.267556-18.432 36.636444a49.607111 49.607111 0 0 0 5.063111 40.049778c14.392889 24.405333 46.136889 44.487111 79.872 57.799111 68.551111 27.818667 150.414222 37.831111 221.070223 42.268445 20.48 1.137778 39.822222 2.218667 58.254222 2.275555V661.048889l133.176889 124.529778-133.063111 124.586666v-71.224889z m-217.315556-353.393777c112.184889-99.953778 178.574222-177.152 178.574222-240.469334 0-41.642667-22.869333-66.673778-61.952-66.673777-30.151111 0-55.239111 19.456-75.889777 42.211555l-44.657778-44.430222c37.944889-39.992889 74.808889-62.179556 131.185778-62.179556 78.108444 0 130.048 49.948444 130.048 126.634667 0 74.410667-61.952 154.396444-137.329778 227.669333 20.650667-2.218667 48.014222-4.437333 67.015111-4.437333h89.827555v68.892444H180.249031v-47.217777z"
|
|
1469
|
+
})
|
|
1470
|
+
});
|
|
1471
|
+
const _2D = Svg2D;
|
|
1472
|
+
const Svg3D = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
1473
|
+
className: "icon",
|
|
1474
|
+
viewBox: "0 0 1024 1024",
|
|
1475
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1476
|
+
width: "1em",
|
|
1477
|
+
height: "1em",
|
|
1478
|
+
...props,
|
|
1479
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
1480
|
+
d: "M1019.953493 635.448889c-7.168 23.381333-20.48 42.268444-35.84 57.856-15.36 15.530667-32.711111 28.842667-51.143111 41.130667-73.671111 47.843556-158.663111 74.467556-234.382222 92.273777a1189.546667 1189.546667 0 0 1-91.079111 15.587556v-119.011556c23.552 0 50.119111 0 77.767111-2.218666 70.599111-4.437333 152.519111-15.587556 221.127111-43.349334 33.735111-14.449778 65.479111-33.393778 78.791111-58.936889a54.954667 54.954667 0 0 0 5.12-40.049777 111.843556 111.843556 0 0 0-19.569778-36.693334 255.431111 255.431111 0 0 0-48.014222-44.487111c-13.312-8.817778-20.48-13.312-20.48-13.312s8.192 2.218667 22.528 8.931556c14.336 6.656 35.84 15.530667 58.311111 34.474666 11.264 8.817778 23.552 21.105778 32.768 42.211556 9.216 17.806222 11.264 43.406222 4.096 65.592889z m-366.193777-102.684445h-117.76V121.799111h113.322666c126.122667 0 204.288 64.967111 204.288 203.776 0 138.296889-78.165333 207.189333-199.850666 207.189333z m-9.500445-345.429333h-25.656889v279.324445h25.656889c77.084444 0 125.041778-41.073778 125.041778-141.084445 0-100.465778-47.957333-138.24-125.041778-138.24zM397.702827 838.940444c-24.064-3.527111-47.957333-7.964444-71.68-13.312-75.719111-17.749333-160.711111-44.487111-234.382223-92.273777a270.791111 270.791111 0 0 1-50.119111-41.130667c-15.416889-16.725333-29.696-35.612444-36.864-57.856a94.833778 94.833778 0 0 1 3.128889-65.592889c8.135111-17.806222 20.423111-30.037333 31.687111-40.049778 23.495111-18.887111 44.032-27.818667 58.368-34.474666a157.013333 157.013333 0 0 1 22.471111-8.874667s-8.192 4.437333-20.48 13.312c-13.255111 10.012444-31.744 23.381333-48.071111 44.544a92.273778 92.273778 0 0 0-18.488889 36.636444 50.062222 50.062222 0 0 0 5.12 40.049778c14.336 24.405333 46.08 44.487111 79.815112 57.799111 68.608 27.818667 150.471111 37.831111 221.127111 42.268445 20.48 1.137778 39.879111 2.275556 58.311111 2.275555V661.048889l133.063111 124.529778-133.006222 124.586666v-71.224889z m56.718222-417.792c0 75.491556-66.389333 119.352889-145.123556 119.352889-65.308444 0-109.397333-24.405333-138.410666-57.173333l38.513777-51.655111c24.576 23.893333 54.670222 42.211556 92.103112 42.211555 41.870222 0 70.314667-20.536889 70.314666-57.230222 0-40.504889-24.007111-65.479111-113.891555-65.479111V292.295111c75.946667 0 100.465778-26.112 100.465777-62.748444 0-32.256-20.081778-51.143111-55.239111-51.655111-29.582222 0.512-53.589333 14.392889-78.165333 36.636444l-41.813333-50.005333c35.669333-31.061333 75.320889-50.517333 123.904-50.517334 79.815111 0 133.973333 38.855111 133.973333 109.397334 0 44.430222-25.088 76.629333-69.233778 93.866666v2.787556c46.876444 12.743111 82.602667 47.217778 82.602667 101.091555z"
|
|
1481
|
+
})
|
|
1482
|
+
});
|
|
1483
|
+
const _3D = Svg3D;
|
|
1484
|
+
const SvgAngle = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
1485
|
+
className: "icon",
|
|
1486
|
+
viewBox: "0 0 1024 1024",
|
|
1487
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1488
|
+
width: "1em",
|
|
1489
|
+
height: "1em",
|
|
1490
|
+
...props,
|
|
1491
|
+
children: [
|
|
1492
|
+
/*#__PURE__*/ jsx("path", {
|
|
1493
|
+
d: "M929.11 927.64h-831a32 32 0 0 1-28.4-46.74l414-797.42A32 32 0 0 1 540.5 113L150.82 863.64h778.29a32 32 0 0 1 0 64z"
|
|
1494
|
+
}),
|
|
1495
|
+
/*#__PURE__*/ jsx("path", {
|
|
1496
|
+
d: "M531.9 924.68a32 32 0 0 1-30.84-40.61c41.09-147.13-45.18-300.26-192.31-341.35A32 32 0 1 1 326 481.08a340.8 340.8 0 0 1 236.7 420.2 32 32 0 0 1-30.8 23.4z"
|
|
1497
|
+
})
|
|
1498
|
+
]
|
|
1499
|
+
});
|
|
1500
|
+
const Angle = SvgAngle;
|
|
1501
|
+
const SvgArea = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
1502
|
+
className: "icon",
|
|
1503
|
+
viewBox: "0 0 1024 1024",
|
|
1504
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1505
|
+
width: "1em",
|
|
1506
|
+
height: "1em",
|
|
1507
|
+
...props,
|
|
1508
|
+
children: [
|
|
1509
|
+
/*#__PURE__*/ jsx("path", {
|
|
1510
|
+
d: "M800 894.1H224c-16.9 0-30.5-13.7-30.5-30.5v-47.2h-41.6c-16.9 0-30.5-13.7-30.5-30.5V229.7c0-16.9 13.7-30.5 30.5-30.5h41.6V129c0-16.9 13.7-30.5 30.5-30.5h576c16.9 0 30.5 13.7 30.5 30.5v70.2h55.9c16.9 0 30.5 13.7 30.5 30.5v556.1c0 16.9-13.7 30.5-30.5 30.5h-55.9v47.2c0.1 16.9-13.6 30.6-30.5 30.6z m-545.5-61h515v-47.2c0-16.9 13.7-30.5 30.5-30.5h55.9V260.3H800c-16.9 0-30.5-13.7-30.5-30.5v-70.2h-515v70.2c0 16.9-13.7 30.5-30.5 30.5h-41.6v495.1H224c16.9 0 30.5 13.7 30.5 30.5v47.2z"
|
|
1511
|
+
}),
|
|
1512
|
+
/*#__PURE__*/ jsx("path", {
|
|
1513
|
+
d: "M224 822c-7.8 0-15.6-3-21.6-8.9-11.9-11.9-11.9-31.2 0-43.2l576.1-576.1c11.9-11.9 31.2-11.9 43.2 0 11.9 11.9 11.9 31.2 0 43.2L245.6 813.1c-6 5.9-13.8 8.9-21.6 8.9z"
|
|
1514
|
+
}),
|
|
1515
|
+
/*#__PURE__*/ jsx("path", {
|
|
1516
|
+
d: "M224 967.6H72.7c-16.9 0-30.5-13.7-30.5-30.5V785.8c0-16.9 13.7-30.5 30.5-30.5H224c16.9 0 30.5 13.7 30.5 30.5V937c0 17-13.7 30.6-30.5 30.6z m-120.7-61h90.2v-90.2h-90.2v90.2zM447.2 893.2c-7.8 0-15.6-3-21.6-8.9-11.9-11.9-11.9-31.2 0-43.2L853 413.8c11.9-11.9 31.2-11.9 43.2 0 11.9 11.9 11.9 31.2 0 43.2L468.8 884.3c-6 5.9-13.8 8.9-21.6 8.9zM155.1 566.2c-7.8 0-15.6-3-21.6-8.9-11.9-11.9-11.9-31.2 0-43.2l383.7-383.7c11.9-11.9 31.2-11.9 43.2 0 11.9 11.9 11.9 31.2 0 43.2L176.6 557.2c-5.9 6-13.7 9-21.5 9zM224 260.3H72.7c-16.9 0-30.5-13.7-30.5-30.5V78.5C42.2 61.6 55.9 48 72.7 48H224c16.9 0 30.5 13.7 30.5 30.5v151.2c0 16.9-13.7 30.6-30.5 30.6z m-120.7-61.1h90.2V109h-90.2v90.2zM951.3 260.3H800c-16.9 0-30.5-13.7-30.5-30.5V78.5c0-16.9 13.7-30.5 30.5-30.5h151.2c16.9 0 30.5 13.7 30.5 30.5v151.2c0.1 16.9-13.6 30.6-30.4 30.6z m-120.7-61.1h90.2V109h-90.2v90.2zM951.3 967.6H800c-16.9 0-30.5-13.7-30.5-30.5V785.8c0-16.9 13.7-30.5 30.5-30.5h151.2c16.9 0 30.5 13.7 30.5 30.5V937c0.1 17-13.6 30.6-30.4 30.6z m-120.7-61h90.2v-90.2h-90.2v90.2z"
|
|
1517
|
+
})
|
|
1518
|
+
]
|
|
1519
|
+
});
|
|
1520
|
+
const Area = SvgArea;
|
|
1521
|
+
const SvgCircleSelect = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
1522
|
+
className: "icon",
|
|
1523
|
+
viewBox: "0 0 1024 1024",
|
|
1524
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1525
|
+
width: "1em",
|
|
1526
|
+
height: "1em",
|
|
1527
|
+
...props,
|
|
1528
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
1529
|
+
d: "M926.7 480.8C926.7 249.5 739.2 62 507.9 62S89.1 249.5 89.1 480.8c0 228 182.1 413.4 408.8 418.7 12.7 36.3 47.2 62.4 87.8 62.4 51.4 0 93.1-41.7 93.1-93.1 0-1.8-0.2-3.7-0.3-5.5 146.3-65.3 248.2-212 248.2-382.6z m-264.6 335c-16.8-24.2-44.7-40-76.4-40-44.7 0-82 31.5-91 73.5C297.1 842.4 139 680.1 139 480.8 139 277.1 304.1 112 507.8 112c203.7 0 368.8 165.1 368.8 368.8 0 148.6-87.9 276.6-214.6 335z"
|
|
1530
|
+
})
|
|
1531
|
+
});
|
|
1532
|
+
const CircleSelect = SvgCircleSelect;
|
|
1533
|
+
const SvgCopy = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
1534
|
+
className: "icon",
|
|
1535
|
+
viewBox: "0 0 1024 1024",
|
|
1536
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1537
|
+
width: "1em",
|
|
1538
|
+
height: "1em",
|
|
1539
|
+
...props,
|
|
1540
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
1541
|
+
d: "M337.28 138.688a27.968 27.968 0 0 0-27.968 27.968v78.72h377.344c50.816 0 92.032 41.152 92.032 91.968v377.344h78.656a28.032 28.032 0 0 0 27.968-28.032V166.656a28.032 28.032 0 0 0-27.968-27.968H337.28z m441.408 640v78.656c0 50.816-41.216 91.968-92.032 91.968H166.656a92.032 92.032 0 0 1-91.968-91.968V337.28c0-50.816 41.152-92.032 91.968-92.032h78.72V166.656c0-50.816 41.152-91.968 91.968-91.968h520c50.816 0 91.968 41.152 91.968 91.968v520c0 50.816-41.152 92.032-91.968 92.032h-78.72zM166.656 309.312a27.968 27.968 0 0 0-27.968 28.032v520c0 15.424 12.544 27.968 27.968 27.968h520a28.032 28.032 0 0 0 28.032-27.968V337.28a28.032 28.032 0 0 0-28.032-28.032H166.656z"
|
|
1542
|
+
})
|
|
1543
|
+
});
|
|
1544
|
+
const Copy = SvgCopy;
|
|
1545
|
+
const SvgCyber = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
1546
|
+
className: "icon",
|
|
1547
|
+
viewBox: "0 0 1024 1024",
|
|
1548
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1549
|
+
width: "1em",
|
|
1550
|
+
height: "1em",
|
|
1551
|
+
...props,
|
|
1552
|
+
children: [
|
|
1553
|
+
/*#__PURE__*/ jsx("path", {
|
|
1554
|
+
d: "M512 1024C229.68 1024 0 794.32 0 512S229.68 0 512 0s512 229.68 512 512-229.68 512-512 512z m0-992C247.328 32 32 247.328 32 512s215.328 480 480 480 480-215.328 480-480S776.672 32 512 32z"
|
|
1555
|
+
}),
|
|
1556
|
+
/*#__PURE__*/ jsx("path", {
|
|
1557
|
+
d: "M368 1002.72a16 16 0 0 1-16-16V784c0-35.296-28.704-64-64-64h-48a16 16 0 0 1 0-32h48c52.944 0 96 43.056 96 96v202.72a16 16 0 0 1-16 16z"
|
|
1558
|
+
}),
|
|
1559
|
+
/*#__PURE__*/ jsx("path", {
|
|
1560
|
+
d: "M192 768c-35.296 0-64-28.704-64-64s28.704-64 64-64 64 28.704 64 64-28.704 64-64 64z m0-96c-17.648 0-32 14.352-32 32s14.352 32 32 32 32-14.352 32-32-14.352-32-32-32zM656 1002.72a16 16 0 0 1-16-16V672c0-52.944 43.056-96 96-96h48a16 16 0 0 1 0 32h-48c-35.296 0-64 28.704-64 64v314.72a16 16 0 0 1-16 16z"
|
|
1561
|
+
}),
|
|
1562
|
+
/*#__PURE__*/ jsx("path", {
|
|
1563
|
+
d: "M832 656c-35.296 0-64-28.704-64-64s28.704-64 64-64 64 28.704 64 64-28.704 64-64 64z m0-96c-17.648 0-32 14.352-32 32s14.352 32 32 32 32-14.352 32-32-14.352-32-32-32zM464 1021.76a16 16 0 0 1-16-16V528c0-35.296-28.704-64-64-64H20.16a16 16 0 0 1 0-32H384c52.944 0 96 43.056 96 96v477.76a16 16 0 0 1-16 16z"
|
|
1564
|
+
}),
|
|
1565
|
+
/*#__PURE__*/ jsx("path", {
|
|
1566
|
+
d: "M560 797.76a16 16 0 0 1-16-16V352c0-35.296-28.704-64-64-64h-48a16 16 0 0 1 0-32h48c52.944 0 96 43.056 96 96v429.76a16 16 0 0 1-16 16z"
|
|
1567
|
+
}),
|
|
1568
|
+
/*#__PURE__*/ jsx("path", {
|
|
1569
|
+
d: "M384 336c-35.296 0-64-28.704-64-64s28.704-64 64-64 64 28.704 64 64-28.704 64-64 64z m0-96c-17.648 0-32 14.352-32 32s14.352 32 32 32 32-14.352 32-32-14.352-32-32-32zM816 384h-48c-52.944 0-96-43.056-96-96V48.16a16 16 0 0 1 32 0V288c0 35.296 28.704 64 64 64h48a16 16 0 0 1 0 32z"
|
|
1570
|
+
}),
|
|
1571
|
+
/*#__PURE__*/ jsx("path", {
|
|
1572
|
+
d: "M864 432c-35.296 0-64-28.704-64-64s28.704-64 64-64 64 28.704 64 64-28.704 64-64 64z m0-96c-17.648 0-32 14.352-32 32s14.352 32 32 32 32-14.352 32-32-14.352-32-32-32zM560 864c-4.16 0-8.32-1.76-11.36-4.64-2.88-3.04-4.64-7.2-4.64-11.36 0-4.16 1.76-8.32 4.64-11.36 6.08-5.92 16.64-5.92 22.72 0 2.88 3.04 4.64 7.2 4.64 11.36 0 4.32-1.76 8.32-4.64 11.36-3.04 2.88-7.2 4.64-11.36 4.64zM560 928c-4.16 0-8.32-1.76-11.36-4.64-2.88-3.04-4.64-7.2-4.64-11.36 0-4.16 1.76-8.32 4.64-11.36 6.08-5.92 16.8-5.92 22.72 0 2.88 3.04 4.64 7.2 4.64 11.36 0 4.16-1.76 8.32-4.64 11.36-3.04 2.88-7.2 4.64-11.36 4.64zM560 1021.76a16 16 0 0 1-16-16v-31.68a16 16 0 0 1 32 0v31.68a16 16 0 0 1-16 16z"
|
|
1573
|
+
})
|
|
1574
|
+
]
|
|
1575
|
+
});
|
|
1576
|
+
const Cyber = SvgCyber;
|
|
1577
|
+
const SvgFreedomSelect = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
1578
|
+
className: "icon",
|
|
1579
|
+
viewBox: "0 0 1024 1024",
|
|
1580
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1581
|
+
width: "1em",
|
|
1582
|
+
height: "1em",
|
|
1583
|
+
...props,
|
|
1584
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
1585
|
+
d: "M940.9 276.7c-8.3-34.1-24.4-65.5-47.8-93.5-21.7-25.9-49.2-48.3-81.9-66.6-62-34.6-139.4-52.9-223.8-52.9V118 63.6c-48.6 0-98.1 6.1-147.3 18.1-110.3 27-207.6 81.3-274.1 153-34.1 36.7-58.5 76.2-72.6 117.4-15.5 45.2-18 90.2-7.3 133.8 5.3 21.7 13.8 42.3 25.2 61.6-24.7 24.3-37.7 54.5-36.1 85.8 1 20.4 8.3 40.4 21 57.7 10.7 14.5 25 27 42.5 37.2 30.7 17.9 70.4 27.7 111.8 27.7 4.4 0 8.9-0.1 13.4-0.3 9.6-0.5 19.1-1.5 28.4-3 4.7 2.6 9.6 5.1 14.5 7.6 21.9 11 35.4 20.1 41.3 28 3.3 4.4 4.9 9 4.2 21.2-1.8 30.6-23.9 79.7-57.8 108.7l35.3 41.3c41.5-35.5 73.8-97.3 76.7-146.7 0.9-16 0.1-36.8-14.8-56.9-6.8-9.1-15.9-17.5-28.5-25.9 6.2-3.2 12.1-6.7 17.7-10.5 9.7-6.5 18.2-13.7 25.6-21.4 10.9 0.6 22 1 33.3 1 48.6 0 98.1-6.1 147.2-18.1 110.3-27 207.6-81.3 274.1-153 34.1-36.7 58.5-76.2 72.6-117.4 15.4-45.2 17.9-90.2 7.2-133.8z m-811.4 354c-0.7-13.6 4.5-26.6 14.2-38.2 8.3 23.2 20.2 45.2 35.5 65.8 10.6 14.2 22.8 27.7 36.5 40.3-48.8-8.5-84.6-34.9-86.2-67.9z m172.2 64.7c-12.8-7.8-25.6-16.8-37.8-26.9 19.8 7.6 40.7 13.9 62.6 18.7-7.8 3.2-16.1 6-24.8 8.2z m78.8-54.2c-78.3-9.4-145.5-37.6-189.9-80.4v-0.1c18.4-7.4 39.8-12.1 62.9-13.3 3.6-0.2 7.1-0.3 10.7-0.3 65.8 0 119 30.6 121 71 0.3 7.9-1.3 15.7-4.7 23.1z m193.4-13.1c-45.9 11.2-91.2 16.6-134.3 16.6h-3c2.3-9.6 3.3-19.4 2.8-29.3-1-20.4-8.3-40.4-21-57.7-10.7-14.5-25-27-42.5-37.2-30.7-17.9-70.4-27.7-111.8-27.7v54.4-54.4c-4.4 0-8.9 0.1-13.4 0.3-34.2 1.7-66.9 9.9-94.6 23.5-7.6-13.6-13.5-28.1-17.2-43.4-33.4-136.3 107.3-287.8 314.2-338.5C499 123.3 544.3 118 587.4 118c151.1 0 274.8 65.5 300.7 171.6 33.4 136.3-107.3 287.8-314.2 338.5z"
|
|
1586
|
+
})
|
|
1587
|
+
});
|
|
1588
|
+
const FreedomSelect = SvgFreedomSelect;
|
|
1589
|
+
const SvgGetPosition = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
1590
|
+
className: "icon",
|
|
1591
|
+
viewBox: "0 0 1024 1024",
|
|
1592
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1593
|
+
width: "1em",
|
|
1594
|
+
height: "1em",
|
|
1595
|
+
...props,
|
|
1596
|
+
children: [
|
|
1597
|
+
/*#__PURE__*/ jsx("path", {
|
|
1598
|
+
d: "M617.472 648.192c-20.48-9.216-44.032 1.024-52.224 20.48-9.216 20.48 1.024 44.032 20.48 52.224 48.128 20.48 77.824 49.152 77.824 73.728 0 45.056-101.376 108.544-265.216 108.544S133.12 840.704 133.12 795.648c0-23.552 25.6-49.152 69.632-69.632 19.456-9.216 28.672-32.768 18.432-53.248-9.216-19.456-32.768-28.672-53.248-18.432-73.728 34.816-113.664 84.992-113.664 141.312 0 107.52 148.48 188.416 345.088 188.416s345.088-80.896 345.088-188.416c-1.024-58.368-47.104-112.64-126.976-147.456z"
|
|
1599
|
+
}),
|
|
1600
|
+
/*#__PURE__*/ jsx("path", {
|
|
1601
|
+
d: "M968.704 200.704c-4.096-13.312-14.336-22.528-26.624-26.624L483.328 41.984c-11.264-3.072-22.528-2.048-32.768 5.12-9.216 6.144-16.384 17.408-17.408 28.672L417.792 204.8 394.24 406.528l-7.168 62.464-34.816 303.104c-2.048 21.504 13.312 41.984 34.816 44.032h4.096c19.456 0 36.864-15.36 39.936-34.816L460.8 522.24l379.904 83.968c3.072 1.024 6.144 1.024 8.192 1.024 10.24 0 21.504-4.096 28.672-12.288 9.216-10.24 13.312-24.576 9.216-37.888L838.656 378.88l119.808-140.288c11.264-11.264 14.336-25.6 10.24-37.888zM766.976 342.016c-8.192 10.24-11.264 23.552-8.192 35.84l35.84 135.168-323.584-71.68 35.84-310.272 353.28 101.376-93.184 109.568z"
|
|
1602
|
+
})
|
|
1603
|
+
]
|
|
1604
|
+
});
|
|
1605
|
+
const GetPosition = SvgGetPosition;
|
|
1606
|
+
const SvgHand = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
1607
|
+
className: "icon",
|
|
1608
|
+
viewBox: "0 0 1024 1024",
|
|
1609
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1610
|
+
width: "1em",
|
|
1611
|
+
height: "1em",
|
|
1612
|
+
...props,
|
|
1613
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
1614
|
+
d: "M824.515155 243.164159c-16.249079 0-31.582299 4.389984-44.734854 12.033058l0-56.767911c0-49.345871-40.10337-89.468684-89.468684-89.468684-18.438954 0-35.519981 5.591345-49.800219 15.155165-12.236696-34.83539-45.433772-59.890019-84.405365-59.890019-38.968523 0-72.189136 25.054629-84.420715 59.890019-14.21884-9.56382-31.343869-15.155165-49.7818-15.155165-49.343825 0-89.467661 40.122813-89.467661 89.468684l0 329.831031-60.22157-104.365976c-11.664667-21.25407-30.735002-36.369326-53.626361-42.637076-22.321378-6.072299-45.541219-2.863211-65.399499 9.041934-40.582277 24.332175-56.048527 79.356372-34.444487 122.669854 1.333368 2.708692 29.879518 61.160965 118.979812 239.312434 41.960671 83.877339 88.004333 143.902434 136.845715 178.239474 38.334073 26.956955 64.831564 28.353768 69.746504 28.353768l223.674269 0c38.047548 0 73.438593-12.362562 105.236809-36.785811 29.794583-22.935362 55.745628-56.136531 76.933183-98.596576 41.765219-83.532485 63.869656-199.123107 63.869656-334.333578L914.029888 332.587817c0-49.342802-40.148395-89.469708-89.467661-89.469708L824.515155 243.164159zM869.250008 489.203808c0 128.264269-20.444635 236.908688-59.150168 314.276776-25.255197 50.504254-70.422909 110.702288-142.157697 110.702288l-223.234247 0c-1.726318-0.130983-20.576641-2.228761-48.974411-23.502273-28.308743-21.186532-71.795163-65.835428-118.017904-158.318772-90.669022-181.384094-118.541837-238.506069-118.803803-239.050468-0.041956-0.089028-0.041956-0.130983-0.085958-0.176009-11.228739-22.499433-3.276626-51.988048 17.388019-64.36903 9.304923-5.593392 20.180622-7.057743 30.645974-4.239558 11.138688 3.036149 20.488637 10.552334 26.253944 21.100574 0.10847 0.130983 0.198521 0.326435 0.284479 0.458441l69.829392 121.009028c14.264888 26.079982 30.319539 37.004799 47.730071 32.593326 17.452487-4.414543 26.253944-21.889543 26.253944-51.770084L377.211643 198.429305c0-24.64019 20.09671-44.734854 44.732807-44.734854 24.642237 0 44.738947 20.094664 44.738947 44.734854l0 290.774503c0 12.342096 10.021238 22.367427 22.366404 22.367427 12.341073 0 22.36538-10.025331 22.36538-22.367427L511.415181 153.694451c0-24.641213 20.09671-44.73383 44.735877-44.73383 24.638143 0 44.735877 20.092617 44.735877 44.73383l0 335.509357c0 12.342096 10.002818 22.367427 22.36538 22.367427 12.363585 0 22.367427-10.025331 22.367427-22.367427L645.619742 198.429305c0-24.64019 20.098757-44.734854 44.73383-44.734854 24.63712 0 44.735877 20.094664 44.735877 44.734854l0 335.509357c0 12.319583 10.001795 22.367427 22.367427 22.367427 12.363585 0 22.366404-10.047844 22.366404-22.367427L779.82328 332.632843c0-24.641213 20.09671-44.73383 44.735877-44.73383 24.635073 0 44.731784 20.092617 44.731784 44.73383l0 156.570965L869.250008 489.203808z"
|
|
1615
|
+
})
|
|
1616
|
+
});
|
|
1617
|
+
const Hand = SvgHand;
|
|
1618
|
+
const SvgLine = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
1619
|
+
className: "icon",
|
|
1620
|
+
viewBox: "0 0 1024 1024",
|
|
1621
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1622
|
+
width: "1em",
|
|
1623
|
+
height: "1em",
|
|
1624
|
+
...props,
|
|
1625
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
1626
|
+
d: "M933.5296 66.1504a163.84 163.84 0 0 1-201.5744 255.488 37.7344 37.7344 0 0 1-2.9696 3.3792l-405.504 405.504a39.424 39.424 0 0 1-3.328 2.9696A163.8912 163.8912 0 1 1 266.24 679.5264a38.912 38.912 0 0 1 2.9696-3.328l405.504-405.504c1.024-1.024 2.1504-2.048 3.328-2.9696a163.8912 163.8912 0 0 1 255.488-201.5744z m-54.272 54.272a87.04 87.04 0 1 1-123.136 123.136 87.04 87.04 0 0 1 123.136-123.0848zM242.0736 880.7936a87.04 87.04 0 1 0-123.136-123.0848 87.04 87.04 0 0 0 123.136 123.0848z"
|
|
1627
|
+
})
|
|
1628
|
+
});
|
|
1629
|
+
const Line = SvgLine;
|
|
1630
|
+
const SvgMarker = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
1631
|
+
className: "icon",
|
|
1632
|
+
viewBox: "0 0 1024 1024",
|
|
1633
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1634
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
1635
|
+
width: "1em",
|
|
1636
|
+
height: "1em",
|
|
1637
|
+
...props,
|
|
1638
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
1639
|
+
d: "M658.285714 365.714286q0-60.562286-42.861714-103.424t-103.424-42.861714-103.424 42.861714-42.861714 103.424 42.861714 103.424 103.424 42.861714 103.424-42.861714 42.861714-103.424zM804.571429 365.714286q0 62.317714-18.870857 102.253714l-208.018286 442.294857q-9.142857 18.870857-27.136 29.696t-38.546286 10.825143-38.546286-10.825143-26.550857-29.696l-208.603429-442.294857q-18.870857-40.009143-18.870857-102.253714 0-121.124571 85.723429-206.848t206.848-85.723429 206.848 85.723429 85.723429 206.848z"
|
|
1640
|
+
})
|
|
1641
|
+
});
|
|
1642
|
+
const generated_Marker = SvgMarker;
|
|
1643
|
+
const SvgMeasure = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
1644
|
+
className: "icon",
|
|
1645
|
+
viewBox: "0 0 1024 1024",
|
|
1646
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1647
|
+
width: "1em",
|
|
1648
|
+
height: "1em",
|
|
1649
|
+
...props,
|
|
1650
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
1651
|
+
d: "M101.032 718.088l162.616-162.584-166.152-166.16c-40.696-40.72-40.696-106.96 0-147.68L241.44 97.72A103.752 103.752 0 0 1 315.28 67.12a103.68 103.68 0 0 1 73.832 30.6l166.16 166.152 146.92-146.936a143.976 143.976 0 0 1 102.448-42.44c38.704 0 75.08 15.088 102.44 42.448a143.944 143.944 0 0 1 42.448 102.448c0 38.688-15.08 75.064-42.448 102.424L760.16 468.752l166.16 166.16c40.688 40.728 40.688 106.96-0.008 147.688l-143.944 143.936a103.744 103.744 0 0 1-73.84 30.608 103.696 103.696 0 0 1-73.84-30.608l-166.16-166.16-162.768 162.8-180.072 21.584a43.144 43.144 0 0 1-36.032-12.704 43.12 43.12 0 0 1-12.112-36.184l23.488-177.784z m755.816-446.496a73.344 73.344 0 0 0 21.632-52.2 73.336 73.336 0 0 0-21.648-52.224c-27.872-27.888-76.512-27.888-104.4 0L605.496 314.088l104.432 104.44 146.92-146.936z m-171.92 604.712c12.6 12.624 34.592 12.624 47.208 0l143.936-143.944a33.44 33.44 0 0 0 0.008-47.224L763.848 572.92c-1.64 5.376-4.136 10.528-8.392 14.792l-62.48 62.488a35.528 35.528 0 0 1-50.24-50.24l62.48-62.488c4.264-4.264 9.416-6.752 14.8-8.392L629.392 438.48c-1.64 5.376-4.144 10.528-8.392 14.776L523.56 550.72a35.528 35.528 0 0 1-50.24-50.24l97.448-97.464c4.248-4.24 9.4-6.744 14.784-8.384L494.952 304.032c-1.64 5.376-4.144 10.52-8.392 14.776l-62.488 62.496a35.528 35.528 0 0 1-50.24-50.24l62.488-62.496c4.248-4.256 9.4-6.744 14.776-8.384L338.88 147.96a33.128 33.128 0 0 0-23.592-9.784 33.16 33.16 0 0 0-23.608 9.784L147.728 291.896a33.44 33.44 0 0 0-0.008 47.224l537.208 537.176z m-412.04-20.744l145.408-145.416-104.416-104.424-145.584 145.576-15.68 118.664 120.272-14.4z"
|
|
1652
|
+
})
|
|
1653
|
+
});
|
|
1654
|
+
const Measure = SvgMeasure;
|
|
1655
|
+
const SvgMode = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
1656
|
+
className: "icon",
|
|
1657
|
+
viewBox: "0 0 1024 1024",
|
|
1658
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1659
|
+
width: "1em",
|
|
1660
|
+
height: "1em",
|
|
1661
|
+
...props,
|
|
1662
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
1663
|
+
d: "M874.2 459.2l12.9 8.1c26.4 16.6 34.4 51.4 17.8 77.9-4.5 7.1-10.5 13.2-17.8 17.8l-345 216.5c-18.4 11.5-41.7 11.5-60 0L136.8 562.4c-26.4-16.6-34.4-51.4-17.8-77.9 4.5-7.1 10.5-13.2 17.8-17.8l12.9-8.1 332.4 209c18.4 11.5 41.7 11.5 60 0l332.1-208.5v0.1z m0 166l12.9 8.1c26.4 16.6 34.4 51.4 17.8 77.9-4.5 7.1-10.5 13.2-17.8 17.8l-345 216.6c-18.4 11.5-41.7 11.5-60 0L136.8 728.5c-26.4-16.6-34.4-51.4-17.8-77.9 4.5-7.1 10.5-13.2 17.8-17.8l12.9-8.1 332.3 209c18.4 11.5 41.7 11.5 60 0l332.1-208.5h0.1zM541.7 80l345.2 217.1c26.4 16.6 34.4 51.4 17.8 77.9-4.5 7.1-10.5 13.2-17.8 17.8L542.1 609.2c-18.4 11.5-41.7 11.5-60 0L136.8 392.1c-26.4-16.6-34.4-51.4-17.8-77.9 4.5-7.1 10.5-13.2 17.8-17.8l345-216.7c18.4-11.5 41.7-11.5 60 0l-0.1 0.3z"
|
|
1664
|
+
})
|
|
1665
|
+
});
|
|
1666
|
+
const Mode = SvgMode;
|
|
1667
|
+
const SvgOriginPosition = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
1668
|
+
className: "icon",
|
|
1669
|
+
viewBox: "0 0 1024 1024",
|
|
1670
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1671
|
+
width: "1em",
|
|
1672
|
+
height: "1em",
|
|
1673
|
+
...props,
|
|
1674
|
+
children: [
|
|
1675
|
+
/*#__PURE__*/ jsx("path", {
|
|
1676
|
+
d: "M512 415.185455c-53.527273 0-96.814545 43.287273-96.814545 96.814545s43.287273 96.814545 96.814545 96.814545 96.814545-43.287273 96.814545-96.814545-43.287273-96.814545-96.814545-96.814545z"
|
|
1677
|
+
}),
|
|
1678
|
+
/*#__PURE__*/ jsx("path", {
|
|
1679
|
+
d: "M936.96 480.349091h-59.578182c-14.894545-177.803636-156.392727-318.836364-334.196363-334.196364V87.04c0-17.221818-13.963636-31.650909-31.65091-31.650909s-31.185455 13.963636-31.185454 31.650909v59.578182c-177.803636 14.894545-318.836364 156.392727-334.196364 334.196363H87.04c-17.221818 0-31.650909 13.963636-31.650909 31.185455s13.963636 31.650909 31.650909 31.650909h59.578182c14.894545 177.803636 156.392727 318.836364 334.196363 334.196364v59.578182c0 17.221818 13.963636 31.185455 31.185455 31.185454s31.650909-13.963636 31.650909-31.185454v-59.578182c177.803636-14.894545 318.836364-156.392727 334.196364-334.196364h59.578182c17.221818 0 31.185455-13.963636 31.185454-31.650909s-13.963636-31.185455-31.185454-31.185455z m-393.774545 334.196364v-39.098182c0-17.221818-13.963636-31.185455-31.65091-31.185455s-31.185455 13.963636-31.185454 31.185455v39.098182a305.152 305.152 0 0 1-271.36-271.36h39.098182c17.221818 0 31.650909-13.963636 31.650909-31.65091s-13.963636-31.185455-31.650909-31.185454h-39.098182a305.152 305.152 0 0 1 271.36-271.36v39.098182c0 17.221818 13.963636 31.650909 31.185454 31.650909s31.650909-13.963636 31.65091-31.650909v-39.098182c142.894545 14.894545 256.465455 128.465455 271.36 271.36h-39.098182c-17.221818 0-31.185455 13.963636-31.185455 31.185454s13.963636 31.650909 31.185455 31.65091h39.098182a305.152 305.152 0 0 1-271.36 271.36z"
|
|
1680
|
+
})
|
|
1681
|
+
]
|
|
1682
|
+
});
|
|
1683
|
+
const OriginPosition = SvgOriginPosition;
|
|
1684
|
+
const SvgPoint = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
1685
|
+
className: "icon",
|
|
1686
|
+
viewBox: "0 0 1024 1024",
|
|
1687
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1688
|
+
width: "1em",
|
|
1689
|
+
height: "1em",
|
|
1690
|
+
...props,
|
|
1691
|
+
children: [
|
|
1692
|
+
/*#__PURE__*/ jsx("path", {
|
|
1693
|
+
d: "M512 1024c-281.6 0-512-230.4-512-512s230.4-512 512-512 512 230.4 512 512-230.4 512-512 512zM512 38.4C249.6 38.4 38.4 249.6 38.4 512c0 262.4 211.2 473.6 473.6 473.6s473.6-211.2 473.6-473.6C985.6 249.6 774.4 38.4 512 38.4z"
|
|
1694
|
+
}),
|
|
1695
|
+
/*#__PURE__*/ jsx("path", {
|
|
1696
|
+
d: "M512 262.4c134.4 0 249.6 108.8 249.6 249.6s-108.8 249.6-249.6 249.6c-134.4 0-249.6-108.8-249.6-249.6S377.6 262.4 512 262.4z"
|
|
1697
|
+
})
|
|
1698
|
+
]
|
|
1699
|
+
});
|
|
1700
|
+
const Point = SvgPoint;
|
|
1701
|
+
const SvgPointerSelect = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
1702
|
+
className: "icon",
|
|
1703
|
+
viewBox: "0 0 1024 1024",
|
|
1704
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1705
|
+
width: "1em",
|
|
1706
|
+
height: "1em",
|
|
1707
|
+
...props,
|
|
1708
|
+
children: [
|
|
1709
|
+
/*#__PURE__*/ jsx("path", {
|
|
1710
|
+
d: "M430.933333 896c-17.066667 0-34.133333-8.533333-38.4-25.6l-302.933333-725.333333c-8.533333-17.066667-4.266667-34.133333 8.533333-46.933334 12.8-12.8 29.866667-17.066667 46.933334-8.533333l725.333333 302.933333c17.066667 8.533333 25.6 21.333333 25.6 42.666667 0 17.066667-12.8 34.133333-29.866667 38.4l-294.4 102.4-102.4 290.133333c-4.266667 17.066667-21.333333 29.866667-38.4 29.866667zM209.066667 209.066667L426.666667 729.6l72.533333-209.066667c4.266667-12.8 12.8-21.333333 25.6-25.6l209.066667-72.533333-524.8-213.333333z"
|
|
1711
|
+
}),
|
|
1712
|
+
/*#__PURE__*/ jsx("path", {
|
|
1713
|
+
d: "M810.666667 853.333333c-12.8 0-21.333333-4.266667-29.866667-12.8l-256-256c-17.066667-17.066667-17.066667-42.666667 0-59.733333s42.666667-17.066667 59.733333 0l256 256c17.066667 17.066667 17.066667 42.666667 0 59.733333-8.533333 8.533333-17.066667 12.8-29.866666 12.8z"
|
|
1714
|
+
})
|
|
1715
|
+
]
|
|
1716
|
+
});
|
|
1717
|
+
const PointerSelect = SvgPointerSelect;
|
|
1718
|
+
const SvgReceiver = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
1719
|
+
className: "icon",
|
|
1720
|
+
viewBox: "0 0 1024 1024",
|
|
1721
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1722
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
1723
|
+
width: "1em",
|
|
1724
|
+
height: "1em",
|
|
1725
|
+
...props,
|
|
1726
|
+
children: [
|
|
1727
|
+
/*#__PURE__*/ jsx("path", {
|
|
1728
|
+
d: "M768 256c0-140.8-115.2-256-256-256S256 115.2 256 256c0 128 94.4 230.4 212.8 251.2v473.6c0 25.6 17.6 43.2 43.2 43.2s43.2-17.6 43.2-43.2V507.2C673.6 486.4 768 384 768 256zM512 427.2c-94.4 0-171.2-76.8-171.2-171.2S417.6 84.8 512 84.8 683.2 161.6 683.2 256 606.4 427.2 512 427.2z"
|
|
1729
|
+
}),
|
|
1730
|
+
/*#__PURE__*/ jsx("path", {
|
|
1731
|
+
d: "M555.2 171.2c-25.6 0-43.2 17.6-43.2 43.2s17.6 43.2 43.2 43.2 43.2-17.6 43.2-43.2-17.6-43.2-43.2-43.2z"
|
|
1732
|
+
})
|
|
1733
|
+
]
|
|
1734
|
+
});
|
|
1735
|
+
const Receiver = SvgReceiver;
|
|
1736
|
+
const SvgRectangleSelect = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
1737
|
+
className: "icon",
|
|
1738
|
+
viewBox: "0 0 1024 1024",
|
|
1739
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1740
|
+
width: "1em",
|
|
1741
|
+
height: "1em",
|
|
1742
|
+
...props,
|
|
1743
|
+
children: [
|
|
1744
|
+
/*#__PURE__*/ jsx("path", {
|
|
1745
|
+
d: "M822.30573588 173.43397564a28.21013624 28.21013624 0 1 1-28.22945122 28.21013546 28.21979373 28.21979373 0 0 1 28.21979372-28.21013546zM201.6441111 850.84423398a28.21013624 28.21013624 0 1 1 28.21013623-28.21013623 28.21979373 28.21979373 0 0 1-28.21013623 28.21013623zM201.6441111 229.85424733a28.21013624 28.21013624 0 1 1 28.21013623-28.21979372 28.21013624 28.21013624 0 0 1-28.21013623 28.21979372z"
|
|
1746
|
+
}),
|
|
1747
|
+
/*#__PURE__*/ jsx("path", {
|
|
1748
|
+
d: "M850.86354898 742.96774623V281.70642851a84.6400662 84.6400662 0 1 0-107.90546025-108.26279538H281.69677102A84.98774304 84.98774304 0 0 0 192.1216209 117.02336067 83.92539593 83.92539593 0 0 0 117.01370318 192.13127917a84.98774304 84.98774304 0 0 0 56.42027246 89.57514935v461.2613177a84.70767023 84.70767023 0 1 0 108.26279538 107.87648776h461.26131771a84.6400662 84.6400662 0 1 0 107.90546025-107.87648775z m-56.42027169 0a84.63040793 84.63040793 0 0 0-51.48518856 51.48518855v-0.35733513H281.69677102a84.29238856 84.29238856 0 0 0-51.83286542-51.13751092v-461.63796784a85.33541991 85.33541991 0 0 0 51.83286542-51.46587356h461.26131771a85.34507818 85.34507818 0 0 0 51.48518855 51.84252369z"
|
|
1749
|
+
}),
|
|
1750
|
+
/*#__PURE__*/ jsx("path", {
|
|
1751
|
+
d: "M822.30573588 850.84423398a28.21013624 28.21013624 0 1 1 28.21013624-28.21013623 28.21013624 28.21013624 0 0 1-28.21013624 28.21013623z"
|
|
1752
|
+
})
|
|
1753
|
+
]
|
|
1754
|
+
});
|
|
1755
|
+
const RectangleSelect = SvgRectangleSelect;
|
|
1756
|
+
const SvgSatellite = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
1757
|
+
className: "icon",
|
|
1758
|
+
viewBox: "0 0 1024 1024",
|
|
1759
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1760
|
+
width: "1em",
|
|
1761
|
+
height: "1em",
|
|
1762
|
+
...props,
|
|
1763
|
+
children: [
|
|
1764
|
+
/*#__PURE__*/ jsx("path", {
|
|
1765
|
+
d: "M399.181913 81.16313a33.391304 33.391304 0 0 1-21.860174 41.850435 409.6 409.6 0 0 0-88.865391 40.069565c17.363478 9.794783 32.144696 24.531478 41.939478 44.121044 17.14087 34.326261 28.538435 71.68 31.744 106.496 3.116522 33.792-1.068522 70.344348-21.548522 97.680696-9.171478 12.198957-18.788174 20.168348-33.213217 32.055652l-2.31513 1.958956c-15.62713 12.911304-40.069565 33.124174-81.830957 70.656a147.144348 147.144348 0 0 1-7.123478 8.859826l-3.205565 3.739826a168.247652 168.247652 0 0 0-3.962435 4.58574 21.860174 21.860174 0 0 0-5.12 8.681739c-0.311652 1.068522-1.335652 5.12 10.996869 20.658087 3.606261 4.585739 6.767304 8.281043 10.373566 12.466087 2.938435 3.428174 6.188522 7.212522 10.195478 12.020869 7.346087 8.904348 15.404522 19.411478 22.260869 31.387826 36.730435 53.604174 45.412174 128.934957 35.884522 191.577044-2.671304 20.034783-11.709217 35.706435-24.264348 46.569739 39.223652 26.713043 83.255652 46.83687 130.582261 58.768696a366.413913 366.413913 0 0 1 22.528-148.079305c19.055304-49.864348 51.2-95.49913 98.482087-120.520348l0.356174-0.178087 0.311652-0.178087c28.538435-14.246957 81.252174-36.151652 141.133913-25.243826l0.578783 0.089044c41.449739 8.325565 65.536 26.935652 83.834435 42.162087l1.647304 1.380174c16.829217 14.06887 24.576 20.48 38.15513 23.062261 14.692174 2.092522 31.744-4.051478 53.960348-22.349913 18.209391-14.959304 35.305739-34.05913 53.604174-54.494609l9.616696-10.685218A413.606957 413.606957 0 0 0 912.695652 516.006957a33.391304 33.391304 0 0 1 66.782609 0c0 264.325565-214.28313 478.608696-478.608696 478.608695S22.26087 780.332522 22.26087 516.006957v-4.452174c0-124.972522 52.713739-244.335304 133.787826-330.128696l0.311652-0.356174 0.356174-0.311652a107.297391 107.297391 0 0 1 16.205913-13.356522 478.297043 478.297043 0 0 1 184.364522-108.098782 33.391304 33.391304 0 0 1 41.850434 21.815652z m-185.210435 139.397566A410.624 410.624 0 0 0 89.043478 513.825391c0.578783 114.777043 45.857391 216.731826 119.318261 290.192696 4.36313 4.36313 9.349565 4.986435 13.089391 3.873391a8.815304 8.815304 0 0 0 4.140522-2.493217 7.212522 7.212522 0 0 0 1.736348-4.140522l0.044522-0.445217 0.089043-0.489739c8.058435-52.49113-0.845913-109.701565-25.510956-144.962783l-1.024-1.424696-0.845913-1.513739a155.737043 155.737043 0 0 0-16.250435-22.884174l-7.791304-9.260521c-4.630261-5.431652-9.750261-11.397565-13.534609-16.205913-13.178435-16.562087-32.144696-43.76487-23.507478-78.358261 3.962435-15.716174 11.798261-26.846609 18.253913-34.726957 3.561739-4.318609 5.787826-6.90087 7.568695-8.904348 2.226087-2.493217 3.606261-4.006957 5.520696-6.856348l2.31513-3.517217 3.116522-2.804869c44.521739-40.069565 70.433391-61.484522 86.817391-75.019131l0.48974-0.445217c16.918261-13.979826 20.257391-17.007304 24.08626-22.127305 6.233043-8.281043 10.907826-25.154783 8.459131-51.46713-2.31513-25.377391-10.952348-54.761739-24.932174-82.765913-9.839304-19.589565-36.507826-27.158261-56.765217-16.473044z m562.309565 533.236869l-0.445217-0.044522-0.445217-0.089043c-31.833043-5.787826-52.313043-23.106783-67.227826-35.706435l-3.82887-3.205565c-15.048348-12.55513-28.761043-22.839652-53.871304-27.91513-37.843478-6.767304-73.906087 6.767304-98.704696 19.144347-28.271304 15.137391-51.645217 45.056-67.005217 85.170087a300.655304 300.655304 0 0 0-17.408 131.428174l0.044521 0.801392h33.480348a408.665043 408.665043 0 0 0 339.344696-178.888348c-19.144348 8.45913-40.514783 12.911304-63.933218 9.349565z"
|
|
1766
|
+
}),
|
|
1767
|
+
/*#__PURE__*/ jsx("path", {
|
|
1768
|
+
d: "M900.585739 172.29913C877.968696 74.930087 793.288348 27.648 712.481391 27.648c-2.404174 0-4.763826 0.044522-7.123478 0.133565-78.625391 2.671304-159.076174 49.997913-180.98087 144.428522-25.956174 111.526957 45.278609 202.128696 98.125914 252.215652l0.089043 0.044522a130.671304 130.671304 0 0 0 179.867826-0.089044c53.069913-50.309565 123.369739-140.688696 98.170435-251.993043l-0.044522-0.178087z m-188.104348-77.824c56.364522 0 108.855652 31.877565 123.013566 92.783305 16.873739 74.529391-29.384348 141.757217-78.981566 188.727652l-0.133565 0.089043a63.888696 63.888696 0 0 1-87.974956-0.133565c-49.730783-47.148522-96.256-114.287304-78.981566-188.594087 14.157913-60.994783 66.649043-92.872348 123.058087-92.872348z"
|
|
1769
|
+
}),
|
|
1770
|
+
/*#__PURE__*/ jsx("path", {
|
|
1771
|
+
d: "M644.318609 218.690783a66.782609 66.782609 0 0 0 66.782608 66.782608h0.445218a66.782609 66.782609 0 1 0 0-133.565217h-0.445218a66.782609 66.782609 0 0 0-66.782608 66.782609z"
|
|
1772
|
+
})
|
|
1773
|
+
]
|
|
1774
|
+
});
|
|
1775
|
+
const Satellite = SvgSatellite;
|
|
1776
|
+
const SvgSelectTool = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
1777
|
+
className: "icon",
|
|
1778
|
+
viewBox: "0 0 1024 1024",
|
|
1779
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1780
|
+
width: "1em",
|
|
1781
|
+
height: "1em",
|
|
1782
|
+
...props,
|
|
1783
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
1784
|
+
d: "M520.396 523.196l436.635 195.926-156.74 78.37-78.37 156.74-201.525-431.036z m330.276-397.449v111.958h-55.979V125.747H682.735V69.768h167.937v55.979zM122.947 797.492h111.958v55.979H66.968V685.534h55.979v111.958z m0-671.745v111.958H66.968V69.768h167.937v55.979H122.947z m223.915-55.979h223.915v55.979H346.862V69.768z m0 727.724h223.915v55.979H346.862v-55.979zM66.968 349.662h55.979v223.916H66.968V349.662z m727.724 0h55.979v223.916h-55.979V349.662z"
|
|
1785
|
+
})
|
|
1786
|
+
});
|
|
1787
|
+
const SelectTool = SvgSelectTool;
|
|
1788
|
+
const SvgStreets = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
1789
|
+
className: "icon",
|
|
1790
|
+
viewBox: "0 0 1024 1024",
|
|
1791
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1792
|
+
width: "1em",
|
|
1793
|
+
height: "1em",
|
|
1794
|
+
...props,
|
|
1795
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
1796
|
+
d: "M988.31 593.016H853.987a146.673 146.673 0 0 0-123.784-120.47v-291.84h258.109a30.118 30.118 0 0 0 0-60.235H730.202V30.118a30.118 30.118 0 0 0-60.235 0v90.353H519.38L402.22 208.414H40.81a30.118 30.118 0 0 0 0 60.235h152.998v324.367H35.69a30.118 30.118 0 0 0 0 60.236h158.118v340.63a30.118 30.118 0 0 0 60.235 0v-340.63h313.224A147.576 147.576 0 0 0 669.967 757.76v236.122a30.118 30.118 0 0 0 60.235 0V761.374a146.372 146.372 0 0 0 120.47-108.122h137.036a30.118 30.118 0 0 0 0-60.236z m-423.755 0H254.042V268.65H422.1l117.76-87.943h130.108v293.346a146.673 146.673 0 0 0-105.412 118.964zM709.12 703.247a87.04 87.04 0 1 1 87.04-86.739 86.739 86.739 0 0 1-87.04 86.74z"
|
|
1797
|
+
})
|
|
1798
|
+
});
|
|
1799
|
+
const Streets = SvgStreets;
|
|
1800
|
+
const DefaultMarkerChild = (props)=>{
|
|
1801
|
+
const { mapless, marker, onChange } = props;
|
|
1802
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
1803
|
+
style: {
|
|
1804
|
+
display: 'flex',
|
|
1805
|
+
alignItems: 'center'
|
|
1806
|
+
},
|
|
1807
|
+
children: [
|
|
1808
|
+
/*#__PURE__*/ jsx(Input, {
|
|
1809
|
+
style: {
|
|
1810
|
+
width: 100,
|
|
1811
|
+
marginRight: 4
|
|
1812
|
+
},
|
|
1813
|
+
size: "small",
|
|
1814
|
+
onChange: (e)=>{
|
|
1815
|
+
onChange({
|
|
1816
|
+
remark: e.target.value
|
|
1817
|
+
});
|
|
1818
|
+
}
|
|
1819
|
+
}),
|
|
1820
|
+
/*#__PURE__*/ jsx(Button, {
|
|
1821
|
+
icon: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
1822
|
+
component: Copy
|
|
1823
|
+
}),
|
|
1824
|
+
size: "small",
|
|
1825
|
+
onClick: ()=>{
|
|
1826
|
+
const fix = mapless?.coordTrans('tileToData', [
|
|
1827
|
+
marker.lngLat.lng,
|
|
1828
|
+
marker.lngLat.lat
|
|
1829
|
+
]);
|
|
1830
|
+
const fixLnglat = new LngLat(fix[0], fix[1]);
|
|
1831
|
+
let coordText = `经度: ${fixLnglat.lng.toFixed(6)}, 纬度: ${fixLnglat.lat.toFixed(6)}`;
|
|
1832
|
+
const remark = marker.remark || '';
|
|
1833
|
+
if (remark) coordText += `, 备注: ${remark}`;
|
|
1834
|
+
navigator.clipboard.writeText(coordText).then(()=>{
|
|
1835
|
+
message.info(`坐标已复制: ${coordText}`);
|
|
1836
|
+
}).catch(()=>{
|
|
1837
|
+
message.info(`坐标获取成功: ${coordText}`);
|
|
1838
|
+
});
|
|
1839
|
+
}
|
|
1840
|
+
})
|
|
1841
|
+
]
|
|
1842
|
+
});
|
|
1843
|
+
};
|
|
1844
|
+
const DraggableMarker_DefaultMarkerChild = DefaultMarkerChild;
|
|
1845
|
+
const getMarkerLngLat = (marker)=>{
|
|
1846
|
+
const item = marker;
|
|
1847
|
+
if (item.lngLat) return item.lngLat;
|
|
1848
|
+
return new LngLat(0, 0);
|
|
1849
|
+
};
|
|
1850
|
+
const getMarkerName = (marker)=>{
|
|
1851
|
+
const item = marker;
|
|
1852
|
+
return item.label || '';
|
|
1853
|
+
};
|
|
1854
|
+
const getMarkerId = (marker)=>{
|
|
1855
|
+
const item = marker;
|
|
1856
|
+
return item.id || '';
|
|
1857
|
+
};
|
|
1858
|
+
const DraggableMarkerGroup = ({ mapless, markers, showDefaultPopup = true, showMarkerPopup = true, baseIconType = 'marker', onChange, onMarkersChange })=>{
|
|
1859
|
+
const { prevCoordSystem, coordSystem } = hooks_useCoordSystem(mapless);
|
|
1860
|
+
useEffect(()=>{
|
|
1861
|
+
if (mapless && prevCoordSystem && coordSystem && prevCoordSystem !== coordSystem && markers) onMarkersChange?.(markers?.map((mkr)=>{
|
|
1862
|
+
const pos = [
|
|
1863
|
+
mkr.lngLat.lng,
|
|
1864
|
+
mkr.lngLat.lat
|
|
1865
|
+
];
|
|
1866
|
+
const coord = QuickTrans(prevCoordSystem, coordSystem, pos);
|
|
1867
|
+
return {
|
|
1868
|
+
...mkr,
|
|
1869
|
+
lngLat: new LngLat(coord[0], coord[1])
|
|
1870
|
+
};
|
|
1871
|
+
}) || []);
|
|
1872
|
+
}, [
|
|
1873
|
+
prevCoordSystem,
|
|
1874
|
+
coordSystem
|
|
1875
|
+
]);
|
|
1876
|
+
return /*#__PURE__*/ jsx(Fragment, {
|
|
1877
|
+
children: markers?.map((m)=>/*#__PURE__*/ jsx(DraggableMarker_DraggableMarker, {
|
|
1878
|
+
mapless: mapless,
|
|
1879
|
+
lngLat: getMarkerLngLat(m),
|
|
1880
|
+
anchor: "bottom",
|
|
1881
|
+
iconType: baseIconType,
|
|
1882
|
+
showPopup: showMarkerPopup,
|
|
1883
|
+
onChange: (lngLat)=>{
|
|
1884
|
+
onChange?.(getMarkerId(m), {
|
|
1885
|
+
lngLat
|
|
1886
|
+
});
|
|
1887
|
+
},
|
|
1888
|
+
name: getMarkerName(m),
|
|
1889
|
+
children: showDefaultPopup && /*#__PURE__*/ jsx(DraggableMarker_DefaultMarkerChild, {
|
|
1890
|
+
marker: m,
|
|
1891
|
+
mapless: mapless,
|
|
1892
|
+
onChange: (update)=>{
|
|
1893
|
+
onChange?.(getMarkerId(m), update);
|
|
1894
|
+
}
|
|
1895
|
+
})
|
|
1896
|
+
}, getMarkerId(m)))
|
|
1897
|
+
});
|
|
1898
|
+
};
|
|
1899
|
+
const Group = DraggableMarkerGroup;
|
|
1900
|
+
const DraggableMarker_index_module = {
|
|
1901
|
+
"react-marker": "react-marker-crXza6",
|
|
1902
|
+
reactMarker: "react-marker-crXza6",
|
|
1903
|
+
"react-popup": "react-popup-DC9gvk",
|
|
1904
|
+
reactPopup: "react-popup-DC9gvk",
|
|
1905
|
+
content: "content-lMdbtX",
|
|
1906
|
+
icon: "icon-R2hd2X",
|
|
1907
|
+
tooltip: "tooltip-xHAtcl"
|
|
1908
|
+
};
|
|
1909
|
+
const DraggableMarker = ({ mapless, lngLat, children, className, anchor, name, iconType = 'marker', showPopup = true, onChange })=>{
|
|
1910
|
+
const markerRef = useRef(void 0);
|
|
1911
|
+
const markerNodeRef = useRef(document.createElement('div'));
|
|
1912
|
+
const popupNodeRef = useRef(document.createElement('div'));
|
|
1913
|
+
const [position, setPosition] = useState(lngLat);
|
|
1914
|
+
const fixPosition = useMemo(()=>position ? mapless?.coordTrans('tileToData', [
|
|
1915
|
+
position.lng,
|
|
1916
|
+
position.lat
|
|
1917
|
+
]) : null, [
|
|
1918
|
+
position,
|
|
1919
|
+
mapless
|
|
1920
|
+
]);
|
|
1921
|
+
useEffect(()=>{
|
|
1922
|
+
const { map } = mapless || {};
|
|
1923
|
+
if (!map) return;
|
|
1924
|
+
markerRef.current?.remove();
|
|
1925
|
+
markerRef.current = new Marker({
|
|
1926
|
+
element: markerNodeRef.current,
|
|
1927
|
+
className: `${DraggableMarker_index_module["react-marker"]} ${className}`,
|
|
1928
|
+
anchor: anchor || 'center',
|
|
1929
|
+
draggable: true
|
|
1930
|
+
}).setLngLat(lngLat).addTo(map);
|
|
1931
|
+
if (showPopup) markerRef.current?.setPopup(new Popup({
|
|
1932
|
+
closeOnMove: false,
|
|
1933
|
+
closeOnClick: false,
|
|
1934
|
+
className: DraggableMarker_index_module["react-popup"],
|
|
1935
|
+
focusAfterOpen: false,
|
|
1936
|
+
anchor: 'top'
|
|
1937
|
+
}).setLngLat(lngLat).setDOMContent(popupNodeRef.current));
|
|
1938
|
+
else markerRef.current?.setPopup(null);
|
|
1939
|
+
markerRef.current.on('dragend', ()=>{
|
|
1940
|
+
setPosition(markerRef.current?.getLngLat() || lngLat);
|
|
1941
|
+
onChange?.(markerRef.current?.getLngLat() || lngLat);
|
|
1942
|
+
});
|
|
1943
|
+
}, [
|
|
1944
|
+
mapless,
|
|
1945
|
+
JSON.stringify(lngLat),
|
|
1946
|
+
showPopup
|
|
1947
|
+
]);
|
|
1948
|
+
useEffect(()=>()=>{
|
|
1949
|
+
markerRef.current?.remove();
|
|
1950
|
+
markerRef.current = void 0;
|
|
1951
|
+
}, []);
|
|
1952
|
+
const selectedIcon = 'receiver' === iconType ? Receiver : generated_Marker;
|
|
1953
|
+
const renderMarkerContent = ()=>/*#__PURE__*/ jsxs(Tooltip, {
|
|
1954
|
+
rootClassName: DraggableMarker_index_module.tooltip,
|
|
1955
|
+
title: /*#__PURE__*/ jsxs("div", {
|
|
1956
|
+
style: {
|
|
1957
|
+
fontSize: 10
|
|
1958
|
+
},
|
|
1959
|
+
children: [
|
|
1960
|
+
/*#__PURE__*/ jsxs("div", {
|
|
1961
|
+
style: {
|
|
1962
|
+
width: '100%',
|
|
1963
|
+
lineHeight: '12px'
|
|
1964
|
+
},
|
|
1965
|
+
children: [
|
|
1966
|
+
"经度:",
|
|
1967
|
+
fixPosition?.[0].toFixed(6)
|
|
1968
|
+
]
|
|
1969
|
+
}),
|
|
1970
|
+
/*#__PURE__*/ jsxs("div", {
|
|
1971
|
+
style: {
|
|
1972
|
+
width: '100%',
|
|
1973
|
+
lineHeight: '12px',
|
|
1974
|
+
marginBottom: 4
|
|
1975
|
+
},
|
|
1976
|
+
children: [
|
|
1977
|
+
"纬度:",
|
|
1978
|
+
fixPosition?.[1].toFixed(6)
|
|
1979
|
+
]
|
|
1980
|
+
})
|
|
1981
|
+
]
|
|
1982
|
+
}),
|
|
1983
|
+
children: [
|
|
1984
|
+
name && /*#__PURE__*/ jsx("div", {
|
|
1985
|
+
style: {
|
|
1986
|
+
position: 'absolute',
|
|
1987
|
+
top: '100%',
|
|
1988
|
+
left: '50%',
|
|
1989
|
+
transform: 'translate(-50%,0)',
|
|
1990
|
+
width: '60px',
|
|
1991
|
+
textAlign: 'center'
|
|
1992
|
+
},
|
|
1993
|
+
children: name
|
|
1994
|
+
}),
|
|
1995
|
+
/*#__PURE__*/ jsx(_ant_design_icons, {
|
|
1996
|
+
component: selectedIcon,
|
|
1997
|
+
className: DraggableMarker_index_module.icon
|
|
1998
|
+
})
|
|
1999
|
+
]
|
|
2000
|
+
});
|
|
2001
|
+
const renderPopupContent = ()=>/*#__PURE__*/ jsxs("div", {
|
|
2002
|
+
className: DraggableMarker_index_module.content,
|
|
2003
|
+
children: [
|
|
2004
|
+
/*#__PURE__*/ jsxs("div", {
|
|
2005
|
+
style: {
|
|
2006
|
+
width: '100%',
|
|
2007
|
+
lineHeight: '12px'
|
|
2008
|
+
},
|
|
2009
|
+
children: [
|
|
2010
|
+
"经度:",
|
|
2011
|
+
fixPosition?.[0].toFixed(6)
|
|
2012
|
+
]
|
|
2013
|
+
}),
|
|
2014
|
+
/*#__PURE__*/ jsxs("div", {
|
|
2015
|
+
style: {
|
|
2016
|
+
width: '100%',
|
|
2017
|
+
lineHeight: '12px',
|
|
2018
|
+
marginBottom: 4
|
|
2019
|
+
},
|
|
2020
|
+
children: [
|
|
2021
|
+
"纬度:",
|
|
2022
|
+
fixPosition?.[1].toFixed(6)
|
|
2023
|
+
]
|
|
2024
|
+
}),
|
|
2025
|
+
children
|
|
2026
|
+
]
|
|
2027
|
+
});
|
|
2028
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
2029
|
+
children: [
|
|
2030
|
+
/*#__PURE__*/ jsx(components_ErrorBoundary, {
|
|
2031
|
+
message: "DraggableMarker 1",
|
|
2032
|
+
children: /*#__PURE__*/ createPortal(renderMarkerContent(), markerNodeRef.current)
|
|
2033
|
+
}),
|
|
2034
|
+
showPopup && /*#__PURE__*/ jsx(components_ErrorBoundary, {
|
|
2035
|
+
message: "DraggableMarker 2",
|
|
2036
|
+
children: /*#__PURE__*/ createPortal(renderPopupContent(), popupNodeRef.current)
|
|
2037
|
+
})
|
|
2038
|
+
]
|
|
2039
|
+
});
|
|
2040
|
+
};
|
|
2041
|
+
DraggableMarker.Group = Group;
|
|
2042
|
+
const DraggableMarker_DraggableMarker = DraggableMarker;
|
|
2043
|
+
const Float_index_module = {
|
|
2044
|
+
root: "root-ChMEHr",
|
|
2045
|
+
dragging: "dragging-cy5jRW",
|
|
2046
|
+
title: "title-Ikuh0j",
|
|
2047
|
+
close: "close-og7mQm"
|
|
2048
|
+
};
|
|
2049
|
+
const Float = (props)=>{
|
|
2050
|
+
const { title, open, children, onCancel } = props;
|
|
2051
|
+
const [position, setPosition] = useState({
|
|
2052
|
+
top: '10px',
|
|
2053
|
+
right: '400px'
|
|
2054
|
+
});
|
|
2055
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
2056
|
+
const [offset, setOffset] = useState({
|
|
2057
|
+
x: 0,
|
|
2058
|
+
y: 0
|
|
2059
|
+
});
|
|
2060
|
+
const [_hasMoved, setHasMoved] = useState(false);
|
|
2061
|
+
const containerRef = useRef(null);
|
|
2062
|
+
const handleMouseDown = (e)=>{
|
|
2063
|
+
e.preventDefault();
|
|
2064
|
+
setHasMoved(false);
|
|
2065
|
+
if (containerRef.current) {
|
|
2066
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
2067
|
+
setOffset({
|
|
2068
|
+
x: e.clientX - rect.left,
|
|
2069
|
+
y: e.clientY - rect.top
|
|
2070
|
+
});
|
|
2071
|
+
setIsDragging(true);
|
|
2072
|
+
}
|
|
2073
|
+
};
|
|
2074
|
+
const handleMouseMove = useCallback((e)=>{
|
|
2075
|
+
if (!isDragging || !containerRef.current) return;
|
|
2076
|
+
const windowWidth = window.innerWidth;
|
|
2077
|
+
const windowHeight = window.innerHeight;
|
|
2078
|
+
const containerWidth = containerRef.current.offsetWidth;
|
|
2079
|
+
const containerHeight = containerRef.current.offsetHeight;
|
|
2080
|
+
let newLeft = e.clientX - offset.x;
|
|
2081
|
+
let newTop = e.clientY - offset.y;
|
|
2082
|
+
newLeft = Math.max(0, Math.min(windowWidth - containerWidth, newLeft));
|
|
2083
|
+
newTop = Math.max(0, Math.min(windowHeight - containerHeight, newTop));
|
|
2084
|
+
setPosition({
|
|
2085
|
+
top: `${newTop}px`,
|
|
2086
|
+
right: `${windowWidth - newLeft - containerWidth}px`
|
|
2087
|
+
});
|
|
2088
|
+
setHasMoved(true);
|
|
2089
|
+
}, [
|
|
2090
|
+
isDragging,
|
|
2091
|
+
offset
|
|
2092
|
+
]);
|
|
2093
|
+
const handleMouseUp = useCallback(()=>{
|
|
2094
|
+
setIsDragging(false);
|
|
2095
|
+
}, []);
|
|
2096
|
+
useEffect(()=>{
|
|
2097
|
+
if (isDragging) {
|
|
2098
|
+
document.addEventListener('mousemove', handleMouseMove);
|
|
2099
|
+
document.addEventListener('mouseup', handleMouseUp);
|
|
2100
|
+
return ()=>{
|
|
2101
|
+
document.removeEventListener('mousemove', handleMouseMove);
|
|
2102
|
+
document.removeEventListener('mouseup', handleMouseUp);
|
|
2103
|
+
};
|
|
2104
|
+
}
|
|
2105
|
+
}, [
|
|
2106
|
+
isDragging,
|
|
2107
|
+
handleMouseMove,
|
|
2108
|
+
handleMouseUp
|
|
2109
|
+
]);
|
|
2110
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
2111
|
+
ref: containerRef,
|
|
2112
|
+
className: `${Float_index_module.root} ${isDragging ? Float_index_module.dragging : ''}`,
|
|
2113
|
+
style: {
|
|
2114
|
+
top: position.top,
|
|
2115
|
+
right: position.right,
|
|
2116
|
+
display: open ? 'flex' : 'none'
|
|
2117
|
+
},
|
|
2118
|
+
children: [
|
|
2119
|
+
/*#__PURE__*/ jsxs(Flex, {
|
|
2120
|
+
className: Float_index_module.title,
|
|
2121
|
+
onMouseDown: handleMouseDown,
|
|
2122
|
+
align: "center",
|
|
2123
|
+
children: [
|
|
2124
|
+
/*#__PURE__*/ jsx("div", {
|
|
2125
|
+
style: {
|
|
2126
|
+
flex: 1
|
|
2127
|
+
},
|
|
2128
|
+
children: title
|
|
2129
|
+
}),
|
|
2130
|
+
/*#__PURE__*/ jsx(Button, {
|
|
2131
|
+
className: Float_index_module.close,
|
|
2132
|
+
type: "text",
|
|
2133
|
+
onClick: onCancel,
|
|
2134
|
+
icon: /*#__PURE__*/ jsx(CloseOutlined, {})
|
|
2135
|
+
})
|
|
2136
|
+
]
|
|
2137
|
+
}),
|
|
2138
|
+
children
|
|
2139
|
+
]
|
|
2140
|
+
});
|
|
2141
|
+
};
|
|
2142
|
+
const MapboxMarker_index_module = {
|
|
2143
|
+
"react-marker": "react-marker-DS7aRO",
|
|
2144
|
+
reactMarker: "react-marker-DS7aRO",
|
|
2145
|
+
transparent: "transparent-nNmBnZ"
|
|
2146
|
+
};
|
|
2147
|
+
const MapboxMarker_MapboxMarker = /*#__PURE__*/ forwardRef(({ maplessRef, lngLat, children, className, offset, offsetX, offsetY, anchor, transparent = false }, ref)=>{
|
|
2148
|
+
const markerRef = useRef(void 0);
|
|
2149
|
+
const markerNodeRef = useRef(document.createElement('div'));
|
|
2150
|
+
const [show, setShow] = useState(false);
|
|
2151
|
+
const oncedRef = useRef(false);
|
|
2152
|
+
const fixedLngLatRef = useRef(lngLat);
|
|
2153
|
+
const { coordSystem } = hooks_useCoordSystem(maplessRef?.current || void 0);
|
|
2154
|
+
useEffect(()=>{
|
|
2155
|
+
const pos = lngLat;
|
|
2156
|
+
fixedLngLatRef.current = maplessRef?.current?.coordTrans('dataToTile', pos);
|
|
2157
|
+
}, [
|
|
2158
|
+
coordSystem,
|
|
2159
|
+
lngLat,
|
|
2160
|
+
maplessRef?.current
|
|
2161
|
+
]);
|
|
2162
|
+
useImperativeHandle(ref, ()=>({
|
|
2163
|
+
show: ()=>setShow(true),
|
|
2164
|
+
showOnce: ()=>{
|
|
2165
|
+
if (!oncedRef.current) {
|
|
2166
|
+
oncedRef.current = true;
|
|
2167
|
+
setShow(true);
|
|
2168
|
+
}
|
|
2169
|
+
},
|
|
2170
|
+
hide: ()=>setShow(false)
|
|
2171
|
+
}), []);
|
|
2172
|
+
useEffect(()=>{
|
|
2173
|
+
const { map } = maplessRef?.current || {};
|
|
2174
|
+
if (!map) return;
|
|
2175
|
+
if (!fixedLngLatRef.current) return;
|
|
2176
|
+
const shouldCreateMarker = show && !markerRef.current;
|
|
2177
|
+
const shouldRemoveMarker = !show && markerRef.current;
|
|
2178
|
+
if (shouldCreateMarker) {
|
|
2179
|
+
const offsetXY = offset || [
|
|
2180
|
+
offsetX || 0,
|
|
2181
|
+
offsetY || 0
|
|
2182
|
+
];
|
|
2183
|
+
markerRef.current = new Marker({
|
|
2184
|
+
element: markerNodeRef.current,
|
|
2185
|
+
className: `${MapboxMarker_index_module["react-marker"]} ${className} ${transparent ? MapboxMarker_index_module.transparent : ''}`,
|
|
2186
|
+
offset: offsetXY,
|
|
2187
|
+
anchor: anchor || 'center'
|
|
2188
|
+
});
|
|
2189
|
+
markerRef.current.setLngLat(fixedLngLatRef.current);
|
|
2190
|
+
markerRef.current.addTo(map);
|
|
2191
|
+
} else if (shouldRemoveMarker) {
|
|
2192
|
+
markerRef.current?.remove();
|
|
2193
|
+
markerRef.current = void 0;
|
|
2194
|
+
}
|
|
2195
|
+
return ()=>{
|
|
2196
|
+
if (markerRef.current) {
|
|
2197
|
+
markerRef.current.remove();
|
|
2198
|
+
markerRef.current = void 0;
|
|
2199
|
+
}
|
|
2200
|
+
};
|
|
2201
|
+
}, [
|
|
2202
|
+
show,
|
|
2203
|
+
maplessRef?.current?.map,
|
|
2204
|
+
fixedLngLatRef.current
|
|
2205
|
+
]);
|
|
2206
|
+
useEffect(()=>{
|
|
2207
|
+
if (markerRef.current && fixedLngLatRef.current) try {
|
|
2208
|
+
const [prevLng, prevLat] = markerRef.current.getLngLat().toArray();
|
|
2209
|
+
const [newLng, newLat] = Array.isArray(fixedLngLatRef.current) ? fixedLngLatRef.current : fixedLngLatRef.current.toArray();
|
|
2210
|
+
if (prevLng !== newLng || prevLat !== newLat) markerRef.current.setLngLat([
|
|
2211
|
+
newLng,
|
|
2212
|
+
newLat
|
|
2213
|
+
]);
|
|
2214
|
+
} catch (_e) {
|
|
2215
|
+
markerRef.current.setLngLat(fixedLngLatRef.current);
|
|
2216
|
+
}
|
|
2217
|
+
}, [
|
|
2218
|
+
lngLat,
|
|
2219
|
+
coordSystem,
|
|
2220
|
+
maplessRef?.current
|
|
2221
|
+
]);
|
|
2222
|
+
useEffect(()=>{
|
|
2223
|
+
const offsetXY = offset || [
|
|
2224
|
+
offsetX || 0,
|
|
2225
|
+
offsetY || 0
|
|
2226
|
+
];
|
|
2227
|
+
markerRef.current?.setOffset(offsetXY);
|
|
2228
|
+
}, [
|
|
2229
|
+
offset,
|
|
2230
|
+
offsetX,
|
|
2231
|
+
offsetY
|
|
2232
|
+
]);
|
|
2233
|
+
return /*#__PURE__*/ jsx(components_ErrorBoundary, {
|
|
2234
|
+
message: "MapboxMarker",
|
|
2235
|
+
children: /*#__PURE__*/ createPortal(children, markerNodeRef.current)
|
|
2236
|
+
});
|
|
2237
|
+
});
|
|
2238
|
+
const components_MapboxMarker_MapboxMarker = /*#__PURE__*/ react.memo(MapboxMarker_MapboxMarker);
|
|
2239
|
+
const MapboxPopup_index_module = {
|
|
2240
|
+
"react-popup": "react-popup-FKu5Aa",
|
|
2241
|
+
reactPopup: "react-popup-FKu5Aa"
|
|
2242
|
+
};
|
|
2243
|
+
const MapboxPopup_MapboxPopup = /*#__PURE__*/ forwardRef(({ maplessRef, lngLat, children, onClose }, ref)=>{
|
|
2244
|
+
const popupRef = useRef(void 0);
|
|
2245
|
+
const popupNodeRef = useRef(document.createElement('div'));
|
|
2246
|
+
const [show, setShow] = useState(false);
|
|
2247
|
+
const fixedLngLatRef = useRef(lngLat);
|
|
2248
|
+
const { coordSystem } = hooks_useCoordSystem(maplessRef?.current || void 0);
|
|
2249
|
+
useEffect(()=>{
|
|
2250
|
+
const pos = lngLat;
|
|
2251
|
+
fixedLngLatRef.current = maplessRef?.current?.coordTrans('dataToTile', pos);
|
|
2252
|
+
}, [
|
|
2253
|
+
coordSystem,
|
|
2254
|
+
lngLat,
|
|
2255
|
+
maplessRef?.current
|
|
2256
|
+
]);
|
|
2257
|
+
useImperativeHandle(ref, ()=>({
|
|
2258
|
+
show: ()=>setShow(true),
|
|
2259
|
+
hide: ()=>setShow(false)
|
|
2260
|
+
}), []);
|
|
2261
|
+
const handlePopupClose = useCallback(()=>{
|
|
2262
|
+
setShow(false);
|
|
2263
|
+
onClose?.();
|
|
2264
|
+
}, [
|
|
2265
|
+
onClose
|
|
2266
|
+
]);
|
|
2267
|
+
useEffect(()=>{
|
|
2268
|
+
const { map } = maplessRef?.current || {};
|
|
2269
|
+
if (!map) return;
|
|
2270
|
+
popupRef.current?.remove();
|
|
2271
|
+
if (show) {
|
|
2272
|
+
if (!popupRef.current) {
|
|
2273
|
+
popupRef.current = new Popup({
|
|
2274
|
+
closeOnMove: false,
|
|
2275
|
+
closeOnClick: false,
|
|
2276
|
+
className: MapboxPopup_index_module["react-popup"],
|
|
2277
|
+
focusAfterOpen: false
|
|
2278
|
+
}).setLngLat(fixedLngLatRef.current).setDOMContent(popupNodeRef.current).addTo(map);
|
|
2279
|
+
popupRef.current.on('close', handlePopupClose);
|
|
2280
|
+
}
|
|
2281
|
+
popupRef.current.fire('open');
|
|
2282
|
+
} else popupRef.current?.fire('close');
|
|
2283
|
+
return ()=>{
|
|
2284
|
+
popupRef.current?.remove();
|
|
2285
|
+
popupRef.current = void 0;
|
|
2286
|
+
};
|
|
2287
|
+
}, [
|
|
2288
|
+
maplessRef?.current,
|
|
2289
|
+
show
|
|
2290
|
+
]);
|
|
2291
|
+
useEffect(()=>{
|
|
2292
|
+
if (popupRef.current) popupRef.current?.setLngLat(fixedLngLatRef.current);
|
|
2293
|
+
}, [
|
|
2294
|
+
JSON.stringify(lngLat),
|
|
2295
|
+
coordSystem
|
|
2296
|
+
]);
|
|
2297
|
+
return /*#__PURE__*/ jsx(components_ErrorBoundary, {
|
|
2298
|
+
message: "MapboxMarker",
|
|
2299
|
+
children: /*#__PURE__*/ createPortal(children, popupNodeRef.current)
|
|
2300
|
+
});
|
|
2301
|
+
});
|
|
2302
|
+
function isEqual(prev, next) {
|
|
2303
|
+
return JSON.stringify(prev.lngLat) === JSON.stringify(next.lngLat) && prev.children === next.children;
|
|
2304
|
+
}
|
|
2305
|
+
const components_MapboxPopup_MapboxPopup = /*#__PURE__*/ react.memo(MapboxPopup_MapboxPopup, isEqual);
|
|
2306
|
+
function StationMana({ id, stations }) {
|
|
2307
|
+
const { mapless, isMapReady } = useContext(MapContext);
|
|
2308
|
+
const managerRef = useRef(void 0);
|
|
2309
|
+
useEffect(()=>{
|
|
2310
|
+
if (!mapless || !isMapReady) return;
|
|
2311
|
+
const manager = core_attachOldStation(mapless, id);
|
|
2312
|
+
managerRef.current = manager;
|
|
2313
|
+
return ()=>{
|
|
2314
|
+
if (managerRef.current) detachOldStation(mapless, id);
|
|
2315
|
+
};
|
|
2316
|
+
}, [
|
|
2317
|
+
mapless,
|
|
2318
|
+
isMapReady,
|
|
2319
|
+
id
|
|
2320
|
+
]);
|
|
2321
|
+
useEffect(()=>{
|
|
2322
|
+
if (!mapless || !isMapReady || !managerRef.current) return;
|
|
2323
|
+
const manager = getOldStation(mapless, id);
|
|
2324
|
+
if (manager) manager.drawStations(stations || []);
|
|
2325
|
+
}, [
|
|
2326
|
+
mapless,
|
|
2327
|
+
isMapReady,
|
|
2328
|
+
id,
|
|
2329
|
+
stations
|
|
2330
|
+
]);
|
|
2331
|
+
return null;
|
|
2332
|
+
}
|
|
2333
|
+
const StationsClickPanel_index_module = {
|
|
2334
|
+
container: "container-FjpS8D",
|
|
2335
|
+
circle: "circle-rRbCX5",
|
|
2336
|
+
animate: "animate-Xpso91",
|
|
2337
|
+
closeBtn: "closeBtn-gjsiUj",
|
|
2338
|
+
stationItem: "stationItem-pt1U4a",
|
|
2339
|
+
name: "name-p9MbMw",
|
|
2340
|
+
selected: "selected-YeSjnT"
|
|
2341
|
+
};
|
|
2342
|
+
const StationsClickPanel_StationsClickPanel = (props)=>{
|
|
2343
|
+
const { stations, onSelected, onClose } = props;
|
|
2344
|
+
const [isAnimated, setIsAnimated] = useState(false);
|
|
2345
|
+
const [isClosing, setIsClosing] = useState(false);
|
|
2346
|
+
const containerSize = 300;
|
|
2347
|
+
const radius = 0.32 * containerSize;
|
|
2348
|
+
const center = {
|
|
2349
|
+
x: containerSize / 2,
|
|
2350
|
+
y: containerSize / 2
|
|
2351
|
+
};
|
|
2352
|
+
useEffect(()=>{
|
|
2353
|
+
if (stations && stations.length > 0 && !isAnimated && !isClosing) setTimeout(()=>{
|
|
2354
|
+
setIsAnimated(true);
|
|
2355
|
+
}, 5);
|
|
2356
|
+
}, [
|
|
2357
|
+
stations,
|
|
2358
|
+
isAnimated,
|
|
2359
|
+
isClosing
|
|
2360
|
+
]);
|
|
2361
|
+
const handleClose = ()=>{
|
|
2362
|
+
setIsClosing(true);
|
|
2363
|
+
setIsAnimated(false);
|
|
2364
|
+
setTimeout(()=>{
|
|
2365
|
+
setIsClosing(false);
|
|
2366
|
+
onClose?.();
|
|
2367
|
+
}, 300);
|
|
2368
|
+
};
|
|
2369
|
+
const handleStationClick = (station)=>{
|
|
2370
|
+
onSelected?.([
|
|
2371
|
+
station
|
|
2372
|
+
]);
|
|
2373
|
+
handleClose();
|
|
2374
|
+
};
|
|
2375
|
+
const getStationIcon = (s)=>{
|
|
2376
|
+
const cate = s.category?.toLowerCase() || 'sensor';
|
|
2377
|
+
const stat = s.state?.toLowerCase() || 'idle';
|
|
2378
|
+
const strr = `${cate}${'sensor' === cate ? 'Circle' : 'Rect'}_${stat}`;
|
|
2379
|
+
return Singleton.getIconUrl(strr);
|
|
2380
|
+
};
|
|
2381
|
+
const shouldAnimate = isAnimated && !isClosing;
|
|
2382
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
2383
|
+
className: StationsClickPanel_index_module.container,
|
|
2384
|
+
style: {
|
|
2385
|
+
width: containerSize,
|
|
2386
|
+
height: containerSize
|
|
2387
|
+
},
|
|
2388
|
+
onClick: (e)=>e.stopPropagation(),
|
|
2389
|
+
children: [
|
|
2390
|
+
/*#__PURE__*/ jsx("div", {
|
|
2391
|
+
className: `${StationsClickPanel_index_module.circle} ${shouldAnimate ? StationsClickPanel_index_module.animate : ''}`
|
|
2392
|
+
}),
|
|
2393
|
+
stations?.map((station, index)=>{
|
|
2394
|
+
const angle = index / stations.length * 2 * Math.PI;
|
|
2395
|
+
const x = center.x + radius * Math.cos(angle);
|
|
2396
|
+
const y = center.y + radius * Math.sin(angle);
|
|
2397
|
+
return /*#__PURE__*/ jsx(Tooltip, {
|
|
2398
|
+
title: station.name,
|
|
2399
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
2400
|
+
className: `${StationsClickPanel_index_module.stationItem} ${station.selected ? StationsClickPanel_index_module.selected : ''}`,
|
|
2401
|
+
style: {
|
|
2402
|
+
left: shouldAnimate ? `${x}px` : `${center.x}px`,
|
|
2403
|
+
top: shouldAnimate ? `${y}px` : `${center.y}px`,
|
|
2404
|
+
transform: 'translate(-50%, -50%)',
|
|
2405
|
+
opacity: shouldAnimate ? 1 : 0,
|
|
2406
|
+
transition: 'all 0.3s ease'
|
|
2407
|
+
},
|
|
2408
|
+
onClick: ()=>handleStationClick(station),
|
|
2409
|
+
children: [
|
|
2410
|
+
/*#__PURE__*/ jsx("div", {
|
|
2411
|
+
style: {
|
|
2412
|
+
width: 32,
|
|
2413
|
+
height: 32,
|
|
2414
|
+
background: `url(${getStationIcon(station)})`,
|
|
2415
|
+
backgroundSize: 'cover',
|
|
2416
|
+
cursor: 'pointer'
|
|
2417
|
+
}
|
|
2418
|
+
}),
|
|
2419
|
+
/*#__PURE__*/ jsx("div", {
|
|
2420
|
+
className: StationsClickPanel_index_module.name,
|
|
2421
|
+
children: station.name
|
|
2422
|
+
})
|
|
2423
|
+
]
|
|
2424
|
+
}, station.id)
|
|
2425
|
+
}, station.id);
|
|
2426
|
+
}),
|
|
2427
|
+
/*#__PURE__*/ jsx(Button, {
|
|
2428
|
+
shape: "circle",
|
|
2429
|
+
variant: "outlined",
|
|
2430
|
+
color: "primary",
|
|
2431
|
+
className: StationsClickPanel_index_module.closeBtn,
|
|
2432
|
+
icon: /*#__PURE__*/ jsx(CloseOutlined, {}),
|
|
2433
|
+
onClick: handleClose
|
|
2434
|
+
})
|
|
2435
|
+
]
|
|
2436
|
+
});
|
|
2437
|
+
};
|
|
2438
|
+
const components_StationsClickPanel_StationsClickPanel = StationsClickPanel_StationsClickPanel;
|
|
2439
|
+
const components_index_module = {
|
|
2440
|
+
ctrls: "ctrls-JUFhf6",
|
|
2441
|
+
xdbtn: "xdbtn-pE97xT",
|
|
2442
|
+
drawtool: "drawtool-oIv9Zk",
|
|
2443
|
+
theme: "theme-uSxkSZ",
|
|
2444
|
+
marker: "marker-r9vyNI",
|
|
2445
|
+
mousepos: "mousepos-LIOQDX",
|
|
2446
|
+
zoomOptions: "zoomOptions-Hiqqah",
|
|
2447
|
+
zoomOption: "zoomOption-SguTCl",
|
|
2448
|
+
selectDisabled: "selectDisabled-EkpHWn",
|
|
2449
|
+
tooltip: "tooltip-kRfBGw"
|
|
2450
|
+
};
|
|
2451
|
+
const XDMode = (props)=>{
|
|
2452
|
+
const { mode, onModeClick } = props;
|
|
2453
|
+
const [xdMode, setXdMode] = useState(mode || '2d');
|
|
2454
|
+
useEffect(()=>{
|
|
2455
|
+
setXdMode(mode || '2d');
|
|
2456
|
+
}, [
|
|
2457
|
+
mode
|
|
2458
|
+
]);
|
|
2459
|
+
const icons = useMemo(()=>({
|
|
2460
|
+
_2d: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
2461
|
+
component: _2D
|
|
2462
|
+
}),
|
|
2463
|
+
_3d: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
2464
|
+
component: _3D
|
|
2465
|
+
})
|
|
2466
|
+
}), []);
|
|
2467
|
+
return /*#__PURE__*/ jsx(FloatButton, {
|
|
2468
|
+
className: components_index_module.xdbtn,
|
|
2469
|
+
icon: icons[`_${xdMode}`],
|
|
2470
|
+
shape: "square",
|
|
2471
|
+
tooltip: {
|
|
2472
|
+
title: '2D/3D 视角切换',
|
|
2473
|
+
placement: 'left'
|
|
2474
|
+
},
|
|
2475
|
+
onClick: ()=>{
|
|
2476
|
+
const mode = '2d' === xdMode ? '3d' : '2d';
|
|
2477
|
+
setXdMode(mode);
|
|
2478
|
+
onModeClick(mode);
|
|
2479
|
+
}
|
|
2480
|
+
});
|
|
2481
|
+
};
|
|
2482
|
+
const _2D3D = XDMode;
|
|
2483
|
+
const DrawTool = (props)=>{
|
|
2484
|
+
const { mapless, reset } = props;
|
|
2485
|
+
const drawRef = useRef(void 0);
|
|
2486
|
+
const [curMode, setCurMode] = useState();
|
|
2487
|
+
useEffect(()=>{
|
|
2488
|
+
if (mapless) {
|
|
2489
|
+
drawRef.current = new Draw(mapless);
|
|
2490
|
+
drawRef.current.onDrawOver = ()=>{
|
|
2491
|
+
setCurMode(void 0);
|
|
2492
|
+
};
|
|
2493
|
+
}
|
|
2494
|
+
}, [
|
|
2495
|
+
mapless
|
|
2496
|
+
]);
|
|
2497
|
+
useEffect(()=>{
|
|
2498
|
+
if (reset > 0) {
|
|
2499
|
+
setCurMode(void 0);
|
|
2500
|
+
drawRef.current?.cancelDrawing();
|
|
2501
|
+
}
|
|
2502
|
+
}, [
|
|
2503
|
+
reset
|
|
2504
|
+
]);
|
|
2505
|
+
useEffect(()=>()=>{
|
|
2506
|
+
drawRef.current?.destroy();
|
|
2507
|
+
}, []);
|
|
2508
|
+
const icons = useMemo(()=>({
|
|
2509
|
+
measure: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
2510
|
+
component: Measure
|
|
2511
|
+
}),
|
|
2512
|
+
point: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
2513
|
+
component: Point
|
|
2514
|
+
}),
|
|
2515
|
+
line: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
2516
|
+
component: Line
|
|
2517
|
+
}),
|
|
2518
|
+
area: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
2519
|
+
component: Area
|
|
2520
|
+
}),
|
|
2521
|
+
angle: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
2522
|
+
component: Angle
|
|
2523
|
+
}),
|
|
2524
|
+
point_s: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
2525
|
+
component: Point,
|
|
2526
|
+
style: {
|
|
2527
|
+
color: 'var(--theme-color-primary)'
|
|
2528
|
+
}
|
|
2529
|
+
}),
|
|
2530
|
+
line_string_s: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
2531
|
+
component: Line,
|
|
2532
|
+
style: {
|
|
2533
|
+
color: 'var(--theme-color-primary)'
|
|
2534
|
+
}
|
|
2535
|
+
}),
|
|
2536
|
+
polygon_s: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
2537
|
+
component: Area,
|
|
2538
|
+
style: {
|
|
2539
|
+
color: 'var(--theme-color-primary)'
|
|
2540
|
+
}
|
|
2541
|
+
}),
|
|
2542
|
+
angle_s: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
2543
|
+
component: Angle,
|
|
2544
|
+
style: {
|
|
2545
|
+
color: 'var(--theme-color-primary)'
|
|
2546
|
+
}
|
|
2547
|
+
}),
|
|
2548
|
+
delete: /*#__PURE__*/ jsx(DeleteOutlined, {}),
|
|
2549
|
+
clear: /*#__PURE__*/ jsx(ClearOutlined, {})
|
|
2550
|
+
}), []);
|
|
2551
|
+
const escapeHandler = useCallback((e)=>{
|
|
2552
|
+
if ('Escape' === e.key) onModeClick('cancel');
|
|
2553
|
+
}, []);
|
|
2554
|
+
const onModeClick = (mode)=>{
|
|
2555
|
+
if ('cancel' === mode) {
|
|
2556
|
+
drawRef.current?.cancelDrawing();
|
|
2557
|
+
setCurMode(void 0);
|
|
2558
|
+
window.removeEventListener('keydown', escapeHandler);
|
|
2559
|
+
return;
|
|
2560
|
+
}
|
|
2561
|
+
if ('delete' === mode) drawRef.current?.deleteDraw();
|
|
2562
|
+
else if ('clear' === mode) drawRef.current?.clearDrawings();
|
|
2563
|
+
else {
|
|
2564
|
+
drawRef.current?.startDrawing(mode);
|
|
2565
|
+
setCurMode(mode);
|
|
2566
|
+
}
|
|
2567
|
+
window.addEventListener('keydown', escapeHandler);
|
|
2568
|
+
};
|
|
2569
|
+
return /*#__PURE__*/ jsxs(FloatButton.Group, {
|
|
2570
|
+
trigger: "hover",
|
|
2571
|
+
shape: "square",
|
|
2572
|
+
placement: "right",
|
|
2573
|
+
className: components_index_module.drawtool,
|
|
2574
|
+
tooltip: {
|
|
2575
|
+
title: curMode ? '点击或Esc取消绘制模式' : '工具箱',
|
|
2576
|
+
placement: 'left',
|
|
2577
|
+
rootClassName: components_index_module.tooltip
|
|
2578
|
+
},
|
|
2579
|
+
icon: icons[curMode ? `${curMode}_s` : 'measure'],
|
|
2580
|
+
onClick: ()=>onModeClick('cancel'),
|
|
2581
|
+
children: [
|
|
2582
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
2583
|
+
icon: icons.point,
|
|
2584
|
+
tooltip: "点",
|
|
2585
|
+
onClick: ()=>onModeClick('point')
|
|
2586
|
+
}),
|
|
2587
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
2588
|
+
icon: icons.line,
|
|
2589
|
+
tooltip: "线",
|
|
2590
|
+
onClick: ()=>onModeClick('line_string')
|
|
2591
|
+
}),
|
|
2592
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
2593
|
+
icon: icons.area,
|
|
2594
|
+
tooltip: "面积",
|
|
2595
|
+
onClick: ()=>onModeClick('polygon')
|
|
2596
|
+
}),
|
|
2597
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
2598
|
+
icon: icons.angle,
|
|
2599
|
+
tooltip: "角度",
|
|
2600
|
+
onClick: ()=>onModeClick('angle')
|
|
2601
|
+
}),
|
|
2602
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
2603
|
+
icon: icons.delete,
|
|
2604
|
+
tooltip: "删除选择项",
|
|
2605
|
+
onClick: ()=>onModeClick('delete')
|
|
2606
|
+
}),
|
|
2607
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
2608
|
+
icon: icons.clear,
|
|
2609
|
+
tooltip: "清空",
|
|
2610
|
+
onClick: ()=>onModeClick('clear')
|
|
2611
|
+
})
|
|
2612
|
+
]
|
|
2613
|
+
});
|
|
2614
|
+
};
|
|
2615
|
+
const ControlItems_DrawTool = DrawTool;
|
|
2616
|
+
const LngLat_XDMode = (props)=>{
|
|
2617
|
+
const { mapless, lnglat } = props;
|
|
2618
|
+
const [lng, setLng] = useState(113.27);
|
|
2619
|
+
const [lat, setLat] = useState(23.13);
|
|
2620
|
+
useEffect(()=>{
|
|
2621
|
+
if (mapless) attachMarker(mapless, 'lnglatTool-marker');
|
|
2622
|
+
}, [
|
|
2623
|
+
mapless
|
|
2624
|
+
]);
|
|
2625
|
+
useEffect(()=>{
|
|
2626
|
+
if (lnglat) {
|
|
2627
|
+
setLng(lnglat.lng);
|
|
2628
|
+
setLat(lnglat.lat);
|
|
2629
|
+
}
|
|
2630
|
+
}, [
|
|
2631
|
+
lnglat
|
|
2632
|
+
]);
|
|
2633
|
+
const [showMarker, setShowMarker] = useState(false);
|
|
2634
|
+
const setMarker = (lng, lat)=>{
|
|
2635
|
+
const mm = getMarker(mapless, 'lnglatTool-marker');
|
|
2636
|
+
mm?.removeMarker('test');
|
|
2637
|
+
if (showMarker) mm?.addMarker('test', [
|
|
2638
|
+
lng,
|
|
2639
|
+
lat
|
|
2640
|
+
], {
|
|
2641
|
+
icon: 'locating',
|
|
2642
|
+
anchor: 'bottom',
|
|
2643
|
+
popup: `
|
|
2644
|
+
<div style="margin: 5px 10px;user-select: text;">
|
|
2645
|
+
<div>经度:${lng.toFixed(6)}</div>
|
|
2646
|
+
<div>纬度:${lat.toFixed(6)}</div>
|
|
2647
|
+
</div>
|
|
2648
|
+
`
|
|
2649
|
+
});
|
|
2650
|
+
};
|
|
2651
|
+
useEffect(()=>{
|
|
2652
|
+
if (showMarker) {
|
|
2653
|
+
if (null !== lng && null !== lat) setMarker(lng, lat);
|
|
2654
|
+
}
|
|
2655
|
+
}, [
|
|
2656
|
+
showMarker,
|
|
2657
|
+
lng,
|
|
2658
|
+
lat
|
|
2659
|
+
]);
|
|
2660
|
+
const [format, setFormat] = useState(Format.STAR);
|
|
2661
|
+
const { coordSystem } = hooks_useCoordSystem(mapless);
|
|
2662
|
+
useEffect(()=>{
|
|
2663
|
+
if (null !== lng && null !== lat && showMarker) setMarker(lng, lat);
|
|
2664
|
+
}, [
|
|
2665
|
+
lng,
|
|
2666
|
+
lat,
|
|
2667
|
+
showMarker,
|
|
2668
|
+
coordSystem
|
|
2669
|
+
]);
|
|
2670
|
+
return /*#__PURE__*/ jsx(Popover, {
|
|
2671
|
+
placement: "right",
|
|
2672
|
+
title: /*#__PURE__*/ jsxs(Flex, {
|
|
2673
|
+
gap: 8,
|
|
2674
|
+
align: "center",
|
|
2675
|
+
children: [
|
|
2676
|
+
/*#__PURE__*/ jsxs(Flex, {
|
|
2677
|
+
gap: 8,
|
|
2678
|
+
align: "center",
|
|
2679
|
+
flex: 1,
|
|
2680
|
+
children: [
|
|
2681
|
+
"输入坐标信息:",
|
|
2682
|
+
/*#__PURE__*/ jsx(components_FormatChange, {
|
|
2683
|
+
showFormat: format,
|
|
2684
|
+
onFormatChange: setFormat
|
|
2685
|
+
})
|
|
2686
|
+
]
|
|
2687
|
+
}),
|
|
2688
|
+
/*#__PURE__*/ jsx(Tooltip, {
|
|
2689
|
+
title: showMarker ? '隐藏标记' : '显示标记',
|
|
2690
|
+
children: /*#__PURE__*/ jsx(Button, {
|
|
2691
|
+
type: "text",
|
|
2692
|
+
size: "small",
|
|
2693
|
+
onClick: ()=>{
|
|
2694
|
+
const next = !showMarker;
|
|
2695
|
+
setShowMarker(next);
|
|
2696
|
+
const mm = getMarker(mapless, 'lnglatTool-marker');
|
|
2697
|
+
if (next) {
|
|
2698
|
+
if (null !== lng && null !== lat) {
|
|
2699
|
+
mapless?.flyTo({
|
|
2700
|
+
center: [
|
|
2701
|
+
lng,
|
|
2702
|
+
lat
|
|
2703
|
+
]
|
|
2704
|
+
});
|
|
2705
|
+
setMarker(lng, lat);
|
|
2706
|
+
}
|
|
2707
|
+
} else mm?.removeMarker('test');
|
|
2708
|
+
},
|
|
2709
|
+
children: /*#__PURE__*/ jsx(FlagOutlined, {
|
|
2710
|
+
style: showMarker ? {
|
|
2711
|
+
color: 'var(--theme-color-primary)'
|
|
2712
|
+
} : {}
|
|
2713
|
+
})
|
|
2714
|
+
})
|
|
2715
|
+
}),
|
|
2716
|
+
/*#__PURE__*/ jsx(Tooltip, {
|
|
2717
|
+
title: "定位到当前位置",
|
|
2718
|
+
children: /*#__PURE__*/ jsx(Button, {
|
|
2719
|
+
type: "text",
|
|
2720
|
+
size: "small",
|
|
2721
|
+
onClick: ()=>{
|
|
2722
|
+
if (null !== lng && null !== lat) {
|
|
2723
|
+
mapless?.flyTo({
|
|
2724
|
+
center: [
|
|
2725
|
+
lng,
|
|
2726
|
+
lat
|
|
2727
|
+
]
|
|
2728
|
+
});
|
|
2729
|
+
setMarker(lng, lat);
|
|
2730
|
+
}
|
|
2731
|
+
},
|
|
2732
|
+
children: /*#__PURE__*/ jsx(ArrowRightOutlined, {})
|
|
2733
|
+
})
|
|
2734
|
+
})
|
|
2735
|
+
]
|
|
2736
|
+
}),
|
|
2737
|
+
content: /*#__PURE__*/ jsx(Flex, {
|
|
2738
|
+
vertical: true,
|
|
2739
|
+
gap: 4,
|
|
2740
|
+
children: format === Format.STAR ? /*#__PURE__*/ jsx(CoordinateInput, {
|
|
2741
|
+
value: `${lng?.toFixed(6)} ${lat?.toFixed(6)}`,
|
|
2742
|
+
onChange: (val)=>{
|
|
2743
|
+
if (val) {
|
|
2744
|
+
const [lng, lat] = val;
|
|
2745
|
+
setLng(Number(lng));
|
|
2746
|
+
setLat(Number(lat));
|
|
2747
|
+
}
|
|
2748
|
+
}
|
|
2749
|
+
}) : /*#__PURE__*/ jsxs(Fragment, {
|
|
2750
|
+
children: [
|
|
2751
|
+
/*#__PURE__*/ jsx(components_CoordinateTrans_CoordinateTrans, {
|
|
2752
|
+
showFormat: format,
|
|
2753
|
+
maximum: 180,
|
|
2754
|
+
minimum: -180,
|
|
2755
|
+
units: [
|
|
2756
|
+
'W',
|
|
2757
|
+
'E'
|
|
2758
|
+
],
|
|
2759
|
+
value: lng,
|
|
2760
|
+
onChange: (val)=>{
|
|
2761
|
+
setLng(val);
|
|
2762
|
+
}
|
|
2763
|
+
}),
|
|
2764
|
+
/*#__PURE__*/ jsx(components_CoordinateTrans_CoordinateTrans, {
|
|
2765
|
+
showFormat: format,
|
|
2766
|
+
maximum: 90,
|
|
2767
|
+
minimum: -90,
|
|
2768
|
+
value: lat,
|
|
2769
|
+
units: [
|
|
2770
|
+
'S',
|
|
2771
|
+
'N'
|
|
2772
|
+
],
|
|
2773
|
+
onChange: (val)=>{
|
|
2774
|
+
setLat(val);
|
|
2775
|
+
}
|
|
2776
|
+
})
|
|
2777
|
+
]
|
|
2778
|
+
})
|
|
2779
|
+
}),
|
|
2780
|
+
trigger: "click",
|
|
2781
|
+
children: /*#__PURE__*/ jsx(FloatButton, {
|
|
2782
|
+
className: components_index_module.xdbtn,
|
|
2783
|
+
style: {
|
|
2784
|
+
zIndex: '1 !important'
|
|
2785
|
+
},
|
|
2786
|
+
icon: /*#__PURE__*/ jsx(EnvironmentOutlined, {}),
|
|
2787
|
+
shape: "square",
|
|
2788
|
+
tooltip: {
|
|
2789
|
+
title: '坐标定位',
|
|
2790
|
+
placement: 'left',
|
|
2791
|
+
rootClassName: components_index_module.tooltip
|
|
2792
|
+
}
|
|
2793
|
+
})
|
|
2794
|
+
});
|
|
2795
|
+
};
|
|
2796
|
+
const ControlItems_LngLat = /*#__PURE__*/ react.memo(LngLat_XDMode);
|
|
2797
|
+
const MapHand = (props)=>{
|
|
2798
|
+
const { onClick } = props;
|
|
2799
|
+
const icons = useMemo(()=>({
|
|
2800
|
+
hand: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
2801
|
+
component: Hand
|
|
2802
|
+
})
|
|
2803
|
+
}), []);
|
|
2804
|
+
return /*#__PURE__*/ jsx(FloatButton, {
|
|
2805
|
+
className: components_index_module.xdbtn,
|
|
2806
|
+
icon: icons.hand,
|
|
2807
|
+
shape: "square",
|
|
2808
|
+
tooltip: {
|
|
2809
|
+
title: '恢复地图模式',
|
|
2810
|
+
placement: 'left'
|
|
2811
|
+
},
|
|
2812
|
+
onClick: ()=>{
|
|
2813
|
+
onClick();
|
|
2814
|
+
}
|
|
2815
|
+
});
|
|
2816
|
+
};
|
|
2817
|
+
const ControlItems_MapHand = MapHand;
|
|
2818
|
+
const MapOrigin = (props)=>{
|
|
2819
|
+
const { onClick } = props;
|
|
2820
|
+
const icons = useMemo(()=>({
|
|
2821
|
+
origin: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
2822
|
+
component: OriginPosition
|
|
2823
|
+
})
|
|
2824
|
+
}), []);
|
|
2825
|
+
return /*#__PURE__*/ jsx(FloatButton, {
|
|
2826
|
+
className: components_index_module.xdbtn,
|
|
2827
|
+
icon: icons.origin,
|
|
2828
|
+
shape: "square",
|
|
2829
|
+
tooltip: {
|
|
2830
|
+
title: '回到当前位置',
|
|
2831
|
+
placement: 'left'
|
|
2832
|
+
},
|
|
2833
|
+
onClick: ()=>{
|
|
2834
|
+
onClick();
|
|
2835
|
+
}
|
|
2836
|
+
});
|
|
2837
|
+
};
|
|
2838
|
+
const ControlItems_MapOrigin = MapOrigin;
|
|
2839
|
+
const PositionMkr = (props)=>{
|
|
2840
|
+
const { mapless, reset } = props;
|
|
2841
|
+
const pmkrRef = useRef(void 0);
|
|
2842
|
+
const [mkrs, setMkrs] = useState([]);
|
|
2843
|
+
const [mode, setMode] = useState('');
|
|
2844
|
+
useEffect(()=>{
|
|
2845
|
+
if (mapless?.map) pmkrRef.current = new PositionMarker(mapless.map);
|
|
2846
|
+
}, [
|
|
2847
|
+
mapless
|
|
2848
|
+
]);
|
|
2849
|
+
useEffect(()=>{
|
|
2850
|
+
if (reset > 0) {
|
|
2851
|
+
setMode('');
|
|
2852
|
+
pmkrRef.current?.stop();
|
|
2853
|
+
}
|
|
2854
|
+
}, [
|
|
2855
|
+
reset
|
|
2856
|
+
]);
|
|
2857
|
+
const icons = useMemo(()=>({
|
|
2858
|
+
point: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
2859
|
+
component: Point
|
|
2860
|
+
}),
|
|
2861
|
+
getPosition: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
2862
|
+
component: GetPosition
|
|
2863
|
+
}),
|
|
2864
|
+
getPosition_s: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
2865
|
+
component: GetPosition,
|
|
2866
|
+
style: {
|
|
2867
|
+
color: 'var(--theme-color-primary)'
|
|
2868
|
+
}
|
|
2869
|
+
}),
|
|
2870
|
+
clear: /*#__PURE__*/ jsx(ClearOutlined, {})
|
|
2871
|
+
}), []);
|
|
2872
|
+
const onModeClick = async (mode)=>{
|
|
2873
|
+
if ('clear' === mode) return void setMkrs([]);
|
|
2874
|
+
if ('stop' === mode) {
|
|
2875
|
+
setMode('');
|
|
2876
|
+
pmkrRef.current?.stop();
|
|
2877
|
+
}
|
|
2878
|
+
if ('start' === mode) {
|
|
2879
|
+
setMode('getPosition');
|
|
2880
|
+
if (pmkrRef.current) {
|
|
2881
|
+
mapless?.interactionLayers(false);
|
|
2882
|
+
const [coords, error] = await pmkrRef.current.startPointPickingAsync();
|
|
2883
|
+
if (coords && !error) setMkrs((prev)=>[
|
|
2884
|
+
...prev,
|
|
2885
|
+
{
|
|
2886
|
+
id: `${Date.now()}`,
|
|
2887
|
+
lngLat: coords,
|
|
2888
|
+
remark: ''
|
|
2889
|
+
}
|
|
2890
|
+
]);
|
|
2891
|
+
mapless?.interactionLayers(true);
|
|
2892
|
+
}
|
|
2893
|
+
setMode('');
|
|
2894
|
+
}
|
|
2895
|
+
};
|
|
2896
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
2897
|
+
children: [
|
|
2898
|
+
/*#__PURE__*/ jsxs(FloatButton.Group, {
|
|
2899
|
+
trigger: "hover",
|
|
2900
|
+
shape: "square",
|
|
2901
|
+
placement: "right",
|
|
2902
|
+
className: components_index_module.drawtool,
|
|
2903
|
+
tooltip: {
|
|
2904
|
+
title: '标记',
|
|
2905
|
+
placement: 'left',
|
|
2906
|
+
rootClassName: components_index_module.tooltip
|
|
2907
|
+
},
|
|
2908
|
+
icon: icons[mode ? `${mode}_s` : 'getPosition'],
|
|
2909
|
+
onClick: ()=>onModeClick('stop'),
|
|
2910
|
+
children: [
|
|
2911
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
2912
|
+
icon: icons.getPosition,
|
|
2913
|
+
tooltip: "获取坐标",
|
|
2914
|
+
onClick: ()=>onModeClick('start')
|
|
2915
|
+
}),
|
|
2916
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
2917
|
+
icon: icons.clear,
|
|
2918
|
+
tooltip: "清空",
|
|
2919
|
+
onClick: ()=>onModeClick('clear')
|
|
2920
|
+
})
|
|
2921
|
+
]
|
|
2922
|
+
}),
|
|
2923
|
+
/*#__PURE__*/ jsx(DraggableMarker_DraggableMarker.Group, {
|
|
2924
|
+
mapless: mapless,
|
|
2925
|
+
markers: mkrs,
|
|
2926
|
+
onChange: (id, update)=>{
|
|
2927
|
+
setMkrs((prev)=>prev?.map((mkr)=>mkr.id === id ? {
|
|
2928
|
+
...mkr,
|
|
2929
|
+
...update
|
|
2930
|
+
} : mkr) || []);
|
|
2931
|
+
},
|
|
2932
|
+
onMarkersChange: setMkrs
|
|
2933
|
+
})
|
|
2934
|
+
]
|
|
2935
|
+
});
|
|
2936
|
+
};
|
|
2937
|
+
const ControlItems_PositionMkr = PositionMkr;
|
|
2938
|
+
const ZOOM_LEVELS = [
|
|
2939
|
+
1,
|
|
2940
|
+
2,
|
|
2941
|
+
5,
|
|
2942
|
+
8,
|
|
2943
|
+
10,
|
|
2944
|
+
12,
|
|
2945
|
+
18,
|
|
2946
|
+
20
|
|
2947
|
+
];
|
|
2948
|
+
const PositionMus = (props)=>{
|
|
2949
|
+
const { mapless } = props;
|
|
2950
|
+
const divRef = useRef(null);
|
|
2951
|
+
const pmusRef = useRef(void 0);
|
|
2952
|
+
const [position, setPosition] = useState(null);
|
|
2953
|
+
const [zoom, setZoom] = useState(null);
|
|
2954
|
+
const [showZoomOptions, setShowZoomOptions] = useState(false);
|
|
2955
|
+
const onCoordSystemChange = useCallback((_system)=>{
|
|
2956
|
+
setPosition((prev)=>prev ? new LngLat(prev.lng, prev.lat) : null);
|
|
2957
|
+
}, []);
|
|
2958
|
+
const handleZoomLevelClick = useCallback((level)=>{
|
|
2959
|
+
if (mapless?.map) {
|
|
2960
|
+
mapless.zoomTo(level);
|
|
2961
|
+
setShowZoomOptions(false);
|
|
2962
|
+
}
|
|
2963
|
+
}, [
|
|
2964
|
+
mapless
|
|
2965
|
+
]);
|
|
2966
|
+
useEffect(()=>{
|
|
2967
|
+
if (mapless?.map) {
|
|
2968
|
+
pmusRef.current = new PositionMouse(mapless.map);
|
|
2969
|
+
pmusRef.current.onPositionChange = (coord)=>{
|
|
2970
|
+
setPosition(coord);
|
|
2971
|
+
};
|
|
2972
|
+
pmusRef.current.onZoomChange = (_z)=>{
|
|
2973
|
+
setZoom(mapless?.map?.getZoom()?.toFixed(0) || '--');
|
|
2974
|
+
};
|
|
2975
|
+
setZoom(mapless?.map?.getZoom()?.toFixed(0) || '--');
|
|
2976
|
+
pmusRef.current.startMouse();
|
|
2977
|
+
divRef.current?.parentElement?.addEventListener('mouseleave', ()=>{
|
|
2978
|
+
setPosition(null);
|
|
2979
|
+
setShowZoomOptions(false);
|
|
2980
|
+
});
|
|
2981
|
+
mapless.onCoordSystemChange(onCoordSystemChange);
|
|
2982
|
+
}
|
|
2983
|
+
return ()=>{
|
|
2984
|
+
pmusRef.current?.stopMouse();
|
|
2985
|
+
mapless?.offCoordSystemChange(onCoordSystemChange);
|
|
2986
|
+
};
|
|
2987
|
+
}, [
|
|
2988
|
+
mapless
|
|
2989
|
+
]);
|
|
2990
|
+
const fixPosition = useMemo(()=>position ? mapless?.coordTrans('tileToData', [
|
|
2991
|
+
position.lng,
|
|
2992
|
+
position.lat
|
|
2993
|
+
]) : null, [
|
|
2994
|
+
position,
|
|
2995
|
+
mapless
|
|
2996
|
+
]);
|
|
2997
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
2998
|
+
ref: divRef,
|
|
2999
|
+
className: components_index_module.mousepos,
|
|
3000
|
+
onClick: ()=>setShowZoomOptions(!showZoomOptions),
|
|
3001
|
+
children: [
|
|
3002
|
+
zoom && /*#__PURE__*/ jsxs("span", {
|
|
3003
|
+
style: {
|
|
3004
|
+
opacity: 0.5
|
|
3005
|
+
},
|
|
3006
|
+
children: [
|
|
3007
|
+
"Z : ",
|
|
3008
|
+
zoom
|
|
3009
|
+
]
|
|
3010
|
+
}),
|
|
3011
|
+
fixPosition && /*#__PURE__*/ jsxs("div", {
|
|
3012
|
+
style: zoom ? {
|
|
3013
|
+
marginLeft: 12
|
|
3014
|
+
} : {},
|
|
3015
|
+
children: [
|
|
3016
|
+
fixPosition[0].toFixed(6),
|
|
3017
|
+
" , ",
|
|
3018
|
+
fixPosition[1].toFixed(6)
|
|
3019
|
+
]
|
|
3020
|
+
}),
|
|
3021
|
+
showZoomOptions && /*#__PURE__*/ jsx("div", {
|
|
3022
|
+
className: components_index_module.zoomOptions,
|
|
3023
|
+
children: ZOOM_LEVELS.map((level)=>/*#__PURE__*/ jsx("div", {
|
|
3024
|
+
className: components_index_module.zoomOption,
|
|
3025
|
+
onClick: ()=>handleZoomLevelClick(level),
|
|
3026
|
+
style: {
|
|
3027
|
+
fontWeight: zoom === level.toFixed(0) ? 'bolder' : 'normal',
|
|
3028
|
+
color: zoom === level.toFixed(0) ? 'var(--theme-color-primary)' : 'var(--theme-color-base)'
|
|
3029
|
+
},
|
|
3030
|
+
children: level
|
|
3031
|
+
}, level))
|
|
3032
|
+
})
|
|
3033
|
+
]
|
|
3034
|
+
});
|
|
3035
|
+
};
|
|
3036
|
+
const ControlItems_PositionMus = PositionMus;
|
|
3037
|
+
const getStationFuncs = {
|
|
3038
|
+
getStation: getOldStation,
|
|
3039
|
+
getOldStation: getOldStation,
|
|
3040
|
+
getNewStation: getNewStation
|
|
3041
|
+
};
|
|
3042
|
+
const getFunc = (prefix)=>{
|
|
3043
|
+
const name = `get${prefix}Station`;
|
|
3044
|
+
return getStationFuncs[name] || getStationFuncs.getStation;
|
|
3045
|
+
};
|
|
3046
|
+
const SelectTool_SelectTool = (props)=>{
|
|
3047
|
+
const { mapless, reset, statioinFuncPrefix = '', relativeManagerIds = [
|
|
3048
|
+
'sm1'
|
|
3049
|
+
], onSelectionChange, disabled = false, children } = props;
|
|
3050
|
+
const [selectMode, setSelectMode] = useState('selectTool');
|
|
3051
|
+
const paintRef = useRef(void 0);
|
|
3052
|
+
const paintsMapRef = useRef(new Map());
|
|
3053
|
+
const popupRef = useRef(null);
|
|
3054
|
+
const maplessRef = useRef(void 0);
|
|
3055
|
+
const [selected, setSelected] = useState(void 0);
|
|
3056
|
+
const [position, setPosition] = useState();
|
|
3057
|
+
useEffect(()=>{
|
|
3058
|
+
if (reset && reset > 0) {
|
|
3059
|
+
mapless?.interactionLayers(true);
|
|
3060
|
+
paintRef.current?.exitDraw();
|
|
3061
|
+
setSelectMode('selectTool');
|
|
3062
|
+
}
|
|
3063
|
+
}, [
|
|
3064
|
+
reset
|
|
3065
|
+
]);
|
|
3066
|
+
const updateSelected = ()=>{
|
|
3067
|
+
const m1Id = relativeManagerIds?.[0] || '';
|
|
3068
|
+
if (m1Id) {
|
|
3069
|
+
const sman = getFunc(statioinFuncPrefix)(mapless, m1Id);
|
|
3070
|
+
const allSelected = [
|
|
3071
|
+
...paintsMapRef.current.values()
|
|
3072
|
+
].flat().map((s)=>s?.id);
|
|
3073
|
+
sman?.updateSelectedList(allSelected);
|
|
3074
|
+
}
|
|
3075
|
+
};
|
|
3076
|
+
const emitManaEvent = (selected)=>{
|
|
3077
|
+
const sman = getFunc(statioinFuncPrefix)(mapless, relativeManagerIds?.[0] || '');
|
|
3078
|
+
sman?.emitEvent('stationsSelected', selected, 'SelectTool');
|
|
3079
|
+
};
|
|
3080
|
+
useEffect(()=>{
|
|
3081
|
+
if (mapless) {
|
|
3082
|
+
paintRef.current = new PaintBoard(mapless, {
|
|
3083
|
+
maxCount: 3
|
|
3084
|
+
});
|
|
3085
|
+
paintRef.current.onDrawing = throttle((paint)=>{
|
|
3086
|
+
const p = paint;
|
|
3087
|
+
if (p) {
|
|
3088
|
+
const sman = getFunc(statioinFuncPrefix)(mapless, relativeManagerIds?.[0] || '');
|
|
3089
|
+
const stations = sman?.getStations();
|
|
3090
|
+
const selected = calculateObjectsInPolygon(stations, p);
|
|
3091
|
+
paintsMapRef.current.set(p, selected);
|
|
3092
|
+
}
|
|
3093
|
+
updateSelected();
|
|
3094
|
+
}, 100);
|
|
3095
|
+
paintRef.current.onDrawingEnd = (paint)=>{
|
|
3096
|
+
const p = paint;
|
|
3097
|
+
if (p) {
|
|
3098
|
+
const selected = paintsMapRef.current.get(p);
|
|
3099
|
+
setSelected(selected);
|
|
3100
|
+
const pc = getPaintCenter(p);
|
|
3101
|
+
setPosition(pc);
|
|
3102
|
+
popupRef.current?.show();
|
|
3103
|
+
onSelectionChange?.(selected);
|
|
3104
|
+
emitManaEvent(selected || []);
|
|
3105
|
+
}
|
|
3106
|
+
};
|
|
3107
|
+
paintRef.current.onDrawingRemove = (paint)=>{
|
|
3108
|
+
paint && paintsMapRef.current.delete(paint);
|
|
3109
|
+
updateSelected();
|
|
3110
|
+
onSelectionChange?.([]);
|
|
3111
|
+
emitManaEvent([]);
|
|
3112
|
+
};
|
|
3113
|
+
maplessRef.current = mapless;
|
|
3114
|
+
}
|
|
3115
|
+
}, [
|
|
3116
|
+
mapless
|
|
3117
|
+
]);
|
|
3118
|
+
useEffect(()=>()=>{
|
|
3119
|
+
paintRef.current?.destroy();
|
|
3120
|
+
}, []);
|
|
3121
|
+
const icons = useMemo(()=>({
|
|
3122
|
+
selectTool: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
3123
|
+
component: SelectTool
|
|
3124
|
+
}),
|
|
3125
|
+
select: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
3126
|
+
component: PointerSelect
|
|
3127
|
+
}),
|
|
3128
|
+
circle: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
3129
|
+
component: CircleSelect
|
|
3130
|
+
}),
|
|
3131
|
+
rectangle: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
3132
|
+
component: RectangleSelect
|
|
3133
|
+
}),
|
|
3134
|
+
freedom: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
3135
|
+
component: FreedomSelect
|
|
3136
|
+
}),
|
|
3137
|
+
select_s: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
3138
|
+
component: PointerSelect,
|
|
3139
|
+
style: {
|
|
3140
|
+
color: 'var(--theme-color-primary)'
|
|
3141
|
+
}
|
|
3142
|
+
}),
|
|
3143
|
+
circle_s: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
3144
|
+
component: CircleSelect,
|
|
3145
|
+
style: {
|
|
3146
|
+
color: 'var(--theme-color-primary)'
|
|
3147
|
+
}
|
|
3148
|
+
}),
|
|
3149
|
+
rectangle_s: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
3150
|
+
component: RectangleSelect,
|
|
3151
|
+
style: {
|
|
3152
|
+
color: 'var(--theme-color-primary)'
|
|
3153
|
+
}
|
|
3154
|
+
}),
|
|
3155
|
+
freedom_s: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
3156
|
+
component: FreedomSelect,
|
|
3157
|
+
style: {
|
|
3158
|
+
color: 'var(--theme-color-primary)'
|
|
3159
|
+
}
|
|
3160
|
+
}),
|
|
3161
|
+
clear: /*#__PURE__*/ jsx(ClearOutlined, {})
|
|
3162
|
+
}), []);
|
|
3163
|
+
const escapeHandler = useCallback((e)=>{
|
|
3164
|
+
if ('Escape' === e.key) onModeClick('exit');
|
|
3165
|
+
}, []);
|
|
3166
|
+
const onModeClick = (mode)=>{
|
|
3167
|
+
if ('exit' === mode) {
|
|
3168
|
+
mapless?.interactionLayers(true);
|
|
3169
|
+
paintRef.current?.exitDraw();
|
|
3170
|
+
setSelectMode('selectTool');
|
|
3171
|
+
window.removeEventListener('keydown', escapeHandler);
|
|
3172
|
+
return;
|
|
3173
|
+
}
|
|
3174
|
+
if ('clear' === mode) {
|
|
3175
|
+
const sman = getFunc(statioinFuncPrefix)(mapless, relativeManagerIds?.[0] || '');
|
|
3176
|
+
sman?.clearSelected();
|
|
3177
|
+
paintRef.current?.clearDraw();
|
|
3178
|
+
paintsMapRef.current = new Map();
|
|
3179
|
+
popupRef.current?.hide();
|
|
3180
|
+
updateSelected();
|
|
3181
|
+
onSelectionChange?.([]);
|
|
3182
|
+
emitManaEvent([]);
|
|
3183
|
+
return;
|
|
3184
|
+
}
|
|
3185
|
+
setSelectMode(mode);
|
|
3186
|
+
mapless?.interactionLayers(false);
|
|
3187
|
+
paintRef.current?.startDraw();
|
|
3188
|
+
paintRef.current?.setPaintMode(mode);
|
|
3189
|
+
window.addEventListener('keydown', escapeHandler);
|
|
3190
|
+
};
|
|
3191
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
3192
|
+
children: [
|
|
3193
|
+
/*#__PURE__*/ jsxs(FloatButton.Group, {
|
|
3194
|
+
trigger: "hover",
|
|
3195
|
+
shape: "square",
|
|
3196
|
+
placement: "right",
|
|
3197
|
+
className: components_index_module.drawtool,
|
|
3198
|
+
tooltip: {
|
|
3199
|
+
title: 'selectTool' === selectMode ? '选择工具' : '点击或Esc取消选择模式',
|
|
3200
|
+
placement: 'left',
|
|
3201
|
+
rootClassName: components_index_module.tooltip
|
|
3202
|
+
},
|
|
3203
|
+
icon: icons['selectTool' === selectMode ? selectMode : `${selectMode}_s`],
|
|
3204
|
+
onClick: ()=>onModeClick('exit'),
|
|
3205
|
+
children: [
|
|
3206
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
3207
|
+
icon: icons.select,
|
|
3208
|
+
tooltip: "选择",
|
|
3209
|
+
onClick: ()=>onModeClick('select')
|
|
3210
|
+
}),
|
|
3211
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
3212
|
+
icon: icons.circle,
|
|
3213
|
+
tooltip: "圈选",
|
|
3214
|
+
className: disabled ? components_index_module.selectDisabled : '',
|
|
3215
|
+
onClick: ()=>onModeClick('circle')
|
|
3216
|
+
}),
|
|
3217
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
3218
|
+
icon: icons.rectangle,
|
|
3219
|
+
tooltip: "框选",
|
|
3220
|
+
className: disabled ? components_index_module.selectDisabled : '',
|
|
3221
|
+
onClick: ()=>onModeClick('rectangle')
|
|
3222
|
+
}),
|
|
3223
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
3224
|
+
icon: icons.freedom,
|
|
3225
|
+
tooltip: "自由",
|
|
3226
|
+
className: disabled ? components_index_module.selectDisabled : '',
|
|
3227
|
+
onClick: ()=>onModeClick('freedom')
|
|
3228
|
+
}),
|
|
3229
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
3230
|
+
icon: icons.clear,
|
|
3231
|
+
tooltip: "清除",
|
|
3232
|
+
onClick: ()=>onModeClick('clear')
|
|
3233
|
+
})
|
|
3234
|
+
]
|
|
3235
|
+
}),
|
|
3236
|
+
/*#__PURE__*/ jsx(components_MapboxPopup_MapboxPopup, {
|
|
3237
|
+
ref: popupRef,
|
|
3238
|
+
maplessRef: maplessRef,
|
|
3239
|
+
lngLat: position,
|
|
3240
|
+
children: children ? children : /*#__PURE__*/ jsxs(Fragment, {
|
|
3241
|
+
children: [
|
|
3242
|
+
/*#__PURE__*/ jsxs("h4", {
|
|
3243
|
+
children: [
|
|
3244
|
+
"已选站点",
|
|
3245
|
+
selected && selected?.length > 0 ? ` (${selected.length})` : ''
|
|
3246
|
+
]
|
|
3247
|
+
}),
|
|
3248
|
+
/*#__PURE__*/ jsx("div", {
|
|
3249
|
+
style: {
|
|
3250
|
+
maxHeight: 200,
|
|
3251
|
+
overflow: 'auto'
|
|
3252
|
+
},
|
|
3253
|
+
children: selected && selected?.length > 0 ? selected.map((s)=>/*#__PURE__*/ jsx("div", {
|
|
3254
|
+
children: s.name
|
|
3255
|
+
}, s.id)) : /*#__PURE__*/ jsx("span", {
|
|
3256
|
+
children: "暂无数据"
|
|
3257
|
+
})
|
|
3258
|
+
})
|
|
3259
|
+
]
|
|
3260
|
+
})
|
|
3261
|
+
})
|
|
3262
|
+
]
|
|
3263
|
+
});
|
|
3264
|
+
};
|
|
3265
|
+
const ControlItems_SelectTool = SelectTool_SelectTool;
|
|
3266
|
+
const ShowCategory = (props)=>{
|
|
3267
|
+
const { category, onCategoryClick } = props;
|
|
3268
|
+
const icons = useMemo(()=>({
|
|
3269
|
+
mode: /*#__PURE__*/ jsx(QuestionCircleOutlined, {}),
|
|
3270
|
+
station: /*#__PURE__*/ jsx(QuestionCircleOutlined, {}),
|
|
3271
|
+
sensor: /*#__PURE__*/ jsx(QuestionCircleOutlined, {}),
|
|
3272
|
+
all: /*#__PURE__*/ jsx(QuestionCircleOutlined, {})
|
|
3273
|
+
}), []);
|
|
3274
|
+
return /*#__PURE__*/ jsxs(FloatButton.Group, {
|
|
3275
|
+
trigger: "hover",
|
|
3276
|
+
shape: "square",
|
|
3277
|
+
placement: "right",
|
|
3278
|
+
className: components_index_module.theme,
|
|
3279
|
+
tooltip: {
|
|
3280
|
+
title: '设置可见性',
|
|
3281
|
+
placement: 'left'
|
|
3282
|
+
},
|
|
3283
|
+
icon: icons[category || 'mode'],
|
|
3284
|
+
onClick: ()=>onCategoryClick(''),
|
|
3285
|
+
children: [
|
|
3286
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
3287
|
+
icon: icons.station,
|
|
3288
|
+
tooltip: "监测站",
|
|
3289
|
+
onClick: ()=>onCategoryClick('station')
|
|
3290
|
+
}),
|
|
3291
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
3292
|
+
icon: icons.sensor,
|
|
3293
|
+
tooltip: "传感器",
|
|
3294
|
+
onClick: ()=>onCategoryClick('sensor')
|
|
3295
|
+
}),
|
|
3296
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
3297
|
+
icon: icons.all,
|
|
3298
|
+
tooltip: "全部",
|
|
3299
|
+
onClick: ()=>onCategoryClick('')
|
|
3300
|
+
})
|
|
3301
|
+
]
|
|
3302
|
+
});
|
|
3303
|
+
};
|
|
3304
|
+
const ControlItems_ShowCategory = ShowCategory;
|
|
3305
|
+
const ShowHide = ({ manaId, mapless })=>{
|
|
3306
|
+
const [hideManager, setHideManager] = useState(false);
|
|
3307
|
+
const icons = useMemo(()=>({
|
|
3308
|
+
show: /*#__PURE__*/ jsx(EyeOutlined, {}),
|
|
3309
|
+
hide: /*#__PURE__*/ jsx(EyeInvisibleOutlined, {})
|
|
3310
|
+
}), []);
|
|
3311
|
+
useEffect(()=>{
|
|
3312
|
+
if (manaId && mapless) {
|
|
3313
|
+
const m = mapless.getByName(manaId);
|
|
3314
|
+
m?.setVisible(!hideManager);
|
|
3315
|
+
}
|
|
3316
|
+
}, [
|
|
3317
|
+
hideManager,
|
|
3318
|
+
manaId,
|
|
3319
|
+
mapless
|
|
3320
|
+
]);
|
|
3321
|
+
return /*#__PURE__*/ jsx(FloatButton, {
|
|
3322
|
+
className: components_index_module.xdbtn,
|
|
3323
|
+
icon: hideManager ? icons.hide : icons.show,
|
|
3324
|
+
shape: "square",
|
|
3325
|
+
tooltip: {
|
|
3326
|
+
title: hideManager ? '点击显示' : '点击隐藏',
|
|
3327
|
+
placement: 'left'
|
|
3328
|
+
},
|
|
3329
|
+
onClick: ()=>{
|
|
3330
|
+
setHideManager(!hideManager);
|
|
3331
|
+
}
|
|
3332
|
+
});
|
|
3333
|
+
};
|
|
3334
|
+
const ControlItems_ShowHide = ShowHide;
|
|
3335
|
+
const StyleNames = (props)=>{
|
|
3336
|
+
const { styleName, onStyleNameClick } = props;
|
|
3337
|
+
const icons = useMemo(()=>({
|
|
3338
|
+
mode: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
3339
|
+
component: Mode
|
|
3340
|
+
}),
|
|
3341
|
+
dz_streets: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
3342
|
+
component: Streets
|
|
3343
|
+
}),
|
|
3344
|
+
dz_satellite: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
3345
|
+
component: Satellite
|
|
3346
|
+
}),
|
|
3347
|
+
dz_cyber: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
3348
|
+
component: Cyber
|
|
3349
|
+
}),
|
|
3350
|
+
dz_light: /*#__PURE__*/ jsx(SunOutlined, {}),
|
|
3351
|
+
dz_dark: /*#__PURE__*/ jsx(MoonOutlined, {}),
|
|
3352
|
+
none: /*#__PURE__*/ jsx(StopOutlined, {})
|
|
3353
|
+
}), []);
|
|
3354
|
+
return !maplessPreset.IS_MAP_THEME_SOURCES && /*#__PURE__*/ jsxs(FloatButton.Group, {
|
|
3355
|
+
trigger: "hover",
|
|
3356
|
+
shape: "square",
|
|
3357
|
+
placement: "right",
|
|
3358
|
+
className: components_index_module.theme,
|
|
3359
|
+
tooltip: {
|
|
3360
|
+
title: '设置其它图层',
|
|
3361
|
+
placement: 'left',
|
|
3362
|
+
rootClassName: components_index_module.tooltip
|
|
3363
|
+
},
|
|
3364
|
+
icon: icons[styleName || 'mode'],
|
|
3365
|
+
onClick: ()=>onStyleNameClick?.(''),
|
|
3366
|
+
children: [
|
|
3367
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
3368
|
+
icon: icons.dz_streets,
|
|
3369
|
+
tooltip: "街道图",
|
|
3370
|
+
onClick: ()=>onStyleNameClick?.('dz_streets')
|
|
3371
|
+
}),
|
|
3372
|
+
maplessPreset.ENABLE_SATELLITE && /*#__PURE__*/ jsx(FloatButton, {
|
|
3373
|
+
icon: icons.dz_satellite,
|
|
3374
|
+
tooltip: "卫星图",
|
|
3375
|
+
onClick: ()=>onStyleNameClick?.('dz_satellite')
|
|
3376
|
+
}),
|
|
3377
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
3378
|
+
icon: icons.dz_cyber,
|
|
3379
|
+
tooltip: "科技感",
|
|
3380
|
+
onClick: ()=>onStyleNameClick?.('dz_cyber')
|
|
3381
|
+
}),
|
|
3382
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
3383
|
+
icon: icons.dz_dark,
|
|
3384
|
+
tooltip: "暗黑",
|
|
3385
|
+
onClick: ()=>onStyleNameClick?.('dz_dark')
|
|
3386
|
+
}),
|
|
3387
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
3388
|
+
icon: icons.dz_light,
|
|
3389
|
+
tooltip: "明亮",
|
|
3390
|
+
onClick: ()=>onStyleNameClick?.('dz_light')
|
|
3391
|
+
}),
|
|
3392
|
+
/*#__PURE__*/ jsx(FloatButton, {
|
|
3393
|
+
icon: icons.none,
|
|
3394
|
+
tooltip: "跟随主题",
|
|
3395
|
+
onClick: ()=>onStyleNameClick?.('')
|
|
3396
|
+
})
|
|
3397
|
+
]
|
|
3398
|
+
});
|
|
3399
|
+
};
|
|
3400
|
+
const ControlItems_StyleNames = StyleNames;
|
|
3401
|
+
const StyleSources = (props)=>{
|
|
3402
|
+
const { defaultStyleSource, styleSource, onStyleSourceClick } = props;
|
|
3403
|
+
const lightSourceItem = useMemo(()=>lightSource(), []);
|
|
3404
|
+
const darkSourceItem = useMemo(()=>darkSource(), []);
|
|
3405
|
+
const icons = useMemo(()=>({
|
|
3406
|
+
mode: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
3407
|
+
component: Mode
|
|
3408
|
+
}),
|
|
3409
|
+
modeActive: /*#__PURE__*/ jsx(_ant_design_icons, {
|
|
3410
|
+
component: Mode,
|
|
3411
|
+
style: {
|
|
3412
|
+
color: 'var(--theme-color-primary)'
|
|
3413
|
+
}
|
|
3414
|
+
}),
|
|
3415
|
+
light: /*#__PURE__*/ jsx(SunOutlined, {}),
|
|
3416
|
+
dark: /*#__PURE__*/ jsx(MoonOutlined, {}),
|
|
3417
|
+
[lightSourceItem?.name || 'light']: /*#__PURE__*/ jsx(SunOutlined, {}),
|
|
3418
|
+
[darkSourceItem?.name || 'dark']: /*#__PURE__*/ jsx(MoonOutlined, {}),
|
|
3419
|
+
none: /*#__PURE__*/ jsx(StopOutlined, {})
|
|
3420
|
+
}), []);
|
|
3421
|
+
const [btnClick, setBtnClick] = useState('');
|
|
3422
|
+
const sourceBtns = useMemo(()=>maplessPreset.MAP_THEME_SOURCES?.map((item, index)=>/*#__PURE__*/ jsx(Fragment, {
|
|
3423
|
+
children: /*#__PURE__*/ jsx(Button, {
|
|
3424
|
+
type: "text",
|
|
3425
|
+
style: {
|
|
3426
|
+
border: 'none',
|
|
3427
|
+
maxWidth: 150,
|
|
3428
|
+
height: '100%',
|
|
3429
|
+
borderRadius: 0 === index ? '8px 0 0 8px' : 0,
|
|
3430
|
+
borderRight: index === maplessPreset.MAP_THEME_SOURCES.length - 1 ? 'none' : '1px solid var(--ant-color-border)',
|
|
3431
|
+
color: btnClick === item.name ? 'var(--theme-color-primary)' : 'var(--theme-color-text)'
|
|
3432
|
+
},
|
|
3433
|
+
onClick: ()=>{
|
|
3434
|
+
setBtnClick(item.name);
|
|
3435
|
+
onStyleSourceClick(item.name, sourcesMap()[item.name]);
|
|
3436
|
+
},
|
|
3437
|
+
children: /*#__PURE__*/ jsx(Tooltip, {
|
|
3438
|
+
title: item.name,
|
|
3439
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
3440
|
+
style: {
|
|
3441
|
+
width: '100%',
|
|
3442
|
+
overflow: 'hidden',
|
|
3443
|
+
textOverflow: 'ellipsis',
|
|
3444
|
+
whiteSpace: 'nowrap'
|
|
3445
|
+
},
|
|
3446
|
+
children: item.name
|
|
3447
|
+
})
|
|
3448
|
+
})
|
|
3449
|
+
}, item.name)
|
|
3450
|
+
})), [
|
|
3451
|
+
btnClick,
|
|
3452
|
+
onStyleSourceClick
|
|
3453
|
+
]);
|
|
3454
|
+
useEffect(()=>{
|
|
3455
|
+
setBtnClick(defaultStyleSource);
|
|
3456
|
+
}, [
|
|
3457
|
+
defaultStyleSource
|
|
3458
|
+
]);
|
|
3459
|
+
return maplessPreset.IS_MAP_THEME_SOURCES && maplessPreset.MAP_THEME_SOURCES?.length > 1 && /*#__PURE__*/ jsxs(FloatButton.Group, {
|
|
3460
|
+
trigger: "hover",
|
|
3461
|
+
shape: "square",
|
|
3462
|
+
placement: "right",
|
|
3463
|
+
className: components_index_module.theme,
|
|
3464
|
+
tooltip: {
|
|
3465
|
+
title: btnClick ? maplessPreset.MAP_THEME_SOURCES.find((item)=>item.name === styleSource)?.name || '' : '设置其它图层',
|
|
3466
|
+
placement: 'left',
|
|
3467
|
+
rootClassName: components_index_module.tooltip
|
|
3468
|
+
},
|
|
3469
|
+
icon: [
|
|
3470
|
+
'light',
|
|
3471
|
+
'dark'
|
|
3472
|
+
].includes(btnClick) ? icons[btnClick || 'mode'] : btnClick ? icons.modeActive : icons.mode,
|
|
3473
|
+
onClick: ()=>{
|
|
3474
|
+
setBtnClick('');
|
|
3475
|
+
onStyleSourceClick('');
|
|
3476
|
+
},
|
|
3477
|
+
children: [
|
|
3478
|
+
/*#__PURE__*/ jsx(Space.Compact, {
|
|
3479
|
+
style: {
|
|
3480
|
+
backgroundColor: 'var(--ant-color-bg-container)',
|
|
3481
|
+
borderRadius: '8px 0 0 8px',
|
|
3482
|
+
height: 40,
|
|
3483
|
+
border: '1px solid var(--ant-color-border)',
|
|
3484
|
+
borderRight: 'none',
|
|
3485
|
+
boxShadow: '0 2px 0 rgba(255, 255, 255, 0.04)'
|
|
3486
|
+
},
|
|
3487
|
+
children: sourceBtns
|
|
3488
|
+
}),
|
|
3489
|
+
darkSourceItem && /*#__PURE__*/ jsx(FloatButton, {
|
|
3490
|
+
icon: icons.dark,
|
|
3491
|
+
tooltip: "暗黑",
|
|
3492
|
+
onClick: ()=>{
|
|
3493
|
+
setBtnClick('dark');
|
|
3494
|
+
darkSourceItem && onStyleSourceClick(darkSourceItem.name, darkSourceItem.source);
|
|
3495
|
+
}
|
|
3496
|
+
}),
|
|
3497
|
+
lightSourceItem && /*#__PURE__*/ jsx(FloatButton, {
|
|
3498
|
+
icon: icons.light,
|
|
3499
|
+
tooltip: "明亮",
|
|
3500
|
+
onClick: ()=>{
|
|
3501
|
+
setBtnClick('light');
|
|
3502
|
+
lightSourceItem && onStyleSourceClick(lightSourceItem.name, lightSourceItem.source);
|
|
3503
|
+
}
|
|
3504
|
+
}),
|
|
3505
|
+
lightSourceItem && darkSourceItem && /*#__PURE__*/ jsx(FloatButton, {
|
|
3506
|
+
icon: icons.none,
|
|
3507
|
+
tooltip: "跟随主题",
|
|
3508
|
+
onClick: ()=>{
|
|
3509
|
+
setBtnClick('');
|
|
3510
|
+
onStyleSourceClick('');
|
|
3511
|
+
}
|
|
3512
|
+
})
|
|
3513
|
+
]
|
|
3514
|
+
});
|
|
3515
|
+
};
|
|
3516
|
+
const ControlItems_StyleSources = StyleSources;
|
|
3517
|
+
const storeMapState = (tag, value)=>{
|
|
3518
|
+
localStorage.setItem(tag, value);
|
|
3519
|
+
};
|
|
3520
|
+
const getMapState = (tag)=>localStorage.getItem(tag);
|
|
3521
|
+
const getAllMapState = ()=>({
|
|
3522
|
+
mapStyleName: getMapState('mapStyleName'),
|
|
3523
|
+
mapXDMode: getMapState('mapXDMode')
|
|
3524
|
+
});
|
|
3525
|
+
const MaplessControlPanel = (props)=>{
|
|
3526
|
+
const { mapless, setMapState, children, positionMkr = {
|
|
3527
|
+
show: true
|
|
3528
|
+
}, lngLatTool = {
|
|
3529
|
+
show: true
|
|
3530
|
+
}, drawTool = {
|
|
3531
|
+
show: true
|
|
3532
|
+
}, selectTool = {
|
|
3533
|
+
show: true
|
|
3534
|
+
}, styleSwitcher = {
|
|
3535
|
+
show: true
|
|
3536
|
+
}, xdMode = {
|
|
3537
|
+
show: true
|
|
3538
|
+
}, mapOrigin = {
|
|
3539
|
+
show: true
|
|
3540
|
+
}, showHide = {
|
|
3541
|
+
show: false
|
|
3542
|
+
}, mapHand = {
|
|
3543
|
+
show: true
|
|
3544
|
+
}, showCategory = {
|
|
3545
|
+
show: false
|
|
3546
|
+
}, positionMus = {
|
|
3547
|
+
show: true
|
|
3548
|
+
} } = props;
|
|
3549
|
+
const [defaultStyleKey, setDefaultStyleKey] = useState('');
|
|
3550
|
+
const [curStyleKey, setCurStyleKey] = useState('');
|
|
3551
|
+
const onStyleKeyClick = useCallback((key, _source)=>{
|
|
3552
|
+
setCurStyleKey(key);
|
|
3553
|
+
setMapState?.('withStyleName', key);
|
|
3554
|
+
storeMapState('mapStyleName', key);
|
|
3555
|
+
}, [
|
|
3556
|
+
setMapState
|
|
3557
|
+
]);
|
|
3558
|
+
const [curXdMode, setCurXdMode] = useState('2d');
|
|
3559
|
+
const onXDModeClick = (mode)=>{
|
|
3560
|
+
setCurXdMode(mode);
|
|
3561
|
+
mapless?.toggleMode(mode);
|
|
3562
|
+
storeMapState('mapXDMode', mode);
|
|
3563
|
+
};
|
|
3564
|
+
useLayoutEffect(()=>{
|
|
3565
|
+
if (mapless) {
|
|
3566
|
+
const { mapStyleName, mapXDMode } = getAllMapState();
|
|
3567
|
+
const names = mapless.getStyleNames();
|
|
3568
|
+
if (mapStyleName && names.includes(mapStyleName)) {
|
|
3569
|
+
setCurStyleKey(mapStyleName);
|
|
3570
|
+
setDefaultStyleKey(mapStyleName);
|
|
3571
|
+
}
|
|
3572
|
+
if (mapXDMode) {
|
|
3573
|
+
setCurXdMode(mapXDMode);
|
|
3574
|
+
mapless?.toggleMode(mapXDMode);
|
|
3575
|
+
}
|
|
3576
|
+
}
|
|
3577
|
+
}, [
|
|
3578
|
+
mapless,
|
|
3579
|
+
setMapState
|
|
3580
|
+
]);
|
|
3581
|
+
const [mapHandleCount, setMapHandleCount] = useState(0);
|
|
3582
|
+
const onMapHandClick = ()=>{
|
|
3583
|
+
mapHand?.onClick?.();
|
|
3584
|
+
setMapHandleCount(mapHandleCount + 1);
|
|
3585
|
+
};
|
|
3586
|
+
const onMapOriginClick = ()=>{
|
|
3587
|
+
mapOrigin?.onClick ? mapOrigin?.onClick() : mapless?.flyTo({
|
|
3588
|
+
center: maplessPreset.DEFAULT_MAP_CENTER,
|
|
3589
|
+
zoom: maplessPreset.DEFAULT_MAP_ZOOM,
|
|
3590
|
+
speed: 1.5,
|
|
3591
|
+
curve: 1.5,
|
|
3592
|
+
essential: true
|
|
3593
|
+
});
|
|
3594
|
+
};
|
|
3595
|
+
const [category, setCategory] = useState('');
|
|
3596
|
+
function onCategoryClick(cate) {
|
|
3597
|
+
setCategory(cate);
|
|
3598
|
+
const sm1 = getOldStation(mapless, 'nsm1');
|
|
3599
|
+
if (sm1) {
|
|
3600
|
+
if ('' === cate) sm1.displayCategoryFilterFunc = void 0;
|
|
3601
|
+
if ('sensor' === cate) sm1.displayCategoryFilterFunc = (s)=>'Sensor' === s.category;
|
|
3602
|
+
if ('station' === cate) sm1.displayCategoryFilterFunc = (s)=>'Sensor' !== s.category;
|
|
3603
|
+
sm1.drawStations(sm1.getStations());
|
|
3604
|
+
}
|
|
3605
|
+
}
|
|
3606
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
3607
|
+
children: [
|
|
3608
|
+
/*#__PURE__*/ jsxs("div", {
|
|
3609
|
+
className: components_index_module.ctrls,
|
|
3610
|
+
children: [
|
|
3611
|
+
positionMkr.show && /*#__PURE__*/ jsx(ControlItems_PositionMkr, {
|
|
3612
|
+
reset: mapHandleCount,
|
|
3613
|
+
mapless: mapless
|
|
3614
|
+
}),
|
|
3615
|
+
lngLatTool.show && /*#__PURE__*/ jsx(ControlItems_LngLat, {
|
|
3616
|
+
mapless: mapless
|
|
3617
|
+
}),
|
|
3618
|
+
drawTool.show && /*#__PURE__*/ jsx(ControlItems_DrawTool, {
|
|
3619
|
+
reset: mapHandleCount,
|
|
3620
|
+
mapless: mapless
|
|
3621
|
+
}),
|
|
3622
|
+
selectTool.show && /*#__PURE__*/ jsx(ControlItems_SelectTool, {
|
|
3623
|
+
reset: mapHandleCount,
|
|
3624
|
+
mapless: mapless,
|
|
3625
|
+
disabled: selectTool?.disabled,
|
|
3626
|
+
statioinFuncPrefix: selectTool?.statioinFuncPrefix,
|
|
3627
|
+
relativeManagerIds: selectTool?.relativeManagerIds,
|
|
3628
|
+
onSelectionChange: selectTool?.onSelectionChange,
|
|
3629
|
+
children: selectTool?.children
|
|
3630
|
+
}),
|
|
3631
|
+
styleSwitcher.show && /*#__PURE__*/ jsxs(Fragment, {
|
|
3632
|
+
children: [
|
|
3633
|
+
/*#__PURE__*/ jsx(ControlItems_StyleNames, {
|
|
3634
|
+
styleName: curStyleKey,
|
|
3635
|
+
onStyleNameClick: onStyleKeyClick
|
|
3636
|
+
}),
|
|
3637
|
+
/*#__PURE__*/ jsx(ControlItems_StyleSources, {
|
|
3638
|
+
defaultStyleSource: defaultStyleKey,
|
|
3639
|
+
styleSource: curStyleKey,
|
|
3640
|
+
onStyleSourceClick: onStyleKeyClick
|
|
3641
|
+
})
|
|
3642
|
+
]
|
|
3643
|
+
}),
|
|
3644
|
+
xdMode.show && /*#__PURE__*/ jsx(_2D3D, {
|
|
3645
|
+
mode: curXdMode,
|
|
3646
|
+
onModeClick: onXDModeClick
|
|
3647
|
+
}),
|
|
3648
|
+
mapOrigin.show && /*#__PURE__*/ jsx(ControlItems_MapOrigin, {
|
|
3649
|
+
onClick: onMapOriginClick
|
|
3650
|
+
}),
|
|
3651
|
+
showHide?.show && /*#__PURE__*/ jsx(ControlItems_ShowHide, {
|
|
3652
|
+
manaId: showHide.manaId,
|
|
3653
|
+
mapless: mapless
|
|
3654
|
+
}),
|
|
3655
|
+
mapHand.show && /*#__PURE__*/ jsx(ControlItems_MapHand, {
|
|
3656
|
+
onClick: onMapHandClick
|
|
3657
|
+
}),
|
|
3658
|
+
showCategory.show && /*#__PURE__*/ jsx(ControlItems_ShowCategory, {
|
|
3659
|
+
category: category,
|
|
3660
|
+
onCategoryClick: onCategoryClick
|
|
3661
|
+
}),
|
|
3662
|
+
children
|
|
3663
|
+
]
|
|
3664
|
+
}),
|
|
3665
|
+
positionMus.show && /*#__PURE__*/ jsx(ControlItems_PositionMus, {
|
|
3666
|
+
mapless: mapless
|
|
3667
|
+
})
|
|
3668
|
+
]
|
|
3669
|
+
});
|
|
3670
|
+
};
|
|
3671
|
+
const MaplessControlPanel_MaplessControlPanel = MaplessControlPanel;
|
|
3672
|
+
const WithMap_components = MaplessControlPanel_MaplessControlPanel;
|
|
3673
|
+
const with_module = {
|
|
3674
|
+
MapView: "MapView-fi1Gvm",
|
|
3675
|
+
mapView: "MapView-fi1Gvm",
|
|
3676
|
+
map: "map-pTJfGL"
|
|
3677
|
+
};
|
|
3678
|
+
const DZ_MAP_STYLE_NAMES = [
|
|
3679
|
+
'dz_satellite',
|
|
3680
|
+
'dz_streets',
|
|
3681
|
+
'dz_cyber',
|
|
3682
|
+
'dz_light',
|
|
3683
|
+
'dz_dark'
|
|
3684
|
+
];
|
|
3685
|
+
const WithMapBase = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
3686
|
+
const { mapStyle, defaultThemeMode, themeMode, localeKey, resizable = false, children } = props;
|
|
3687
|
+
const [maplessInstance, setMaplessInstance] = useState();
|
|
3688
|
+
const [isMapReady, setIsMapReady] = useState(false);
|
|
3689
|
+
const maplessInstanceRef = useRef(void 0);
|
|
3690
|
+
const mapviewRef = useRef(null);
|
|
3691
|
+
const mapContainerRef = useRef(null);
|
|
3692
|
+
hooks_useSize({
|
|
3693
|
+
resizable,
|
|
3694
|
+
mapviewRef,
|
|
3695
|
+
mapContainer: mapContainerRef,
|
|
3696
|
+
maplessInstanceRef: maplessInstanceRef
|
|
3697
|
+
});
|
|
3698
|
+
const langRef = useRef(void 0);
|
|
3699
|
+
const localeKeyRef = useRef(localeKey);
|
|
3700
|
+
const lastMapStyleNameRef = useRef(void 0);
|
|
3701
|
+
const innerThemeModeRef = useRef(themeMode || defaultThemeMode);
|
|
3702
|
+
const [withStyle, setWithStyle] = useState('');
|
|
3703
|
+
useImperativeHandle(ref, ()=>({
|
|
3704
|
+
setMapState: (key, value)=>{
|
|
3705
|
+
if ('withStyleName' === key) setWithStyle(value);
|
|
3706
|
+
}
|
|
3707
|
+
}));
|
|
3708
|
+
useEffect(()=>{
|
|
3709
|
+
if (themeMode && themeMode !== innerThemeModeRef.current) innerThemeModeRef.current = themeMode;
|
|
3710
|
+
if (maplessInstance) {
|
|
3711
|
+
const handleStyle = langRef.current?.getLangStyle.bind(langRef.current);
|
|
3712
|
+
const mapStyleName = getStyleName();
|
|
3713
|
+
if (mapStyleName && lastMapStyleNameRef.current !== mapStyleName) {
|
|
3714
|
+
maplessInstance.setStyle(mapStyleName, handleStyle);
|
|
3715
|
+
lastMapStyleNameRef.current = mapStyleName;
|
|
3716
|
+
}
|
|
3717
|
+
}
|
|
3718
|
+
}, [
|
|
3719
|
+
themeMode,
|
|
3720
|
+
mapStyle,
|
|
3721
|
+
withStyle
|
|
3722
|
+
]);
|
|
3723
|
+
useEffect(()=>{
|
|
3724
|
+
if (localeKeyRef.current !== localeKey) {
|
|
3725
|
+
localeKeyRef.current = localeKey;
|
|
3726
|
+
const langStr = 'zh-CN' === localeKeyRef.current ? 'nonlatin' : 'latin';
|
|
3727
|
+
langRef.current?.switchDzmapLang(langStr);
|
|
3728
|
+
}
|
|
3729
|
+
}, [
|
|
3730
|
+
localeKey
|
|
3731
|
+
]);
|
|
3732
|
+
const getStyleName = useCallback((preset)=>{
|
|
3733
|
+
let mapStyleName = preset || withStyle || mapStyle;
|
|
3734
|
+
if (maplessPreset.IS_MAP_THEME_SOURCES) {
|
|
3735
|
+
if (innerThemeModeRef.current && !mapStyleName) mapStyleName = ('dark' === innerThemeModeRef.current ? darkSource()?.name : lightSource()?.name) || defaultSource()?.name || '';
|
|
3736
|
+
} else {
|
|
3737
|
+
mapStyleName = mapStyleName || 'streets';
|
|
3738
|
+
if (!DZ_MAP_STYLE_NAMES.includes(mapStyleName.toString())) mapStyleName = 'dark' === innerThemeModeRef.current ? 'dz_dark' : 'dz_streets';
|
|
3739
|
+
}
|
|
3740
|
+
return mapStyleName;
|
|
3741
|
+
}, [
|
|
3742
|
+
mapStyle,
|
|
3743
|
+
withStyle
|
|
3744
|
+
]);
|
|
3745
|
+
useEffect(()=>{
|
|
3746
|
+
if (!mapContainerRef.current) return;
|
|
3747
|
+
const { mapStyleName: storeMapStyleName } = getAllMapState();
|
|
3748
|
+
if (storeMapStyleName) setWithStyle(storeMapStyleName);
|
|
3749
|
+
const mapStyleName = getStyleName(storeMapStyleName);
|
|
3750
|
+
const instance = new Mapless(mapContainerRef.current, {
|
|
3751
|
+
accessToken: props.accessToken,
|
|
3752
|
+
style: mapStyleName,
|
|
3753
|
+
center: props.center || maplessPreset.DEFAULT_MAP_CENTER,
|
|
3754
|
+
zoom: props.zoom || maplessPreset.DEFAULT_MAP_ZOOM,
|
|
3755
|
+
onMapInit () {
|
|
3756
|
+
props.onChange?.({
|
|
3757
|
+
type: 'init',
|
|
3758
|
+
target: instance
|
|
3759
|
+
});
|
|
3760
|
+
const langStr = 'zh-CN' === localeKeyRef.current ? 'nonlatin' : 'latin';
|
|
3761
|
+
langRef.current = new Lang(instance, langStr, ':');
|
|
3762
|
+
},
|
|
3763
|
+
onMapReady () {
|
|
3764
|
+
setMaplessInstance(instance);
|
|
3765
|
+
maplessInstanceRef.current = instance;
|
|
3766
|
+
setIsMapReady(true);
|
|
3767
|
+
props.onChange?.({
|
|
3768
|
+
type: 'ready',
|
|
3769
|
+
target: instance
|
|
3770
|
+
});
|
|
3771
|
+
},
|
|
3772
|
+
onMapZoom (zoom) {
|
|
3773
|
+
props.onChange?.({
|
|
3774
|
+
type: 'zoom',
|
|
3775
|
+
target: instance,
|
|
3776
|
+
others: {
|
|
3777
|
+
zoom
|
|
3778
|
+
}
|
|
3779
|
+
});
|
|
3780
|
+
}
|
|
3781
|
+
});
|
|
3782
|
+
return ()=>{
|
|
3783
|
+
try {
|
|
3784
|
+
instance.destroy();
|
|
3785
|
+
setMaplessInstance(void 0);
|
|
3786
|
+
maplessInstanceRef.current = void 0;
|
|
3787
|
+
} catch (error) {
|
|
3788
|
+
console.error('Mapless instance destroy error:', error);
|
|
3789
|
+
}
|
|
3790
|
+
};
|
|
3791
|
+
}, [
|
|
3792
|
+
props.accessToken
|
|
3793
|
+
]);
|
|
3794
|
+
return /*#__PURE__*/ jsx(MapContext.Provider, {
|
|
3795
|
+
value: {
|
|
3796
|
+
mapless: maplessInstance,
|
|
3797
|
+
isMapReady
|
|
3798
|
+
},
|
|
3799
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
3800
|
+
ref: mapviewRef,
|
|
3801
|
+
className: `${with_module.MapView} ${popup_module["map-popup"]} ${props.className}`,
|
|
3802
|
+
style: props.style,
|
|
3803
|
+
children: [
|
|
3804
|
+
/*#__PURE__*/ jsx("div", {
|
|
3805
|
+
ref: mapContainerRef,
|
|
3806
|
+
className: with_module.map
|
|
3807
|
+
}),
|
|
3808
|
+
children
|
|
3809
|
+
]
|
|
3810
|
+
})
|
|
3811
|
+
});
|
|
3812
|
+
});
|
|
3813
|
+
const WithMap_WithMapBase = WithMapBase;
|
|
3814
|
+
function withMapboxMarker(WrappedComponent) {
|
|
3815
|
+
const Component = ({ mapless, isMapReady, manaName, onEvent, excludeManaNames = [
|
|
3816
|
+
'SelectTool'
|
|
3817
|
+
], eventName = 'stationsSelected', destroyOnClose = false, markerClassName, onClose, ...rest })=>{
|
|
3818
|
+
const markerRef = useRef(null);
|
|
3819
|
+
const maplessRef = useRef(void 0);
|
|
3820
|
+
const [contentProps, setContentProps] = useState(null);
|
|
3821
|
+
const [position, setPosition] = useState(null);
|
|
3822
|
+
const handleEvent = (...payload)=>{
|
|
3823
|
+
const eventData = payload[0];
|
|
3824
|
+
if (eventData.sourceName && excludeManaNames.includes(eventData.sourceName)) return null;
|
|
3825
|
+
const result = onEvent?.(eventData);
|
|
3826
|
+
if (result) {
|
|
3827
|
+
setContentProps(result.props);
|
|
3828
|
+
setPosition(result.lngLat);
|
|
3829
|
+
markerRef.current?.show();
|
|
3830
|
+
setHide(false);
|
|
3831
|
+
} else {
|
|
3832
|
+
setContentProps(null);
|
|
3833
|
+
setPosition(null);
|
|
3834
|
+
}
|
|
3835
|
+
};
|
|
3836
|
+
useEffect(()=>{
|
|
3837
|
+
if (!isMapReady || !mapless || !manaName) return;
|
|
3838
|
+
maplessRef.current = mapless;
|
|
3839
|
+
mapless.onManaAdd((name, manager)=>{
|
|
3840
|
+
if (name === manaName) manager.on(eventName, handleEvent);
|
|
3841
|
+
});
|
|
3842
|
+
return ()=>{};
|
|
3843
|
+
}, [
|
|
3844
|
+
isMapReady,
|
|
3845
|
+
mapless,
|
|
3846
|
+
manaName,
|
|
3847
|
+
eventName,
|
|
3848
|
+
onEvent
|
|
3849
|
+
]);
|
|
3850
|
+
const [hide, setHide] = useState(false);
|
|
3851
|
+
const close = ()=>{
|
|
3852
|
+
setHide(true);
|
|
3853
|
+
markerRef.current?.hide();
|
|
3854
|
+
mapless?.setOpacity(1);
|
|
3855
|
+
onClose?.();
|
|
3856
|
+
};
|
|
3857
|
+
return /*#__PURE__*/ jsx(components_MapboxMarker_MapboxMarker, {
|
|
3858
|
+
ref: markerRef,
|
|
3859
|
+
lngLat: position,
|
|
3860
|
+
maplessRef: maplessRef,
|
|
3861
|
+
className: markerClassName,
|
|
3862
|
+
transparent: true,
|
|
3863
|
+
children: destroyOnClose && hide ? void 0 : contentProps && /*#__PURE__*/ jsx(WrappedComponent, {
|
|
3864
|
+
...rest,
|
|
3865
|
+
...contentProps,
|
|
3866
|
+
onClose: close
|
|
3867
|
+
})
|
|
3868
|
+
});
|
|
3869
|
+
};
|
|
3870
|
+
Component.displayName = `withMapboxMarker(${WrappedComponent.displayName || WrappedComponent.name})`;
|
|
3871
|
+
return Component;
|
|
3872
|
+
}
|
|
3873
|
+
const with_withMapboxMarker = withMapboxMarker;
|
|
3874
|
+
function withMapboxPopup(WrappedComponent) {
|
|
3875
|
+
const Component = ({ mapless, isMapReady, manaName, onEvent, excludeManaNames = [
|
|
3876
|
+
'SelectTool'
|
|
3877
|
+
], eventName = 'stationsSelected', destroyOnClose = false, ...rest })=>{
|
|
3878
|
+
const popupRef = useRef(null);
|
|
3879
|
+
const maplessRef = useRef(void 0);
|
|
3880
|
+
const [contentProps, setContentProps] = useState(null);
|
|
3881
|
+
const [position, setPosition] = useState(null);
|
|
3882
|
+
const handleStationSelected = (...payload)=>{
|
|
3883
|
+
if (!onEvent) return;
|
|
3884
|
+
const eventData = payload[0];
|
|
3885
|
+
if (eventData.sourceName && excludeManaNames.includes(eventData.sourceName)) return null;
|
|
3886
|
+
if ((eventData.datas?.length || 0) <= 1) {
|
|
3887
|
+
mapless?.setOpacity(1);
|
|
3888
|
+
const result = onEvent(eventData);
|
|
3889
|
+
if (result) {
|
|
3890
|
+
setContentProps(result.props);
|
|
3891
|
+
setPosition(result.lngLat);
|
|
3892
|
+
popupRef.current?.show();
|
|
3893
|
+
setHide(false);
|
|
3894
|
+
} else {
|
|
3895
|
+
setContentProps(null);
|
|
3896
|
+
setPosition(null);
|
|
3897
|
+
}
|
|
3898
|
+
}
|
|
3899
|
+
};
|
|
3900
|
+
useEffect(()=>{
|
|
3901
|
+
if (!isMapReady || !mapless || !manaName) return;
|
|
3902
|
+
maplessRef.current = mapless;
|
|
3903
|
+
mapless.onManaAdd((name, manager)=>{
|
|
3904
|
+
if (name === manaName) manager.on(eventName, handleStationSelected);
|
|
3905
|
+
});
|
|
3906
|
+
return ()=>{};
|
|
3907
|
+
}, [
|
|
3908
|
+
isMapReady,
|
|
3909
|
+
mapless,
|
|
3910
|
+
manaName,
|
|
3911
|
+
eventName,
|
|
3912
|
+
onEvent
|
|
3913
|
+
]);
|
|
3914
|
+
const [hide, setHide] = useState(false);
|
|
3915
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
3916
|
+
children: [
|
|
3917
|
+
/*#__PURE__*/ jsx(components_MapboxPopup_MapboxPopup, {
|
|
3918
|
+
ref: popupRef,
|
|
3919
|
+
lngLat: position,
|
|
3920
|
+
maplessRef: maplessRef,
|
|
3921
|
+
onClose: ()=>{
|
|
3922
|
+
setHide(true);
|
|
3923
|
+
},
|
|
3924
|
+
children: destroyOnClose && hide ? void 0 : contentProps && /*#__PURE__*/ jsx(WrappedComponent, {
|
|
3925
|
+
...rest,
|
|
3926
|
+
...contentProps
|
|
3927
|
+
})
|
|
3928
|
+
}),
|
|
3929
|
+
/*#__PURE__*/ jsx(StationsClickPanelMarker, {
|
|
3930
|
+
mapless: mapless,
|
|
3931
|
+
isMapReady: isMapReady,
|
|
3932
|
+
stations: [],
|
|
3933
|
+
manaName: manaName,
|
|
3934
|
+
destroyOnClose: true,
|
|
3935
|
+
onSelected: (ss)=>{
|
|
3936
|
+
handleStationSelected({
|
|
3937
|
+
sourceName: manaName,
|
|
3938
|
+
datas: ss,
|
|
3939
|
+
stations: ss
|
|
3940
|
+
});
|
|
3941
|
+
mapless?.setOpacity(1);
|
|
3942
|
+
},
|
|
3943
|
+
onEvent: (e)=>{
|
|
3944
|
+
if ((e.datas?.length || 0) > 1) {
|
|
3945
|
+
const manaInstance = mapless?.getByName(manaName);
|
|
3946
|
+
const datas = manaInstance?.getDatas();
|
|
3947
|
+
setContentProps(null);
|
|
3948
|
+
setPosition(null);
|
|
3949
|
+
popupRef.current?.hide();
|
|
3950
|
+
if (datas?.length > 1) mapless?.setOpacity(0.5);
|
|
3951
|
+
else mapless?.setOpacity(1);
|
|
3952
|
+
return onDefaultEvent(e, datas);
|
|
3953
|
+
}
|
|
3954
|
+
return null;
|
|
3955
|
+
}
|
|
3956
|
+
})
|
|
3957
|
+
]
|
|
3958
|
+
});
|
|
3959
|
+
};
|
|
3960
|
+
Component.displayName = `withMapboxPopup(${WrappedComponent.displayName || WrappedComponent.name})`;
|
|
3961
|
+
return Component;
|
|
3962
|
+
}
|
|
3963
|
+
const with_withMapboxPopup = withMapboxPopup;
|
|
3964
|
+
const StationClickPanelMarker = with_withMapboxMarker(components_StationsClickPanel_StationsClickPanel);
|
|
3965
|
+
const StationsClickPanelMarker = StationClickPanelMarker;
|
|
3966
|
+
const onDefaultEvent = (e, stations)=>{
|
|
3967
|
+
const ss = stations?.filter((item)=>e.stations?.some((s)=>s.id === item.id));
|
|
3968
|
+
if (!ss) return null;
|
|
3969
|
+
const sum = ss.reduce((acc, { longitude, latitude })=>{
|
|
3970
|
+
acc.lng += Number(longitude);
|
|
3971
|
+
acc.lat += Number(latitude);
|
|
3972
|
+
return acc;
|
|
3973
|
+
}, {
|
|
3974
|
+
lng: 0,
|
|
3975
|
+
lat: 0
|
|
3976
|
+
});
|
|
3977
|
+
const center = [
|
|
3978
|
+
sum.lng / ss.length,
|
|
3979
|
+
sum.lat / ss.length
|
|
3980
|
+
];
|
|
3981
|
+
return {
|
|
3982
|
+
props: {
|
|
3983
|
+
stations: ss
|
|
3984
|
+
},
|
|
3985
|
+
lngLat: center
|
|
3986
|
+
};
|
|
3987
|
+
};
|
|
3988
|
+
const TestPopup_index_module = {
|
|
3989
|
+
"react-popup": "react-popup-OsHQU0",
|
|
3990
|
+
reactPopup: "react-popup-OsHQU0"
|
|
3991
|
+
};
|
|
3992
|
+
const TestPopup_MapboxPopup = ({ children, lngLat })=>{
|
|
3993
|
+
const { mapless, isMapReady } = useContext(MapContext);
|
|
3994
|
+
useEffect(()=>{
|
|
3995
|
+
if (!mapless?.map || !isMapReady) return;
|
|
3996
|
+
const popup = new Popup({
|
|
3997
|
+
closeOnMove: false,
|
|
3998
|
+
closeOnClick: false,
|
|
3999
|
+
className: TestPopup_index_module["react-popup"],
|
|
4000
|
+
focusAfterOpen: false
|
|
4001
|
+
}).setLngLat(lngLat).addTo(mapless.map).setHTML('<p>Hello, Mapbox!</p>');
|
|
4002
|
+
return ()=>{
|
|
4003
|
+
popup.remove();
|
|
4004
|
+
};
|
|
4005
|
+
}, [
|
|
4006
|
+
mapless,
|
|
4007
|
+
isMapReady,
|
|
4008
|
+
lngLat
|
|
4009
|
+
]);
|
|
4010
|
+
return children;
|
|
4011
|
+
};
|
|
4012
|
+
function TestPopup_isEqual(prev, next) {
|
|
4013
|
+
return JSON.stringify(prev.lngLat) === JSON.stringify(next.lngLat) && prev.children === next.children;
|
|
4014
|
+
}
|
|
4015
|
+
const TestPopup_TestPopup = /*#__PURE__*/ memo(TestPopup_MapboxPopup, TestPopup_isEqual);
|
|
4016
|
+
const CoordSystemTransDemo = ()=>{
|
|
4017
|
+
const handleTransform = (result)=>{
|
|
4018
|
+
console.log(result);
|
|
4019
|
+
};
|
|
4020
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
4021
|
+
style: {
|
|
4022
|
+
width: '400px',
|
|
4023
|
+
display: 'flex',
|
|
4024
|
+
flexDirection: 'column'
|
|
4025
|
+
},
|
|
4026
|
+
children: [
|
|
4027
|
+
/*#__PURE__*/ jsx("h2", {
|
|
4028
|
+
children: "坐标系统转换组件演示"
|
|
4029
|
+
}),
|
|
4030
|
+
/*#__PURE__*/ jsx("div", {
|
|
4031
|
+
style: {
|
|
4032
|
+
flex: 1
|
|
4033
|
+
},
|
|
4034
|
+
children: /*#__PURE__*/ jsx(CoordSystemTrans, {
|
|
4035
|
+
initialSourceSystem: "wgs84",
|
|
4036
|
+
initialTargetSystem: "gcj02",
|
|
4037
|
+
onTransform: handleTransform
|
|
4038
|
+
})
|
|
4039
|
+
}),
|
|
4040
|
+
/*#__PURE__*/ jsxs("div", {
|
|
4041
|
+
style: {
|
|
4042
|
+
marginTop: '20px',
|
|
4043
|
+
fontSize: '14px',
|
|
4044
|
+
color: '#666',
|
|
4045
|
+
height: '240px',
|
|
4046
|
+
overflowY: 'auto'
|
|
4047
|
+
},
|
|
4048
|
+
children: [
|
|
4049
|
+
/*#__PURE__*/ jsx("h3", {
|
|
4050
|
+
children: "支持的输入格式示例:"
|
|
4051
|
+
}),
|
|
4052
|
+
/*#__PURE__*/ jsxs("ul", {
|
|
4053
|
+
children: [
|
|
4054
|
+
/*#__PURE__*/ jsxs("li", {
|
|
4055
|
+
children: [
|
|
4056
|
+
/*#__PURE__*/ jsx("strong", {
|
|
4057
|
+
children: "经度,纬度:"
|
|
4058
|
+
}),
|
|
4059
|
+
" 114.56,30.2"
|
|
4060
|
+
]
|
|
4061
|
+
}),
|
|
4062
|
+
/*#__PURE__*/ jsxs("li", {
|
|
4063
|
+
children: [
|
|
4064
|
+
/*#__PURE__*/ jsx("strong", {
|
|
4065
|
+
children: "纬度,经度:"
|
|
4066
|
+
}),
|
|
4067
|
+
" 30.2,114.56"
|
|
4068
|
+
]
|
|
4069
|
+
}),
|
|
4070
|
+
/*#__PURE__*/ jsxs("li", {
|
|
4071
|
+
children: [
|
|
4072
|
+
/*#__PURE__*/ jsx("strong", {
|
|
4073
|
+
children: "经度 纬度:"
|
|
4074
|
+
}),
|
|
4075
|
+
" 114.56 30.2"
|
|
4076
|
+
]
|
|
4077
|
+
}),
|
|
4078
|
+
/*#__PURE__*/ jsxs("li", {
|
|
4079
|
+
children: [
|
|
4080
|
+
/*#__PURE__*/ jsx("strong", {
|
|
4081
|
+
children: "纬度 经度:"
|
|
4082
|
+
}),
|
|
4083
|
+
" 30.2 114.56"
|
|
4084
|
+
]
|
|
4085
|
+
}),
|
|
4086
|
+
/*#__PURE__*/ jsxs("li", {
|
|
4087
|
+
children: [
|
|
4088
|
+
/*#__PURE__*/ jsx("strong", {
|
|
4089
|
+
children: "经度\xb0纬度\xb0:"
|
|
4090
|
+
}),
|
|
4091
|
+
" 114.56\xb030.2\xb0"
|
|
4092
|
+
]
|
|
4093
|
+
}),
|
|
4094
|
+
/*#__PURE__*/ jsxs("li", {
|
|
4095
|
+
children: [
|
|
4096
|
+
/*#__PURE__*/ jsx("strong", {
|
|
4097
|
+
children: "纬度\xb0经度\xb0:"
|
|
4098
|
+
}),
|
|
4099
|
+
" 30.2\xb0114.56\xb0"
|
|
4100
|
+
]
|
|
4101
|
+
}),
|
|
4102
|
+
/*#__PURE__*/ jsxs("li", {
|
|
4103
|
+
children: [
|
|
4104
|
+
/*#__PURE__*/ jsx("strong", {
|
|
4105
|
+
children: "经度\xb0 纬度\xb0:"
|
|
4106
|
+
}),
|
|
4107
|
+
" 114.56\xb0 30.2\xb0"
|
|
4108
|
+
]
|
|
4109
|
+
}),
|
|
4110
|
+
/*#__PURE__*/ jsxs("li", {
|
|
4111
|
+
children: [
|
|
4112
|
+
/*#__PURE__*/ jsx("strong", {
|
|
4113
|
+
children: "纬度\xb0 经度\xb0:"
|
|
4114
|
+
}),
|
|
4115
|
+
" 30.2\xb0 114.56\xb0"
|
|
4116
|
+
]
|
|
4117
|
+
})
|
|
4118
|
+
]
|
|
4119
|
+
}),
|
|
4120
|
+
/*#__PURE__*/ jsx("h3", {
|
|
4121
|
+
children: "支持的坐标系:"
|
|
4122
|
+
}),
|
|
4123
|
+
/*#__PURE__*/ jsxs("ul", {
|
|
4124
|
+
children: [
|
|
4125
|
+
/*#__PURE__*/ jsxs("li", {
|
|
4126
|
+
children: [
|
|
4127
|
+
/*#__PURE__*/ jsx("strong", {
|
|
4128
|
+
children: "WGS84:"
|
|
4129
|
+
}),
|
|
4130
|
+
" GPS标准坐标系"
|
|
4131
|
+
]
|
|
4132
|
+
}),
|
|
4133
|
+
/*#__PURE__*/ jsxs("li", {
|
|
4134
|
+
children: [
|
|
4135
|
+
/*#__PURE__*/ jsx("strong", {
|
|
4136
|
+
children: "GCJ-02:"
|
|
4137
|
+
}),
|
|
4138
|
+
" 火星坐标系(高德、腾讯地图)"
|
|
4139
|
+
]
|
|
4140
|
+
}),
|
|
4141
|
+
/*#__PURE__*/ jsxs("li", {
|
|
4142
|
+
children: [
|
|
4143
|
+
/*#__PURE__*/ jsx("strong", {
|
|
4144
|
+
children: "BD-09:"
|
|
4145
|
+
}),
|
|
4146
|
+
" 百度坐标系"
|
|
4147
|
+
]
|
|
4148
|
+
})
|
|
4149
|
+
]
|
|
4150
|
+
})
|
|
4151
|
+
]
|
|
4152
|
+
})
|
|
4153
|
+
]
|
|
4154
|
+
});
|
|
4155
|
+
};
|
|
4156
|
+
export { CoordSystemTrans, CoordSystemTransDemo, CoordinateInput, CoordinateParser, components_CoordinateTrans_CoordinateTrans as CoordinateTrans, DZ_MAP_STYLE_NAMES, DraggableMarker_DraggableMarker as DraggableMarker, ErrorBoundary_ErrorBoundary as ErrorBoundary, Float, Format, components_FormatChange as FormatChange, src_MapView as MapView, components_MapboxMarker_MapboxMarker as MapboxMarker, components_MapboxPopup_MapboxPopup as MapboxPopup, WithMap_components as MaplessControlPanel, StationMana, StationsClickPanelMarker, TestPopup_TestPopup as TestPopup, WithMap_WithMapBase as WithMapBase, _2D as _2dSvg, _3D as _3dSvg, Angle as angleSvg, Area as areaSvg, CircleSelect as circleSelectSvg, Copy as copySvg, Cyber as cyberSvg, degree2DM, degree2DMS, FreedomSelect as freedomSelectSvg, getAllMapState, getDDMM, getDDMMSS, getFloat, getFormatStr, getMapState, getNextFormat, GetPosition as getPositionSvg, gps2Degree, Hand as handSvg, Line as lineSvg, generated_Marker as markerSvg, Measure as measureSvg, Mode as modeSvg, onDefaultEvent, OriginPosition as originPositionSvg, Point as pointSvg, PointerSelect as pointerSelectSvg, Receiver as receiverSvg, RectangleSelect as rectangleSelectSvg, Satellite as satelliteSvg, SelectTool as selectToolSvg, storeMapState, Streets as streetsSvg, hooks_useCoordSystem as useCoordSystem, hooks_useSize as useSize, hooks_useTest as useTest, with_withMapboxMarker as withMapboxMarker, with_withMapboxPopup as withMapboxPopup };
|