@fleet-frontend/mower-maps 0.2.5-beta.7 → 0.2.5-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/dist/context/common.d.ts +37 -2
- package/dist/context/common.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +549 -130
- package/dist/index.js +548 -129
- package/dist/render/MowerMapRenderer.d.ts.map +1 -1
- package/dist/render/Overlay/overlayView.d.ts +1 -1
- package/dist/render/Overlay/overlayView.d.ts.map +1 -1
- package/dist/render/boundaryLabels/index.d.ts +1 -1
- package/dist/render/boundaryLabels/index.d.ts.map +1 -1
- package/dist/render/charginPile/index.d.ts +3 -1
- package/dist/render/charginPile/index.d.ts.map +1 -1
- package/dist/render/svgElement/PolygonELement/components/Magnifier/index.d.ts +41 -0
- package/dist/render/svgElement/PolygonELement/components/Magnifier/index.d.ts.map +1 -0
- package/dist/render/svgElement/PolygonELement/index.d.ts.map +1 -1
- package/dist/types/renderer.d.ts +22 -0
- package/dist/types/renderer.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -13905,6 +13905,16 @@ var CheckDoodleErrorType;
|
|
|
13905
13905
|
// doodle与其他元素距离过近
|
|
13906
13906
|
CheckDoodleErrorType["DOODLE_DISTANCE_TOO_CLOSE_TO_OTHER_ELEMENT"] = "doodle_distance_too_close_to_other_element";
|
|
13907
13907
|
})(CheckDoodleErrorType || (CheckDoodleErrorType = {}));
|
|
13908
|
+
var MapType;
|
|
13909
|
+
(function (MapType) {
|
|
13910
|
+
// 普通地图
|
|
13911
|
+
MapType["NORMAL"] = "normal";
|
|
13912
|
+
/**
|
|
13913
|
+
* 主要是用在地理围栏相关的
|
|
13914
|
+
* 此地图没有分区名称气泡,没有孤立子地块,没有设备图标,没有天线
|
|
13915
|
+
*/
|
|
13916
|
+
MapType["GEO_FENCE"] = "geo-fence";
|
|
13917
|
+
})(MapType || (MapType = {}));
|
|
13908
13918
|
|
|
13909
13919
|
var RealTimeDataType;
|
|
13910
13920
|
(function (RealTimeDataType) {
|
|
@@ -19821,7 +19831,9 @@ function OverlayViewFunctional({ map, position, bounds, rotate, mapPaneName, zIn
|
|
|
19821
19831
|
}, [map, overlay]);
|
|
19822
19832
|
// to move the container to the foreground and background
|
|
19823
19833
|
useEffect(() => {
|
|
19824
|
-
|
|
19834
|
+
if (zIndex) {
|
|
19835
|
+
container.style.zIndex = `${zIndex}`;
|
|
19836
|
+
}
|
|
19825
19837
|
}, [zIndex, container]);
|
|
19826
19838
|
return ReactDOM.createPortal(children, container);
|
|
19827
19839
|
}
|
|
@@ -22648,15 +22660,25 @@ var index = {
|
|
|
22648
22660
|
const CommonContext = createContext({
|
|
22649
22661
|
sn: '',
|
|
22650
22662
|
editMap: false,
|
|
22651
|
-
mowerIconConfig: {
|
|
22663
|
+
mowerIconConfig: {
|
|
22664
|
+
mapImgUrl: '',
|
|
22665
|
+
mapDisabledUrl: '',
|
|
22666
|
+
mapNoPositionUrl: '',
|
|
22667
|
+
},
|
|
22652
22668
|
platform: PlatformType.WEB,
|
|
22653
22669
|
svgViewBox: null,
|
|
22654
22670
|
unitType: UnitsType.Metric,
|
|
22671
|
+
mapConfig: {},
|
|
22672
|
+
mapJson: null,
|
|
22673
|
+
drag: { x: 0, y: 0, rotate: 0, rotation: 0 },
|
|
22655
22674
|
mapRef: null,
|
|
22675
|
+
bounds: null,
|
|
22656
22676
|
globalHeight: 0,
|
|
22657
22677
|
heightOptions: [],
|
|
22658
22678
|
overlayScale: 1,
|
|
22659
22679
|
showStraddleBoundaryBorder: true,
|
|
22680
|
+
googleMapStaticApiKey: '',
|
|
22681
|
+
onH5FirstSelectObstaclePoint: undefined,
|
|
22660
22682
|
});
|
|
22661
22683
|
const CommonContextProvider = CommonContext.Provider;
|
|
22662
22684
|
const useCommonContext = () => useContext(CommonContext);
|
|
@@ -23088,10 +23110,6 @@ const DistanceLabels = ({ coordinates, createMode = false, editMode = false, com
|
|
|
23088
23110
|
} }))] }));
|
|
23089
23111
|
};
|
|
23090
23112
|
|
|
23091
|
-
var css_248z$6 = ".index-module_pointerCursor__Ee6pr {\n cursor: pointer;\n}\n\n.index-module_polygonPath__PynOn {\n pointer-events: stroke;\n cursor: pointer;\n}\n\n.index-module_dragging__xSFdO {\n cursor: grabbing;\n}\n\n.index-module_notCreate__bFnkV {\n cursor: no-drop;\n}";
|
|
23092
|
-
var styles$6 = {"pointerCursor":"index-module_pointerCursor__Ee6pr","polygonPath":"index-module_polygonPath__PynOn","dragging":"index-module_dragging__xSFdO","notCreate":"index-module_notCreate__bFnkV"};
|
|
23093
|
-
styleInject(css_248z$6);
|
|
23094
|
-
|
|
23095
23113
|
var CreateStatus;
|
|
23096
23114
|
(function (CreateStatus) {
|
|
23097
23115
|
CreateStatus["CREATING"] = "creating";
|
|
@@ -23141,6 +23159,439 @@ const MapEditContext = createContext({
|
|
|
23141
23159
|
const MapEditContextProvider = MapEditContext.Provider;
|
|
23142
23160
|
const useMapEditContext = () => useContext(MapEditContext);
|
|
23143
23161
|
|
|
23162
|
+
var chargingPileImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABHHSURBVHgBtVtdjF3VdV7rnHPHtLbUkRrALwmDidSSgD1JqWQ3UMaNMaFq63FIKyoVZFRF6kMkbCmVcP9mrBARoJUnLRL9c+3WSVsqIkwrtRBKfaGmQFuFazBpK0wYnmLSF6MYx557zt5Zv3vvO/Z4bDPZ9pl97rlnztnfXmt969s/g/AjKrN7nxwf634wBTFMYIQNAWASAcYjxAmI+T5EnAeIdFQnYwxHqwr6Z5s1g9ld20/Cj6AgrGBhkKva0/d1MUxBiFMxEjw7gGv5RyUWL+cfiCD/0I4KoULs04ensKkP7d716/OwQmVFA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2PH5x7Gi6xXLKFy3Lnb3xhOrRhL60tT3TFnwKIe/sejGDL6DpJgAXn+YSMx7iTk28O1z3SaUe8ZIc+hfCeJ772aB8us3wgwF4+d9cXplqIM6Hrprrgm9fSimSMaasE5JhGSG494iFMVKKgKvk7B94JT7D7NL2654m/v3ygXlYEsJfpu35rArCejm23jex7q/05D+qYOYHOORZcQSmFVYgpfunoY419ODP21UOH5lbsr9RWFHBZpqd3jsMVZybJyJTO4gbCPk6YJgjrRPZp+TFP7HaSMA9iFQfkyO/Awqr+SoIsyw8B5OTF820K0FQAAAAASUVORK5CYII=";
|
|
23163
|
+
|
|
23164
|
+
const useChargingPile = ({ viewBox, rotation = 0 }) => {
|
|
23165
|
+
const { svgElementDatas } = useSvgEditContext();
|
|
23166
|
+
const { sn } = useCommonContext();
|
|
23167
|
+
const items = useMemo(() => {
|
|
23168
|
+
if (!svgElementDatas || !viewBox)
|
|
23169
|
+
return [];
|
|
23170
|
+
const chargingPiles = svgElementDatas?.[DataType.CHARGING_PILE];
|
|
23171
|
+
if (!chargingPiles)
|
|
23172
|
+
return [];
|
|
23173
|
+
const results = [];
|
|
23174
|
+
for (const element of chargingPiles) {
|
|
23175
|
+
const center = element.points?.[0];
|
|
23176
|
+
if (!center)
|
|
23177
|
+
continue;
|
|
23178
|
+
const size = element.style?.radius ? element.style.radius * 2 : 55;
|
|
23179
|
+
const direction = element?.direction || 0;
|
|
23180
|
+
const angle = (direction * 180) / Math.PI;
|
|
23181
|
+
const rotationDegree = 270 - angle; // 正东是正方向,需要处理下
|
|
23182
|
+
const actualRotation = rotationDegree - rotation;
|
|
23183
|
+
const relX = (center[0] - viewBox.x) / viewBox.width;
|
|
23184
|
+
const relY = (center[1] - viewBox.y) / viewBox.height;
|
|
23185
|
+
if (isFinite(relX) && isFinite(relY)) {
|
|
23186
|
+
results.push({
|
|
23187
|
+
leftPct: relX * 100,
|
|
23188
|
+
topPct: relY * 100,
|
|
23189
|
+
size,
|
|
23190
|
+
rotateDeg: actualRotation,
|
|
23191
|
+
imageSrc: chargingPileImage,
|
|
23192
|
+
});
|
|
23193
|
+
}
|
|
23194
|
+
}
|
|
23195
|
+
return results;
|
|
23196
|
+
}, [svgElementDatas, viewBox?.x, viewBox?.y, viewBox?.width, viewBox?.height, rotation, sn]);
|
|
23197
|
+
return items;
|
|
23198
|
+
};
|
|
23199
|
+
|
|
23200
|
+
const CharginPile = React__default.memo(({ viewBox, rotation = 0, sizeScale = 1, sizeInSvgUnits = false, isHighlight = true, }) => {
|
|
23201
|
+
const items = useChargingPile({ viewBox: viewBox || null, rotation });
|
|
23202
|
+
const containerStyle = useMemo(() => ({
|
|
23203
|
+
position: 'absolute',
|
|
23204
|
+
top: 0,
|
|
23205
|
+
left: 0,
|
|
23206
|
+
width: '100%',
|
|
23207
|
+
height: '100%',
|
|
23208
|
+
pointerEvents: 'none',
|
|
23209
|
+
zIndex: 750,
|
|
23210
|
+
opacity: isHighlight ? SvgMapOpacity.HIGHLIGHT : SvgMapOpacity.UN_HIGHLIGHT,
|
|
23211
|
+
}), [isHighlight]);
|
|
23212
|
+
return (jsx("div", { style: containerStyle, children: items?.map((item, idx) => (jsx("div", { className: "charging-pile", style: {
|
|
23213
|
+
position: 'absolute',
|
|
23214
|
+
width: sizeInSvgUnits && viewBox
|
|
23215
|
+
? `${(item.size / Math.max(viewBox.width, 1)) * 100 * sizeScale}%`
|
|
23216
|
+
: item.size * sizeScale,
|
|
23217
|
+
height: sizeInSvgUnits && viewBox
|
|
23218
|
+
? `${(item.size / Math.max(viewBox.height, 1)) * 100 * sizeScale}%`
|
|
23219
|
+
: item.size * sizeScale,
|
|
23220
|
+
left: `${item.leftPct}%`,
|
|
23221
|
+
top: `${item.topPct}%`,
|
|
23222
|
+
transform: `translate(-50%, -50%) rotate(${item.rotateDeg}deg)`,
|
|
23223
|
+
pointerEvents: 'auto',
|
|
23224
|
+
zIndex: 750,
|
|
23225
|
+
}, children: jsx("img", { src: item.imageSrc, style: { width: '100%', height: '100%', objectFit: 'contain', opacity: 1 } }) }, `pile-${idx}`))) }));
|
|
23226
|
+
});
|
|
23227
|
+
|
|
23228
|
+
const MAX_STATIC_SIZE = 640;
|
|
23229
|
+
const MAX_STATIC_MAP_RETRY = 3;
|
|
23230
|
+
const STATIC_MAP_RETRY_COOLDOWN_MS = 5000;
|
|
23231
|
+
const Magnifier = ({ visible, dragState, polygonPoints, fillColor = 'rgba(255, 122, 51, 0.1)', strokeColor = 'rgba(255, 122, 51, 1)', strokeWidth = 2, zoom = 3, size = 200, }) => {
|
|
23232
|
+
const { svgViewBox, mapRef, googleMapStaticApiKey, drag } = useCommonContext();
|
|
23233
|
+
const { svgElementDatas, svgRef } = useSvgEditContext();
|
|
23234
|
+
const { editMapInfo } = useMapEditContext();
|
|
23235
|
+
const [magnifierPosition, setMagnifierPosition] = useState({ x: 0, y: 0 });
|
|
23236
|
+
const [magnifierBoxSize, setMagnifierBoxSize] = useState({ width: size, height: size });
|
|
23237
|
+
// 本次拖拽中放大镜位置是否已完成初始化(未完成前隐藏,避免首帧闪动)
|
|
23238
|
+
const [isPlacementReady, setIsPlacementReady] = useState(false);
|
|
23239
|
+
// 放大镜所在侧边:true=右侧,false=左侧
|
|
23240
|
+
const [placeOnRight, setPlaceOnRight] = useState(true);
|
|
23241
|
+
// 仅在每次拖拽开始时初始化一次侧边
|
|
23242
|
+
const hasInitializedSideRef = useRef(false);
|
|
23243
|
+
const [mapImageFrame, setMapImageFrame] = useState(null);
|
|
23244
|
+
const [staticMapRetryCount, setStaticMapRetryCount] = useState(0);
|
|
23245
|
+
const [staticMapBlockedUntil, setStaticMapBlockedUntil] = useState(0);
|
|
23246
|
+
// 获取当前正在拖拽的禁区 ID
|
|
23247
|
+
const currentObstacleId = editMapInfo?.selectElement?.id;
|
|
23248
|
+
// 计算当前 SVG 单位到屏幕像素的比例(用于实现真正 1:1 预览)
|
|
23249
|
+
const getPixelScale = () => {
|
|
23250
|
+
//先拿 svgRef.getScreenCTM(),这是 SVG 到屏幕的变换矩阵(包含缩放/旋转/平移)
|
|
23251
|
+
const ctm = svgRef?.getScreenCTM?.();
|
|
23252
|
+
if (!ctm)
|
|
23253
|
+
return 1;
|
|
23254
|
+
// 使用向量长度计算缩放,兼容旋转矩阵
|
|
23255
|
+
// 用 Math.hypot(ctm.a, ctm.b) 算出 x 方向的实际缩放倍率(用向量长度是为了兼容旋转,不只看 a)
|
|
23256
|
+
const scaleX = Math.hypot(ctm.a, ctm.b);
|
|
23257
|
+
return Number.isFinite(scaleX) && scaleX > 0 ? scaleX : 1;
|
|
23258
|
+
};
|
|
23259
|
+
// 读取设备安全区(刘海/手势条)inset,兼容横屏 H5
|
|
23260
|
+
const getSafeAreaInsets = () => {
|
|
23261
|
+
const probe = document.createElement('div');
|
|
23262
|
+
probe.style.position = 'fixed';
|
|
23263
|
+
probe.style.left = '0';
|
|
23264
|
+
probe.style.top = '0';
|
|
23265
|
+
probe.style.width = '0';
|
|
23266
|
+
probe.style.height = '0';
|
|
23267
|
+
probe.style.visibility = 'hidden';
|
|
23268
|
+
probe.style.pointerEvents = 'none';
|
|
23269
|
+
probe.style.paddingTop = 'env(safe-area-inset-top)';
|
|
23270
|
+
probe.style.paddingRight = 'env(safe-area-inset-right)';
|
|
23271
|
+
probe.style.paddingBottom = 'env(safe-area-inset-bottom)';
|
|
23272
|
+
probe.style.paddingLeft = 'env(safe-area-inset-left)';
|
|
23273
|
+
document.body.appendChild(probe);
|
|
23274
|
+
const style = window.getComputedStyle(probe);
|
|
23275
|
+
const insets = {
|
|
23276
|
+
top: Number.parseFloat(style.paddingTop) || 0,
|
|
23277
|
+
right: Number.parseFloat(style.paddingRight) || 0,
|
|
23278
|
+
bottom: Number.parseFloat(style.paddingBottom) || 0,
|
|
23279
|
+
left: Number.parseFloat(style.paddingLeft) || 0,
|
|
23280
|
+
};
|
|
23281
|
+
document.body.removeChild(probe);
|
|
23282
|
+
return insets;
|
|
23283
|
+
};
|
|
23284
|
+
// 计算并获取放大镜底图:优先使用 Google Maps Static API,无图时走灰色背景兜底
|
|
23285
|
+
useEffect(() => {
|
|
23286
|
+
if (!visible || !dragState.currentPosition || !mapRef || !svgViewBox || !svgRef) {
|
|
23287
|
+
// console.log('[Magnifier] Skip static map effect: missing deps', {
|
|
23288
|
+
// visible,
|
|
23289
|
+
// hasCurrentPosition: Boolean(dragState.currentPosition),
|
|
23290
|
+
// hasMapRef: Boolean(mapRef),
|
|
23291
|
+
// hasSvgViewBox: Boolean(svgViewBox),
|
|
23292
|
+
// hasSvgRef: Boolean(svgRef),
|
|
23293
|
+
// });
|
|
23294
|
+
setMapImageFrame(null);
|
|
23295
|
+
setStaticMapRetryCount(0);
|
|
23296
|
+
setStaticMapBlockedUntil(0);
|
|
23297
|
+
return;
|
|
23298
|
+
}
|
|
23299
|
+
// 弱网连续失败时进入短暂冷却,避免重试风暴导致底图反复闪烁
|
|
23300
|
+
if (Date.now() < staticMapBlockedUntil) {
|
|
23301
|
+
return;
|
|
23302
|
+
}
|
|
23303
|
+
const mapDiv = mapRef.getDiv?.();
|
|
23304
|
+
// 获取 SVG 到屏幕的变换矩阵的逆矩阵
|
|
23305
|
+
const inverseCtm = svgRef.getScreenCTM?.()?.inverse?.();
|
|
23306
|
+
if (!mapDiv || !inverseCtm) {
|
|
23307
|
+
// console.log('[Magnifier] Skip static map effect: mapDiv/ctm missing', {
|
|
23308
|
+
// hasMapDiv: Boolean(mapDiv),
|
|
23309
|
+
// hasInverseCtm: Boolean(inverseCtm),
|
|
23310
|
+
// });
|
|
23311
|
+
setMapImageFrame(null);
|
|
23312
|
+
setStaticMapRetryCount(0);
|
|
23313
|
+
setStaticMapBlockedUntil(0);
|
|
23314
|
+
return;
|
|
23315
|
+
}
|
|
23316
|
+
const mapRect = mapDiv.getBoundingClientRect();
|
|
23317
|
+
const svgPoint = svgRef.createSVGPoint();
|
|
23318
|
+
// 只要有 key 就尝试 static api;请求失败时不截图,直接回退灰色背景
|
|
23319
|
+
if (googleMapStaticApiKey) {
|
|
23320
|
+
// console.log('[Magnifier] Background source: static api viewport snapshot');
|
|
23321
|
+
const mapBounds = mapRef.getBounds?.();
|
|
23322
|
+
if (!mapBounds) {
|
|
23323
|
+
// console.log('[Magnifier] Skip static map effect: mapBounds missing');
|
|
23324
|
+
setMapImageFrame(null);
|
|
23325
|
+
return;
|
|
23326
|
+
}
|
|
23327
|
+
const screenToSvg = (screenX, screenY) => {
|
|
23328
|
+
svgPoint.x = screenX;
|
|
23329
|
+
svgPoint.y = screenY;
|
|
23330
|
+
const p = svgPoint.matrixTransform(inverseCtm);
|
|
23331
|
+
return { x: p.x, y: p.y };
|
|
23332
|
+
};
|
|
23333
|
+
// 使用当前地图视口矩形四角,将屏幕坐标映射到 SVG 坐标,确保底图与主视口对齐
|
|
23334
|
+
const topLeftSvg = screenToSvg(mapRect.left, mapRect.top);
|
|
23335
|
+
const topRightSvg = screenToSvg(mapRect.right, mapRect.top);
|
|
23336
|
+
const bottomLeftSvg = screenToSvg(mapRect.left, mapRect.bottom);
|
|
23337
|
+
if (!topLeftSvg || !topRightSvg || !bottomLeftSvg) {
|
|
23338
|
+
setMapImageFrame(null);
|
|
23339
|
+
return;
|
|
23340
|
+
}
|
|
23341
|
+
// 把当前主地图可视区域尺寸,按比例压到 Static API 允许的最大尺寸以内(受 Static API 640 上限约束)),同时不改变宽高比。
|
|
23342
|
+
const mapWidth = Math.max(1, Math.round(mapRect.width));
|
|
23343
|
+
const mapHeight = Math.max(1, Math.round(mapRect.height));
|
|
23344
|
+
const shrinkRatio = Math.min(1, MAX_STATIC_SIZE / Math.max(mapWidth, mapHeight));
|
|
23345
|
+
const staticWidth = Math.max(1, Math.round(mapWidth * shrinkRatio));
|
|
23346
|
+
const staticHeight = Math.max(1, Math.round(mapHeight * shrinkRatio));
|
|
23347
|
+
const center = mapBounds.getCenter();
|
|
23348
|
+
const currentZoom = mapRef.getZoom() || 20;
|
|
23349
|
+
// 尺寸缩小后同步补偿 zoom,保持与当前主图一致的地理覆盖范围
|
|
23350
|
+
const zoomCompensation = Math.log2(shrinkRatio);
|
|
23351
|
+
const adjustedZoom = currentZoom + zoomCompensation;
|
|
23352
|
+
const staticZoom = Math.max(0, Math.min(Math.floor(adjustedZoom), 22));
|
|
23353
|
+
const staticMapUrl = `https://maps.googleapis.com/maps/api/staticmap?center=${center.lat()},${center.lng()}&zoom=${staticZoom}&size=${staticWidth}x${staticHeight}&maptype=satellite&key=${googleMapStaticApiKey}`;
|
|
23354
|
+
// 通过三角点推导静态图在 SVG 中的宽高和旋转角
|
|
23355
|
+
// Math.hypot(x, y) 等价于 sqrt(x*x + y*y),计算两点之间的距离
|
|
23356
|
+
const width = Math.hypot(topRightSvg.x - topLeftSvg.x, topRightSvg.y - topLeftSvg.y);
|
|
23357
|
+
const height = Math.hypot(bottomLeftSvg.x - topLeftSvg.x, bottomLeftSvg.y - topLeftSvg.y);
|
|
23358
|
+
// Math.atan2(y, x) 计算反正切值,返回 [-π, π] 弧度,*180/π 转换为角度
|
|
23359
|
+
const rotationDeg = (Math.atan2(topRightSvg.y - topLeftSvg.y, topRightSvg.x - topLeftSvg.x) * 180) / Math.PI;
|
|
23360
|
+
// Static API zoom 只能取整;额外补偿小数部分,避免底图视觉偏小
|
|
23361
|
+
// 在有旋转的坐标系里,做“以中心为锚点”的等比放大补偿。
|
|
23362
|
+
const fractionalZoomScale = Math.pow(2, adjustedZoom - staticZoom); //算出“还差多少缩放比例”。例子:adjustedZoom=19.6,staticZoom=19,差 0.6,比例是 2^0.6 ≈ 1.515。
|
|
23363
|
+
//把原始 width/height 乘这个比例,得到补偿后的尺寸。
|
|
23364
|
+
const compensatedWidth = width * fractionalZoomScale;
|
|
23365
|
+
const compensatedHeight = height * fractionalZoomScale;
|
|
23366
|
+
//尺寸变大后,多出来的宽/高的一半(要从两边均匀扩张)。
|
|
23367
|
+
const offsetAlongX = (compensatedWidth - width) / 2;
|
|
23368
|
+
const offsetAlongY = (compensatedHeight - height) / 2;
|
|
23369
|
+
//“右方向”单位向量(从左上指向右上),因为图可能旋转了,不能只按水平 x 轴算。
|
|
23370
|
+
const unitX = width > 0 ? (topRightSvg.x - topLeftSvg.x) / width : 1;
|
|
23371
|
+
const unitY = width > 0 ? (topRightSvg.y - topLeftSvg.y) / width : 0;
|
|
23372
|
+
//“下方向”单位向量(从左上指向左下),同理用于旋转场景。
|
|
23373
|
+
const unitDownX = height > 0 ? (bottomLeftSvg.x - topLeftSvg.x) / height : 0;
|
|
23374
|
+
const unitDownY = height > 0 ? (bottomLeftSvg.y - topLeftSvg.y) / height : 1;
|
|
23375
|
+
/**
|
|
23376
|
+
* 计算补偿后的新左上角:
|
|
23377
|
+
* 从原左上角沿“右方向”回退半个扩展量,再沿“下方向”回退半个扩展量。
|
|
23378
|
+
* 这样放大后仍以原区域中心为中心,不会放大后位置偏移。
|
|
23379
|
+
*/
|
|
23380
|
+
const compensatedTopLeftX = topLeftSvg.x - unitX * offsetAlongX - unitDownX * offsetAlongY;
|
|
23381
|
+
const compensatedTopLeftY = topLeftSvg.y - unitY * offsetAlongX - unitDownY * offsetAlongY;
|
|
23382
|
+
setMapImageFrame({
|
|
23383
|
+
url: staticMapUrl,
|
|
23384
|
+
x: compensatedTopLeftX,
|
|
23385
|
+
y: compensatedTopLeftY,
|
|
23386
|
+
width: compensatedWidth,
|
|
23387
|
+
height: compensatedHeight,
|
|
23388
|
+
transform: `rotate(${rotationDeg} ${compensatedTopLeftX} ${compensatedTopLeftY})`,
|
|
23389
|
+
});
|
|
23390
|
+
}
|
|
23391
|
+
else {
|
|
23392
|
+
setMapImageFrame(null);
|
|
23393
|
+
setStaticMapRetryCount(0);
|
|
23394
|
+
setStaticMapBlockedUntil(0);
|
|
23395
|
+
// console.log('[Magnifier] Background source: gray fallback (no static api key)');
|
|
23396
|
+
}
|
|
23397
|
+
}, [
|
|
23398
|
+
visible,
|
|
23399
|
+
dragState.isDragging,
|
|
23400
|
+
mapRef,
|
|
23401
|
+
svgViewBox?.x,
|
|
23402
|
+
svgViewBox?.y,
|
|
23403
|
+
svgViewBox?.width,
|
|
23404
|
+
svgViewBox?.height,
|
|
23405
|
+
svgRef,
|
|
23406
|
+
size,
|
|
23407
|
+
zoom,
|
|
23408
|
+
googleMapStaticApiKey,
|
|
23409
|
+
staticMapRetryCount,
|
|
23410
|
+
staticMapBlockedUntil,
|
|
23411
|
+
]);
|
|
23412
|
+
useLayoutEffect(() => {
|
|
23413
|
+
if (!visible) {
|
|
23414
|
+
hasInitializedSideRef.current = false;
|
|
23415
|
+
setIsPlacementReady(false);
|
|
23416
|
+
return;
|
|
23417
|
+
}
|
|
23418
|
+
const updatePosition = () => {
|
|
23419
|
+
const mapDiv = mapRef?.getDiv?.();
|
|
23420
|
+
const mapRect = mapDiv?.getBoundingClientRect?.();
|
|
23421
|
+
const boxSize = Math.max(120, Math.round(size));
|
|
23422
|
+
// 设置放大镜大小
|
|
23423
|
+
setMagnifierBoxSize({ width: boxSize, height: boxSize });
|
|
23424
|
+
const viewportWidth = window.innerWidth;
|
|
23425
|
+
const viewportHeight = window.innerHeight;
|
|
23426
|
+
const baseMargin = 10; // 放大镜与边缘的基础间距
|
|
23427
|
+
const insets = getSafeAreaInsets();
|
|
23428
|
+
const marginTop = Math.max(baseMargin, insets.top);
|
|
23429
|
+
const marginRight = Math.max(baseMargin, insets.right);
|
|
23430
|
+
const marginBottom = Math.max(baseMargin, insets.bottom);
|
|
23431
|
+
const marginLeft = Math.max(baseMargin, insets.left);
|
|
23432
|
+
const topY = mapRect ? mapRect.top + marginTop : marginTop;
|
|
23433
|
+
// 顶部位置限制在可视区与安全区内,避免横屏时被刘海/手势条遮挡
|
|
23434
|
+
const safeTopY = Math.max(marginTop, Math.min(topY, viewportHeight - boxSize - marginBottom));
|
|
23435
|
+
let nextPlaceOnRight = placeOnRight;
|
|
23436
|
+
const ctm = svgRef?.getScreenCTM?.();
|
|
23437
|
+
// 首次显示时先同步算出侧边,再基于该侧边定位,避免“先左后右/先右后左”闪动
|
|
23438
|
+
if (!hasInitializedSideRef.current && dragState.currentPosition && ctm && mapRect) {
|
|
23439
|
+
const p = svgRef.createSVGPoint();
|
|
23440
|
+
p.x = dragState.currentPosition[0];
|
|
23441
|
+
p.y = dragState.currentPosition[1];
|
|
23442
|
+
const dragScreenPoint = p.matrixTransform(ctm);
|
|
23443
|
+
const mapMidX = mapRect.left + mapRect.width / 2;
|
|
23444
|
+
nextPlaceOnRight = dragScreenPoint.x < mapMidX;
|
|
23445
|
+
setPlaceOnRight(nextPlaceOnRight);
|
|
23446
|
+
hasInitializedSideRef.current = true;
|
|
23447
|
+
}
|
|
23448
|
+
const rightX = mapRect
|
|
23449
|
+
? mapRect.right - boxSize - marginRight
|
|
23450
|
+
: viewportWidth - boxSize - marginRight;
|
|
23451
|
+
const leftX = mapRect ? mapRect.left + marginLeft : marginLeft;
|
|
23452
|
+
const safeX = nextPlaceOnRight ? rightX : leftX;
|
|
23453
|
+
const boundedX = Math.max(marginLeft, Math.min(safeX, viewportWidth - boxSize - marginRight));
|
|
23454
|
+
// 放大镜出现后,仅当拖拽点进入放大镜区域时才切换到对侧
|
|
23455
|
+
if (dragState.currentPosition && ctm) {
|
|
23456
|
+
const p = svgRef.createSVGPoint();
|
|
23457
|
+
p.x = dragState.currentPosition[0];
|
|
23458
|
+
p.y = dragState.currentPosition[1];
|
|
23459
|
+
// 应用这个矩阵,变换成屏幕坐标
|
|
23460
|
+
const dragScreenPoint = p.matrixTransform(ctm);
|
|
23461
|
+
const pointInMagnifier = dragScreenPoint.x >= boundedX &&
|
|
23462
|
+
dragScreenPoint.x <= boundedX + boxSize &&
|
|
23463
|
+
dragScreenPoint.y >= safeTopY &&
|
|
23464
|
+
dragScreenPoint.y <= safeTopY + boxSize;
|
|
23465
|
+
if (pointInMagnifier) {
|
|
23466
|
+
setPlaceOnRight((prev) => !prev);
|
|
23467
|
+
return;
|
|
23468
|
+
}
|
|
23469
|
+
}
|
|
23470
|
+
setMagnifierPosition({
|
|
23471
|
+
x: boundedX,
|
|
23472
|
+
y: safeTopY,
|
|
23473
|
+
});
|
|
23474
|
+
setIsPlacementReady(true);
|
|
23475
|
+
};
|
|
23476
|
+
updatePosition();
|
|
23477
|
+
window.addEventListener('resize', updatePosition);
|
|
23478
|
+
return () => window.removeEventListener('resize', updatePosition);
|
|
23479
|
+
}, [
|
|
23480
|
+
visible,
|
|
23481
|
+
size,
|
|
23482
|
+
mapRef,
|
|
23483
|
+
svgRef,
|
|
23484
|
+
placeOnRight,
|
|
23485
|
+
dragState.currentPosition?.[0],
|
|
23486
|
+
dragState.currentPosition?.[1],
|
|
23487
|
+
]);
|
|
23488
|
+
// 早期返回必须在所有 hooks 之后
|
|
23489
|
+
if (!visible || !dragState.currentPosition || !svgViewBox) {
|
|
23490
|
+
return null;
|
|
23491
|
+
}
|
|
23492
|
+
const [centerX, centerY] = dragState.currentPosition;
|
|
23493
|
+
// 计算放大区域范围(以拖拽点为中心)
|
|
23494
|
+
//effectiveZoom = Math.max(0.001, zoom * getPixelScale())
|
|
23495
|
+
// 得到实际放大倍率。
|
|
23496
|
+
// zoom 是你设置的放大倍数(比如 3)
|
|
23497
|
+
// getPixelScale() 是当前 SVG 到屏幕的缩放因子(地图本身被缩放时要补偿)
|
|
23498
|
+
// Math.max(0.001, ...) 是防止出现 0 或极小值导致除零/异常
|
|
23499
|
+
// magnifierWidthInSvg = magnifierBoxSize.width / effectiveZoom
|
|
23500
|
+
// magnifierHeightInSvg = magnifierBoxSize.height / effectiveZoom
|
|
23501
|
+
// 把“屏幕上放大镜框的像素尺寸”换算成“SVG 坐标里要截取的实际尺寸”
|
|
23502
|
+
// 放大倍率越大,分母越大,截取范围越小 => 看起来越放大
|
|
23503
|
+
const effectiveZoom = Math.max(0.001, zoom * getPixelScale());
|
|
23504
|
+
const magnifierWidthInSvg = magnifierBoxSize.width / effectiveZoom;
|
|
23505
|
+
const magnifierHeightInSvg = magnifierBoxSize.height / effectiveZoom;
|
|
23506
|
+
// 计算放大区域的 viewBox
|
|
23507
|
+
const magnifierViewBox = {
|
|
23508
|
+
x: centerX - magnifierWidthInSvg / 2,
|
|
23509
|
+
y: centerY - magnifierHeightInSvg / 2,
|
|
23510
|
+
width: magnifierWidthInSvg,
|
|
23511
|
+
height: magnifierHeightInSvg,
|
|
23512
|
+
};
|
|
23513
|
+
// 样式缩放采用“弱抵消”,避免随 zoom 变细,保证放大镜内点线清晰度
|
|
23514
|
+
const styleZoomFactor = Math.max(1, zoom * 0.4);
|
|
23515
|
+
// 生成多边形点字符串(仅用于当前编辑禁区)
|
|
23516
|
+
const polygonPointsString = polygonPoints.length > 0 ? polygonPoints.map((p) => `${p[0]},${p[1]}`).join(' ') : '';
|
|
23517
|
+
const actureRotate = drag?.rotate ?? drag?.rotation ?? 0;
|
|
23518
|
+
// 渲染放大镜内容
|
|
23519
|
+
const magnifierContent = (jsxs("div", { style: {
|
|
23520
|
+
position: 'fixed',
|
|
23521
|
+
left: `${magnifierPosition.x}px`,
|
|
23522
|
+
top: `${magnifierPosition.y}px`,
|
|
23523
|
+
width: `${magnifierBoxSize.width}px`,
|
|
23524
|
+
height: `${magnifierBoxSize.height}px`,
|
|
23525
|
+
borderRadius: '50%',
|
|
23526
|
+
border: `2px solid #fff`,
|
|
23527
|
+
// boxShadow: '0 4px 20px rgba(0, 0, 0, 0.3)',
|
|
23528
|
+
overflow: 'hidden',
|
|
23529
|
+
zIndex: 10000,
|
|
23530
|
+
pointerEvents: 'none',
|
|
23531
|
+
background: 'rgba(235, 236, 240, 1)',
|
|
23532
|
+
visibility: isPlacementReady ? 'visible' : 'hidden',
|
|
23533
|
+
}, children: [jsxs("svg", {
|
|
23534
|
+
// 逻辑尺寸:与放大镜容器一致
|
|
23535
|
+
width: magnifierBoxSize.width, height: magnifierBoxSize.height,
|
|
23536
|
+
// 核心放大参数:从整张 SVG 中裁剪出当前需要展示的区域(x y width height)
|
|
23537
|
+
viewBox: `${magnifierViewBox.x} ${magnifierViewBox.y} ${magnifierViewBox.width} ${magnifierViewBox.height}`,
|
|
23538
|
+
// 保持内容居中并铺满窗口;比例不一致时裁边,不留空白
|
|
23539
|
+
preserveAspectRatio: "xMidYMid slice", style: {
|
|
23540
|
+
// CSS 尺寸:让 SVG 完全填满放大镜容器
|
|
23541
|
+
width: '100%',
|
|
23542
|
+
height: '100%',
|
|
23543
|
+
}, children: [mapImageFrame && (jsx("image", { href: mapImageFrame.url, x: mapImageFrame.x, y: mapImageFrame.y, width: mapImageFrame.width, height: mapImageFrame.height, transform: mapImageFrame.transform, preserveAspectRatio: "none", style: { opacity: 1 }, onLoad: () => {
|
|
23544
|
+
// console.log('✅ Map background loaded in magnifier');
|
|
23545
|
+
setStaticMapRetryCount(0);
|
|
23546
|
+
setStaticMapBlockedUntil(0);
|
|
23547
|
+
}, onError: (_e) => {
|
|
23548
|
+
// console.error('❌ Failed to load map background in magnifier', {
|
|
23549
|
+
// retryCount: staticMapRetryCount,
|
|
23550
|
+
// maxRetry: MAX_STATIC_MAP_RETRY,
|
|
23551
|
+
// url: mapImageFrame.url,
|
|
23552
|
+
// error: _e,
|
|
23553
|
+
// });
|
|
23554
|
+
setStaticMapRetryCount((prev) => {
|
|
23555
|
+
if (prev < MAX_STATIC_MAP_RETRY)
|
|
23556
|
+
return prev + 1;
|
|
23557
|
+
// 重试上限后进入冷却,不立刻清空已显示底图,避免弱网下闪烁
|
|
23558
|
+
setStaticMapBlockedUntil(Date.now() + STATIC_MAP_RETRY_COOLDOWN_MS);
|
|
23559
|
+
return 0;
|
|
23560
|
+
});
|
|
23561
|
+
} }, `magnifier-static-map-${staticMapRetryCount}`)), svgElementDatas &&
|
|
23562
|
+
Object.keys(svgElementDatas).map((key) => {
|
|
23563
|
+
const elements = svgElementDatas[key] || [];
|
|
23564
|
+
// 过滤掉当前正在拖拽的禁区(稍后单独渲染拖拽后的状态)
|
|
23565
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23566
|
+
const filteredElements = key === DataType.OBSTACLE
|
|
23567
|
+
? elements.filter((item) => item.id !== currentObstacleId)
|
|
23568
|
+
: elements;
|
|
23569
|
+
if (filteredElements.length === 0)
|
|
23570
|
+
return null;
|
|
23571
|
+
return (jsxs(GElement, { type: key, children: [key === 'channel' && jsx(ChannelClipPath, {}), filteredElements.map((item) => (
|
|
23572
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23573
|
+
jsx(SvgElement, { type: key, data: item }, item?.id)))] }, key));
|
|
23574
|
+
}), polygonPoints.length >= 3 && polygonPointsString && (jsxs(Fragment, { children: [jsx("polygon", { points: polygonPointsString, fill: fillColor, stroke: strokeColor, strokeWidth: (strokeWidth * 3.2) / styleZoomFactor, strokeOpacity: 1 }), polygonPoints.map((point, idx) => {
|
|
23575
|
+
const [x, y] = point;
|
|
23576
|
+
const isDraggingPoint = dragState.dragIndex === idx;
|
|
23577
|
+
const pointRadius = isDraggingPoint ? 14 / styleZoomFactor : 10 / styleZoomFactor;
|
|
23578
|
+
const pointFill = isDraggingPoint ? '#FFAB7E' : strokeColor;
|
|
23579
|
+
const pointStroke = isDraggingPoint ? strokeColor : '#fff';
|
|
23580
|
+
const pointStrokeWidth = isDraggingPoint
|
|
23581
|
+
? 3.6 / styleZoomFactor
|
|
23582
|
+
: 3 / styleZoomFactor;
|
|
23583
|
+
return (jsx("circle", { cx: x, cy: y, r: pointRadius, fill: pointFill, stroke: pointStroke, strokeWidth: pointStrokeWidth }, idx));
|
|
23584
|
+
})] })), dragState.dragType === 'new' && dragState.edgeInfo && (jsx(Fragment, { children: jsx("line", { x1: dragState.edgeInfo.startPoint.x, y1: dragState.edgeInfo.startPoint.y, x2: dragState.edgeInfo.endPoint.x, y2: dragState.edgeInfo.endPoint.y, stroke: "#999", strokeWidth: (strokeWidth * 3.2) / styleZoomFactor, strokeDasharray: `${6 / styleZoomFactor},${6 / styleZoomFactor}` }) }))] }), jsx(CharginPile, { viewBox: magnifierViewBox || null, rotation: actureRotate, sizeInSvgUnits: true,
|
|
23585
|
+
// 充电桩最多保持原始尺寸,不允许放大超过 1 倍
|
|
23586
|
+
sizeScale: Math.min(1, 1 / styleZoomFactor) })] }));
|
|
23587
|
+
// 使用 Portal 渲染到 body,避免层级问题
|
|
23588
|
+
return ReactDOM.createPortal(magnifierContent, document.body);
|
|
23589
|
+
};
|
|
23590
|
+
|
|
23591
|
+
var css_248z$6 = ".index-module_pointerCursor__Ee6pr {\n cursor: pointer;\n}\n\n.index-module_polygonPath__PynOn {\n pointer-events: stroke;\n cursor: pointer;\n}\n\n.index-module_dragging__xSFdO {\n cursor: grabbing;\n}\n\n.index-module_notCreate__bFnkV {\n cursor: no-drop;\n}";
|
|
23592
|
+
var styles$6 = {"pointerCursor":"index-module_pointerCursor__Ee6pr","polygonPath":"index-module_polygonPath__PynOn","dragging":"index-module_dragging__xSFdO","notCreate":"index-module_notCreate__bFnkV"};
|
|
23593
|
+
styleInject(css_248z$6);
|
|
23594
|
+
|
|
23144
23595
|
/**
|
|
23145
23596
|
* 几何计算工具函数
|
|
23146
23597
|
*/
|
|
@@ -23681,7 +24132,7 @@ const createPathData = (points) => {
|
|
|
23681
24132
|
};
|
|
23682
24133
|
const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor = 'rgba(0, 0, 0, 0.1)', hoverFillColor = '', fillOpacity = 1, strokeColor = '#000', strokeWidth = 2, strokeOpacity = 1, createMode = false, showPoints = false, onPointClick, completed = false, mousePos = null, editMode = false, onCoordinatesChange, onPathClick, onPolygonClick, onVertexDelete, draggable = true, // 新增参数,如果未指定则根据createMode和editMode自动判断
|
|
23683
24134
|
}) => {
|
|
23684
|
-
const { overlayScale, unitType, showStraddleBoundaryBorder } = useCommonContext();
|
|
24135
|
+
const { overlayScale, unitType, showStraddleBoundaryBorder, platform, onH5FirstSelectObstaclePoint } = useCommonContext();
|
|
23685
24136
|
const { onHandleEvent } = useMapEditContext();
|
|
23686
24137
|
const { svgRef } = useSvgEditContext();
|
|
23687
24138
|
const [dragState, setDragState] = useState({
|
|
@@ -23699,7 +24150,6 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
23699
24150
|
const [selectedVertexIndex, setSelectedVertexIndex] = useState(-1);
|
|
23700
24151
|
const { checkCanNotCreateAtPosition } = useCheckElement();
|
|
23701
24152
|
const { editMapInfo } = useMapEditContext();
|
|
23702
|
-
const { platform } = useCommonContext();
|
|
23703
24153
|
// delete icon可能被上一个点遮挡,因为delete在右上方,所以手动处理点让点按照顺时针渲染,这样delete icon层级就会高一些
|
|
23704
24154
|
// 编辑的场景禁区的点最后一个和第一个相同,会导致一个位置渲染两个点,需要额外处理下
|
|
23705
24155
|
const coordinates = useMemo(() => {
|
|
@@ -23942,9 +24392,14 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
23942
24392
|
// 开始长按计时器(1000ms)
|
|
23943
24393
|
vertexLongPressTimerRef.current = window.setTimeout(() => {
|
|
23944
24394
|
isVertexLongPressedRef.current = true;
|
|
23945
|
-
setSelectedVertexIndex(
|
|
24395
|
+
setSelectedVertexIndex((prev) => {
|
|
24396
|
+
if (prev !== index) {
|
|
24397
|
+
onH5FirstSelectObstaclePoint?.();
|
|
24398
|
+
}
|
|
24399
|
+
return index;
|
|
24400
|
+
});
|
|
23946
24401
|
}, 1000);
|
|
23947
|
-
}, [editMode, createMode, completed, dragState.isDragging]);
|
|
24402
|
+
}, [editMode, createMode, completed, dragState.isDragging, onH5FirstSelectObstaclePoint]);
|
|
23948
24403
|
const handleVertexLongPressEnd = useCallback(() => {
|
|
23949
24404
|
if (vertexLongPressTimerRef.current !== null) {
|
|
23950
24405
|
window.clearTimeout(vertexLongPressTimerRef.current);
|
|
@@ -24323,7 +24778,11 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24323
24778
|
setHoverVertex(null);
|
|
24324
24779
|
},
|
|
24325
24780
|
}) }, `edge-${index}`));
|
|
24326
|
-
}), ghostLastPath && (jsxs(Fragment, { children: [jsx("path", { d: ghostLastPath, stroke: '#fff', strokeWidth: strokeWidth * 2, vectorEffect: "non-scaling-stroke", opacity: 0.7 }), jsx("path", { d: ghostLastPath, stroke: strokeColor, strokeWidth: strokeWidth, vectorEffect: "non-scaling-stroke", opacity: 0.7, onClick: onPathClick })] })), ghostFirstPath && renderCoordinates.length >= 2 && (jsxs(Fragment, { children: [jsx("path", { d: ghostFirstPath, stroke: '#fff', strokeWidth: strokeWidth * 2, vectorEffect: "non-scaling-stroke", opacity: 0.7 }), jsx("path", { d: ghostFirstPath, stroke: strokeColor, strokeWidth: strokeWidth, vectorEffect: "non-scaling-stroke", opacity: 0.7, onClick: onPathClick })] })), jsx(DragDistanceIndicator, { dragState: dragState, strokeColor: strokeColor, editMode: editMode, createMode: createMode, completed: completed, fontSize: platform === PlatformType.H5 ? 12 * overlayScale * 1.5 : 30 * overlayScale, unitType: unitType }), jsx(
|
|
24781
|
+
}), ghostLastPath && (jsxs(Fragment, { children: [jsx("path", { d: ghostLastPath, stroke: '#fff', strokeWidth: strokeWidth * 2, vectorEffect: "non-scaling-stroke", opacity: 0.7 }), jsx("path", { d: ghostLastPath, stroke: strokeColor, strokeWidth: strokeWidth, vectorEffect: "non-scaling-stroke", opacity: 0.7, onClick: onPathClick })] })), ghostFirstPath && renderCoordinates.length >= 2 && (jsxs(Fragment, { children: [jsx("path", { d: ghostFirstPath, stroke: '#fff', strokeWidth: strokeWidth * 2, vectorEffect: "non-scaling-stroke", opacity: 0.7 }), jsx("path", { d: ghostFirstPath, stroke: strokeColor, strokeWidth: strokeWidth, vectorEffect: "non-scaling-stroke", opacity: 0.7, onClick: onPathClick })] })), jsx(DragDistanceIndicator, { dragState: dragState, strokeColor: strokeColor, editMode: editMode, createMode: createMode, completed: completed, fontSize: platform === PlatformType.H5 ? 12 * overlayScale * 1.5 : 30 * overlayScale, unitType: unitType }), jsx(Magnifier, { visible: platform === PlatformType.H5 &&
|
|
24782
|
+
dragState.isDragging &&
|
|
24783
|
+
dragState.dragIndex !== -1 &&
|
|
24784
|
+
dragState.currentPosition !== null &&
|
|
24785
|
+
(editMode || (createMode && completed)), dragState: dragState, polygonPoints: renderCoordinates, fillColor: fillColor, strokeColor: strokeColor, strokeWidth: strokeWidth, zoom: 3, size: 130 }), jsx(DistanceLabels, { coordinates: renderCoordinates, createMode: createMode, editMode: editMode, completed: completed, showPoints: showPoints, mousePos: mousePos, ghostLastDistance: ghostLastDistance, ghostLastMidpoint: ghostLastMidpoint, ghostFirstDistance: ghostFirstDistance, ghostFirstMidpoint: ghostFirstMidpoint, fontSize: platform === PlatformType.H5 ? 12 * overlayScale * 1.5 : 30 * overlayScale, showFirstDistance: platform !== PlatformType.H5, unit: unitType }), hoverVertex && !dragState.isDragging && (jsx(VertexElement, { cx: hoverVertex.position.x, cy: hoverVertex.position.y, stroke: strokeColor, strokeOpacity: 0.6, fill: "white", fillOpacity: 0.8, pointerEvents: "none" })), ((createMode && showPoints) || editMode || (createMode && completed)) &&
|
|
24327
24786
|
renderCoordinates.map((coord, idx) => {
|
|
24328
24787
|
// 判断当前顶点的状态
|
|
24329
24788
|
const isLastPoint = idx === renderCoordinates.length - 1;
|
|
@@ -27196,68 +27655,6 @@ const MowerPosition = React__default.memo(({ editMap, mowerPositionData, viewBox
|
|
|
27196
27655
|
}, children: jsx("img", { src: mowerImage, style: { width: '100%', height: '100%', objectFit: 'contain' } }) }) }));
|
|
27197
27656
|
});
|
|
27198
27657
|
|
|
27199
|
-
var chargingPileImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABHHSURBVHgBtVtdjF3VdV7rnHPHtLbUkRrALwmDidSSgD1JqWQ3UMaNMaFq63FIKyoVZFRF6kMkbCmVcP9mrBARoJUnLRL9c+3WSVsqIkwrtRBKfaGmQFuFazBpK0wYnmLSF6MYx557zt5Zv3vvO/Z4bDPZ9pl97rlnztnfXmt969s/g/AjKrN7nxwf634wBTFMYIQNAWASAcY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E9gebywlN66b3klilD2Pf31uDi6hLOvSi8u3X3t5sOGmT9FQqxqndk2iyZ50QKXjahPxqFrchL3WlQPS0Rkd9QgwG8DovujaUw4dlCnIqkiA+2NjzR2PH5x7Gi6xXLKFy3Lnb3xhOrRhL60tT3TFnwKIe/sejGDL6DpJgAXn+YSMx7iTk28O1z3SaUe8ZIc+hfCeJ772aB8us3wgwF4+d9cXplqIM6Hrprrgm9fSimSMaasE5JhGSG494iFMVKKgKvk7B94JT7D7NL2654m/v3ygXlYEsJfpu35rArCejm23jex7q/05D+qYOYHOORZcQSmFVYgpfunoY419ODP21UOH5lbsr9RWFHBZpqd3jsMVZybJyJTO4gbCPk6YJgjrRPZp+TFP7HaSMA9iFQfkyO/Awqr+SoIsyw8B5OTF820K0FQAAAAASUVORK5CYII=";
|
|
27200
|
-
|
|
27201
|
-
const useChargingPile = ({ viewBox, rotation = 0 }) => {
|
|
27202
|
-
const { svgElementDatas } = useSvgEditContext();
|
|
27203
|
-
const { sn } = useCommonContext();
|
|
27204
|
-
const items = useMemo(() => {
|
|
27205
|
-
if (!svgElementDatas || !viewBox)
|
|
27206
|
-
return [];
|
|
27207
|
-
const chargingPiles = svgElementDatas?.[DataType.CHARGING_PILE];
|
|
27208
|
-
if (!chargingPiles)
|
|
27209
|
-
return [];
|
|
27210
|
-
const results = [];
|
|
27211
|
-
for (const element of chargingPiles) {
|
|
27212
|
-
const center = element.points?.[0];
|
|
27213
|
-
if (!center)
|
|
27214
|
-
continue;
|
|
27215
|
-
const size = element.style?.radius ? element.style.radius * 2 : 55;
|
|
27216
|
-
const direction = element?.direction || 0;
|
|
27217
|
-
const angle = (direction * 180) / Math.PI;
|
|
27218
|
-
const rotationDegree = 270 - angle; // 正东是正方向,需要处理下
|
|
27219
|
-
const actualRotation = rotationDegree - rotation;
|
|
27220
|
-
const relX = (center[0] - viewBox.x) / viewBox.width;
|
|
27221
|
-
const relY = (center[1] - viewBox.y) / viewBox.height;
|
|
27222
|
-
if (isFinite(relX) && isFinite(relY)) {
|
|
27223
|
-
results.push({
|
|
27224
|
-
leftPct: relX * 100,
|
|
27225
|
-
topPct: relY * 100,
|
|
27226
|
-
size,
|
|
27227
|
-
rotateDeg: actualRotation,
|
|
27228
|
-
imageSrc: chargingPileImage,
|
|
27229
|
-
});
|
|
27230
|
-
}
|
|
27231
|
-
}
|
|
27232
|
-
return results;
|
|
27233
|
-
}, [svgElementDatas, viewBox?.x, viewBox?.y, viewBox?.width, viewBox?.height, rotation, sn]);
|
|
27234
|
-
return items;
|
|
27235
|
-
};
|
|
27236
|
-
|
|
27237
|
-
const CharginPile = React__default.memo(({ viewBox, rotation = 0, isHighlight = true }) => {
|
|
27238
|
-
const items = useChargingPile({ viewBox: viewBox || null, rotation });
|
|
27239
|
-
const containerStyle = useMemo(() => ({
|
|
27240
|
-
position: 'absolute',
|
|
27241
|
-
top: 0,
|
|
27242
|
-
left: 0,
|
|
27243
|
-
width: '100%',
|
|
27244
|
-
height: '100%',
|
|
27245
|
-
pointerEvents: 'none',
|
|
27246
|
-
zIndex: 750,
|
|
27247
|
-
opacity: isHighlight ? SvgMapOpacity.HIGHLIGHT : SvgMapOpacity.UN_HIGHLIGHT,
|
|
27248
|
-
}), [isHighlight]);
|
|
27249
|
-
return (jsx("div", { style: containerStyle, children: items?.map((item, idx) => (jsx("div", { className: "charging-pile", style: {
|
|
27250
|
-
position: 'absolute',
|
|
27251
|
-
width: item.size,
|
|
27252
|
-
height: item.size,
|
|
27253
|
-
left: `${item.leftPct}%`,
|
|
27254
|
-
top: `${item.topPct}%`,
|
|
27255
|
-
transform: `translate(-50%, -50%) rotate(${item.rotateDeg}deg)`,
|
|
27256
|
-
pointerEvents: 'auto',
|
|
27257
|
-
zIndex: 750,
|
|
27258
|
-
}, children: jsx("img", { src: item.imageSrc, style: { width: '100%', height: '100%', objectFit: 'contain', opacity: 1 } }) }, `pile-${idx}`))) }));
|
|
27259
|
-
});
|
|
27260
|
-
|
|
27261
27658
|
var css_248z$3 = ".index-module_container__7IatW {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n\n.index-module_boundaryLabel__GDHFn {\n position: absolute;\n background-color: rgba(30, 30, 31, 0.6);\n color: rgb(255, 255, 255);\n padding: 6px;\n border-radius: 12px;\n font-size: 12px;\n font-weight: bold;\n max-width: 220px;\n pointer-events: auto;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);\n cursor: pointer;\n user-select: none;\n white-space: nowrap;\n}\n.index-module_boundaryLabel__GDHFn .index-module_isolatedIcon__1pRXN {\n position: absolute;\n width: 24px;\n height: 24px;\n top: -30px;\n left: 50%;\n transform: translateX(-50%);\n}\n\n.index-module_base__qy2SG {\n font-size: 14px;\n}\n\n.index-module_extended__0TMAt {\n margin-top: 6px;\n font-size: 11px;\n opacity: 0.9;\n border-top: 1px solid rgba(255, 255, 255, 0.2);\n padding-top: 6px;\n}";
|
|
27262
27659
|
var styles$3 = {"container":"index-module_container__7IatW","boundaryLabel":"index-module_boundaryLabel__GDHFn","isolatedIcon":"index-module_isolatedIcon__1pRXN","base":"index-module_base__qy2SG","extended":"index-module_extended__0TMAt"};
|
|
27263
27660
|
styleInject(css_248z$3);
|
|
@@ -29095,9 +29492,9 @@ proj4.defs(WEB_MERCATOR, '+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +u
|
|
|
29095
29492
|
// 默认配置
|
|
29096
29493
|
const defaultMapConfig$1 = DEFAULT_STYLES;
|
|
29097
29494
|
// 地图渲染器组件
|
|
29098
|
-
const MowerMapRenderer = forwardRef(({ sn, mowerIconConfig = {}, platform = PlatformType.WEB, edger = false, unitType = UnitsType.Imperial, language = 'en', onlyRead = false, isHighlight = true, mapConfig,
|
|
29495
|
+
const MowerMapRenderer = forwardRef(({ sn, mowerIconConfig = {}, platform = PlatformType.WEB, mapType = MapType.NORMAL, edger = false, unitType = UnitsType.Imperial, language = 'en', onlyRead = false, isHighlight = true, mapConfig,
|
|
29099
29496
|
// pathConfig,
|
|
29100
|
-
modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onError, className, style, googleMapInstance: _googleMapInstance, dragMap = false, canRotateMap = false, dragCallbacks, defaultTransform, debug: _debug = false, doodleList = [], editMap = false, unStructMapData, disabledObstacles = false, onHandleEnterRecord, onHandleCompleteRecord, onHandleStopRecord, onHandleDeleteElement, onSaveBoundaryData, onSaveMap, onEditInfoMapChange, onUpdateBoundary, heightOptions, globalHeight, onHandleEvent, onSelectElement, }, ref) => {
|
|
29497
|
+
modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onError, className, style, zIndex, googleMapInstance: _googleMapInstance, dragMap = false, canRotateMap = false, dragCallbacks, defaultTransform, debug: _debug = false, doodleList = [], editMap = false, unStructMapData, disabledObstacles = false, onHandleEnterRecord, onHandleCompleteRecord, onHandleStopRecord, onHandleDeleteElement, onSaveBoundaryData, onSaveMap, onEditInfoMapChange, onUpdateBoundary, heightOptions, globalHeight, googleMapStaticApiKey, onHandleEvent, onSelectElement, onH5FirstSelectObstaclePoint, }, ref) => {
|
|
29101
29498
|
const [currentError, setCurrentError] = useState(null);
|
|
29102
29499
|
// const mapRef = useMap();
|
|
29103
29500
|
const [processStateIsMowing, setProcessStateIsMowing] = useState(false);
|
|
@@ -29255,48 +29652,6 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
|
|
|
29255
29652
|
currentMowingPartitionId,
|
|
29256
29653
|
processStateIsMowing,
|
|
29257
29654
|
]);
|
|
29258
|
-
const commonValue = useMemo(() => {
|
|
29259
|
-
return {
|
|
29260
|
-
sn,
|
|
29261
|
-
editMap,
|
|
29262
|
-
platform,
|
|
29263
|
-
language,
|
|
29264
|
-
unitType,
|
|
29265
|
-
svgViewBox,
|
|
29266
|
-
heightOptions,
|
|
29267
|
-
globalHeight,
|
|
29268
|
-
mapConfig: mergedMapConfig,
|
|
29269
|
-
mapJson,
|
|
29270
|
-
drag: {
|
|
29271
|
-
x: defaultTransform?.x ?? 0,
|
|
29272
|
-
y: defaultTransform?.y ?? 0,
|
|
29273
|
-
rotate: (defaultTransform?.rotation ?? 0) + originNorthRotate,
|
|
29274
|
-
},
|
|
29275
|
-
mapRef,
|
|
29276
|
-
overlayScale,
|
|
29277
|
-
doodleList,
|
|
29278
|
-
mowerIconConfig,
|
|
29279
|
-
showStraddleBoundaryBorder,
|
|
29280
|
-
};
|
|
29281
|
-
}, [
|
|
29282
|
-
sn,
|
|
29283
|
-
editMap,
|
|
29284
|
-
platform,
|
|
29285
|
-
svgViewBox,
|
|
29286
|
-
unitType,
|
|
29287
|
-
language,
|
|
29288
|
-
heightOptions,
|
|
29289
|
-
globalHeight,
|
|
29290
|
-
mergedMapConfig,
|
|
29291
|
-
mapJson,
|
|
29292
|
-
defaultTransform,
|
|
29293
|
-
originNorthRotate,
|
|
29294
|
-
mapRef,
|
|
29295
|
-
overlayScale,
|
|
29296
|
-
doodleList,
|
|
29297
|
-
mowerIconConfig,
|
|
29298
|
-
showStraddleBoundaryBorder,
|
|
29299
|
-
]);
|
|
29300
29655
|
const mowerPositionData = useMemo(() => {
|
|
29301
29656
|
// realTimeData 中包含三个种类的数据,之需要实时坐标的数据即可。
|
|
29302
29657
|
// 在初始的状态按照正常图标进行渲染,所以构造一个基本在rtk桩的一个数据
|
|
@@ -29342,15 +29697,12 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
|
|
|
29342
29697
|
const bounds = useMemo(() => {
|
|
29343
29698
|
if (!mapJson)
|
|
29344
29699
|
return null;
|
|
29345
|
-
|
|
29346
|
-
|
|
29347
|
-
|
|
29348
|
-
|
|
29349
|
-
return;
|
|
29700
|
+
const mapBoundsData = calculateMapBounds(mapJson);
|
|
29701
|
+
if (!mapBoundsData) {
|
|
29702
|
+
console.warn('Failed to calculate map bounds');
|
|
29703
|
+
return null;
|
|
29350
29704
|
}
|
|
29351
|
-
// 将自定义边界转换为Google Maps LatLngBounds(使用有效的GPS坐标)
|
|
29352
29705
|
const validBounds = getValidGpsBounds(mapJson, 0);
|
|
29353
|
-
// 地图数据中的坐标格式是 [longitude, latitude]
|
|
29354
29706
|
const [swLng0, swLat0] = validBounds.sw;
|
|
29355
29707
|
const [neLng0, neLat0] = validBounds.ne;
|
|
29356
29708
|
const [swX0, swY0] = proj4(WGS84, WEB_MERCATOR, [swLng0, swLat0]);
|
|
@@ -29361,11 +29713,78 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
|
|
|
29361
29713
|
const neY = neY0 + drag.y;
|
|
29362
29714
|
const [swLng, swLat] = proj4(WEB_MERCATOR, WGS84, [swX, swY]);
|
|
29363
29715
|
const [neLng, neLat] = proj4(WEB_MERCATOR, WGS84, [neX, neY]);
|
|
29364
|
-
|
|
29365
|
-
new window.google.maps.LatLng(neLat, neLng) // 东北角
|
|
29366
|
-
);
|
|
29367
|
-
return googleBounds;
|
|
29716
|
+
return new window.google.maps.LatLngBounds(new window.google.maps.LatLng(swLat, swLng), new window.google.maps.LatLng(neLat, neLng));
|
|
29368
29717
|
}, [mapJson, drag.x, drag.y]);
|
|
29718
|
+
const commonValue = useMemo(() => {
|
|
29719
|
+
return {
|
|
29720
|
+
sn,
|
|
29721
|
+
editMap,
|
|
29722
|
+
platform,
|
|
29723
|
+
language,
|
|
29724
|
+
unitType,
|
|
29725
|
+
svgViewBox,
|
|
29726
|
+
heightOptions,
|
|
29727
|
+
globalHeight,
|
|
29728
|
+
mapConfig: mergedMapConfig,
|
|
29729
|
+
mapJson,
|
|
29730
|
+
drag: {
|
|
29731
|
+
x: defaultTransform?.x ?? 0,
|
|
29732
|
+
y: defaultTransform?.y ?? 0,
|
|
29733
|
+
rotate: (defaultTransform?.rotation ?? 0) + originNorthRotate,
|
|
29734
|
+
},
|
|
29735
|
+
mapRef,
|
|
29736
|
+
bounds,
|
|
29737
|
+
overlayScale,
|
|
29738
|
+
doodleList,
|
|
29739
|
+
mowerIconConfig,
|
|
29740
|
+
showStraddleBoundaryBorder,
|
|
29741
|
+
overlayLayout,
|
|
29742
|
+
googleMapStaticApiKey,
|
|
29743
|
+
onH5FirstSelectObstaclePoint,
|
|
29744
|
+
};
|
|
29745
|
+
}, [
|
|
29746
|
+
sn,
|
|
29747
|
+
editMap,
|
|
29748
|
+
platform,
|
|
29749
|
+
svgViewBox,
|
|
29750
|
+
unitType,
|
|
29751
|
+
language,
|
|
29752
|
+
heightOptions,
|
|
29753
|
+
globalHeight,
|
|
29754
|
+
mergedMapConfig,
|
|
29755
|
+
mapJson,
|
|
29756
|
+
defaultTransform,
|
|
29757
|
+
originNorthRotate,
|
|
29758
|
+
mapRef,
|
|
29759
|
+
bounds,
|
|
29760
|
+
overlayScale,
|
|
29761
|
+
doodleList,
|
|
29762
|
+
mowerIconConfig,
|
|
29763
|
+
showStraddleBoundaryBorder,
|
|
29764
|
+
overlayLayout,
|
|
29765
|
+
googleMapStaticApiKey,
|
|
29766
|
+
onH5FirstSelectObstaclePoint,
|
|
29767
|
+
]);
|
|
29768
|
+
/**
|
|
29769
|
+
* 这里做了一个配置,以防以后如果有多种不同的类型的情况,需要展示不同的元素
|
|
29770
|
+
*/
|
|
29771
|
+
const mapHasElements = useMemo(() => {
|
|
29772
|
+
// 地理围栏地图,没有充电桩,没有天线,没有割草机位置,没有边界标签
|
|
29773
|
+
if (mapType === MapType.GEO_FENCE) {
|
|
29774
|
+
return {
|
|
29775
|
+
hasChargingPile: true,
|
|
29776
|
+
hasAntenna: false,
|
|
29777
|
+
hasMowerPosition: false,
|
|
29778
|
+
hasBoundaryLabels: false,
|
|
29779
|
+
};
|
|
29780
|
+
}
|
|
29781
|
+
return {
|
|
29782
|
+
hasChargingPile: true,
|
|
29783
|
+
hasAntenna: true,
|
|
29784
|
+
hasMowerPosition: true,
|
|
29785
|
+
hasBoundaryLabels: true,
|
|
29786
|
+
};
|
|
29787
|
+
}, [mapType]);
|
|
29369
29788
|
const fitBounds = useCallback((padding = 0) => {
|
|
29370
29789
|
if (!mapJson || !mapRef)
|
|
29371
29790
|
return null;
|
|
@@ -29680,7 +30099,7 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
|
|
|
29680
30099
|
// svgEditMapRef?.current?.adjustSvgSize?.(layout);
|
|
29681
30100
|
setOverlayLayout(layout);
|
|
29682
30101
|
}
|
|
29683
|
-
}, map: mapRef, mapPaneName: 'overlayMouseTarget', bounds: bounds, rotate: actureRotate, children: [jsx(MapDrag, { map: mapRef, dragCallbacks: dragCallbacks, onBoundaryLabelsCollapse: () => { }, onTransformChange: handleDragMove, isDragMap: dragMap, canRotateMap: canRotateMap }), jsx(MowPartitionContextProvider, { value: mowPartitionValue, children: jsx(SvgMapComponent, { isHighlight: isHighlight, editMap: editMap, ref: svgMapRef, pathData: pathJson, mapConfig: mergedMapConfig, mowPartitionData: mowPartitionData }) }), jsx(MowerPosition, { editMap: editMap, mowerPositionData: mowerPositionData, viewBox: svgViewBox || null, modelType: modelType, hasEdger: edger, mapData: mapJson, mapConfig: mergedMapConfig, realTimeData: realTimeData, onMowingPositionChange: onMowingPositionChange, isHighlight: isHighlight }), jsx(CharginPile, { viewBox: svgViewBox || null, rotation: actureRotate, isHighlight: isHighlight }), jsx(BoundaryLabels, { editMap: editMap, mapData: mapJson, onlyRead: onlyRead, pathData: pathJson, unitType: unitType, viewBox: svgViewBox || null, rotation: actureRotate, mowPartitionData: mowPartitionData, realTimeData: realTimeData, isHighlight: isHighlight }), jsx(Antennas, { editMap: editMap, antennaConfig: antennaConfig || [], layout: overlayLayout || undefined, viewBox: svgViewBox || null, rotation: actureRotate, onlyRead: onlyRead, isHighlight: isHighlight }), jsx(SvgEditMap, { editMap: editMap, ref: svgEditMapRef, mapConfig: mergedMapConfig, onEditInfoMapChange: onEditInfoMapChange })] })] }) }) }));
|
|
30102
|
+
}, map: mapRef, mapPaneName: 'overlayMouseTarget', bounds: bounds, rotate: actureRotate, zIndex: zIndex, children: [jsx(MapDrag, { map: mapRef, dragCallbacks: dragCallbacks, onBoundaryLabelsCollapse: () => { }, onTransformChange: handleDragMove, isDragMap: dragMap, canRotateMap: canRotateMap }), jsx(MowPartitionContextProvider, { value: mowPartitionValue, children: jsx(SvgMapComponent, { isHighlight: isHighlight, editMap: editMap, ref: svgMapRef, pathData: pathJson, mapConfig: mergedMapConfig, mowPartitionData: mowPartitionData }) }), mapHasElements.hasMowerPosition && (jsx(MowerPosition, { editMap: editMap, mowerPositionData: mowerPositionData, viewBox: svgViewBox || null, modelType: modelType, hasEdger: edger, mapData: mapJson, mapConfig: mergedMapConfig, realTimeData: realTimeData, onMowingPositionChange: onMowingPositionChange, isHighlight: isHighlight })), mapHasElements.hasChargingPile && (jsx(CharginPile, { viewBox: svgViewBox || null, rotation: actureRotate, isHighlight: isHighlight })), mapHasElements.hasBoundaryLabels && (jsx(BoundaryLabels, { editMap: editMap, mapData: mapJson, onlyRead: onlyRead, pathData: pathJson, unitType: unitType, viewBox: svgViewBox || null, rotation: actureRotate, mowPartitionData: mowPartitionData, realTimeData: realTimeData, isHighlight: isHighlight })), mapHasElements.hasAntenna && (jsx(Antennas, { editMap: editMap, antennaConfig: antennaConfig || [], layout: overlayLayout || undefined, viewBox: svgViewBox || null, rotation: actureRotate, onlyRead: onlyRead, isHighlight: isHighlight })), jsx(SvgEditMap, { editMap: editMap, ref: svgEditMapRef, mapConfig: mergedMapConfig, onEditInfoMapChange: onEditInfoMapChange })] })] }) }) }));
|
|
29684
30103
|
});
|
|
29685
30104
|
MowerMapRenderer.displayName = 'MowerMapRenderer';
|
|
29686
30105
|
|
|
@@ -29775,4 +30194,4 @@ const BoundarySvgRender = React__default.memo(({ mapJson, unStructMapData, id, m
|
|
|
29775
30194
|
}) }), jsx(CharginPile, { viewBox: boundaryViewBox || null, rotation: 0 })] }) }) }));
|
|
29776
30195
|
});
|
|
29777
30196
|
|
|
29778
|
-
export { ALL_DIRECTION_SELECTED, AntennaData, BaseData, BoundaryData, BoundarySvgRender, ChannelData, ChargingPileData, CheckDoodleErrorType, CheckObstaclePointErrorType, ClickEventType, CreateStatus, DataType, DoodleData, MAX_DIRECTION_ANGLE, MIN_DIRECTION_ANGLE, MobileEditMode, MowGateData, MowerMapRenderer, ObstacleData, PathData, PlatformType, RecordFunctionEnum, RecordTypeEnum, RenderType, SCALE_FACTOR, SvgParserNative, UnifiedMapDataProcessor, VisionOffData, calculateMapGpsCenter, estimateGpsFromMapBounds, getValidGpsBounds, initBoundary, initChannel, initDoodle, initObstacle, initVisionOff, restorePointsFormat };
|
|
30197
|
+
export { ALL_DIRECTION_SELECTED, AntennaData, BaseData, BoundaryData, BoundarySvgRender, ChannelData, ChargingPileData, CheckDoodleErrorType, CheckObstaclePointErrorType, ClickEventType, CreateStatus, DataType, DoodleData, MAX_DIRECTION_ANGLE, MIN_DIRECTION_ANGLE, MapType, MobileEditMode, MowGateData, MowerMapRenderer, ObstacleData, PathData, PlatformType, RecordFunctionEnum, RecordTypeEnum, RenderType, SCALE_FACTOR, SvgParserNative, UnifiedMapDataProcessor, VisionOffData, calculateMapGpsCenter, estimateGpsFromMapBounds, getValidGpsBounds, initBoundary, initChannel, initDoodle, initObstacle, initVisionOff, restorePointsFormat };
|