@fleet-frontend/mower-maps 0.2.5-beta.13 → 0.2.5-beta.15
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,eAAO,MAAM,mBAAmB;;;CAG/B,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;CAUtB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;CAOpB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;CAUf,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;CAYrB,CAAC;AAGX,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEjF,eAAO,MAAM,qBAAqB,sqUAqB3B,CAAC;AAER;;GAEG;AACH,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B;;GAEG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC;;GAEG;AACH,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC;;GAEG;AACH,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAC9C;;GAEG;AACH,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC;;GAEG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC;;GAEG;AACH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC;;GAEG;AACH,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAChD;;GAEG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC;;GAEG;AACH,eAAO,MAAM,UAAU,KAAK,CAAC;AAE7B,eAAO,MAAM,eAAe,4BAA4B,CAAC;AAEzD,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAGtC,eAAO,MAAM,wBAAwB,WAAW,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -10613,9 +10613,13 @@ var SvgMapOpacity;
|
|
|
10613
10613
|
* 地图渲染相关常量配置
|
|
10614
10614
|
*/
|
|
10615
10615
|
// 默认坐标
|
|
10616
|
+
// export const DEFAULT_COORDINATES = {
|
|
10617
|
+
// sw: [116.071044, 40.102099],
|
|
10618
|
+
// ne: [116.0734, 40.103901],
|
|
10619
|
+
// };
|
|
10616
10620
|
const DEFAULT_COORDINATES = {
|
|
10617
|
-
sw: [
|
|
10618
|
-
ne: [
|
|
10621
|
+
sw: [-1178e-6, -901e-6],
|
|
10622
|
+
ne: [0.001178, 0.000901],
|
|
10619
10623
|
};
|
|
10620
10624
|
/**
|
|
10621
10625
|
* 缩放因子 - 将米转换为像素
|
|
@@ -18582,10 +18586,10 @@ function estimateGpsFromMapBounds(mapData) {
|
|
|
18582
18586
|
const mapWidthMeters = maxXMeters - minXMeters;
|
|
18583
18587
|
const mapHeightMeters = maxYMeters - minYMeters;
|
|
18584
18588
|
// 凤凰岭的GPS坐标作为地图中心点
|
|
18585
|
-
const centerLat = 40.103;
|
|
18586
|
-
const centerLng = 116.072222;
|
|
18587
|
-
|
|
18588
|
-
|
|
18589
|
+
// const centerLat = 40.103;
|
|
18590
|
+
// const centerLng = 116.072222;
|
|
18591
|
+
const centerLat = 0;
|
|
18592
|
+
const centerLng = 0;
|
|
18589
18593
|
// 精确的坐标转换常数
|
|
18590
18594
|
// 1度纬度 = 约111,320米(在地球上任何地方都基本相同)
|
|
18591
18595
|
// 1度经度 = 约111,320 * cos(纬度) 米(随纬度变化)
|
|
@@ -20048,12 +20052,12 @@ function styleInject(css, ref) {
|
|
|
20048
20052
|
}
|
|
20049
20053
|
}
|
|
20050
20054
|
|
|
20051
|
-
var css_248z$
|
|
20052
|
-
var styles$
|
|
20053
|
-
styleInject(css_248z$
|
|
20055
|
+
var css_248z$8 = ".index-module_edit__-5VvX {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n pointer-events: auto;\n z-index: 1000;\n cursor: move;\n touch-action: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n.index-module_edit__-5VvX .index-module_border__JdNLM {\n position: absolute;\n inset: -10px;\n border: 2px dashed rgb(241, 102, 41);\n border-radius: 2px;\n pointer-events: none;\n}\n.index-module_edit__-5VvX .index-module_drag__uvdPG {\n position: absolute;\n inset: -10px;\n border-radius: 2px;\n}\n.index-module_edit__-5VvX .index-module_rotate__H-KIZ {\n position: absolute;\n top: -20px;\n right: -20px;\n width: 20px;\n height: 20px;\n cursor: grab;\n z-index: 1001;\n pointer-events: auto;\n}\n.index-module_edit__-5VvX .index-module_move__mZF8s {\n position: absolute;\n bottom: -20px;\n left: -20px;\n width: 20px;\n height: 20px;\n cursor: move;\n z-index: 1001;\n pointer-events: auto;\n}";
|
|
20056
|
+
var styles$8 = {"edit":"index-module_edit__-5VvX","border":"index-module_border__JdNLM","drag":"index-module_drag__uvdPG","rotate":"index-module_rotate__H-KIZ","move":"index-module_move__mZF8s"};
|
|
20057
|
+
styleInject(css_248z$8);
|
|
20054
20058
|
|
|
20055
20059
|
const RotateHandle = ({ onRotateStart, isRotating }) => {
|
|
20056
|
-
return (jsx("div", { className: styles$
|
|
20060
|
+
return (jsx("div", { className: styles$8.rotate, onMouseDown: (e) => onRotateStart(e), onTouchStart: (e) => onRotateStart(e), style: { cursor: isRotating ? 'grabbing' : 'grab' }, dangerouslySetInnerHTML: { __html: DEFAULT_ROTATE_ICON } }));
|
|
20057
20061
|
};
|
|
20058
20062
|
|
|
20059
20063
|
/**
|
|
@@ -20130,7 +20134,7 @@ const DragHandle = ({ onDragStart, isDragging }) => {
|
|
|
20130
20134
|
if (!isMobileDevice()) {
|
|
20131
20135
|
return null;
|
|
20132
20136
|
}
|
|
20133
|
-
return (jsx("div", { className: styles$
|
|
20137
|
+
return (jsx("div", { className: styles$8.move, onMouseDown: (e) => {
|
|
20134
20138
|
onDragStart(e);
|
|
20135
20139
|
}, onTouchStart: (e) => onDragStart(e), onMouseUp: (e) => {
|
|
20136
20140
|
// onDragEnd(e);
|
|
@@ -20162,7 +20166,7 @@ const MapDrag = ({ map: _map, dragCallbacks, onBoundaryLabelsCollapse, onTransfo
|
|
|
20162
20166
|
if (!isDragMap) {
|
|
20163
20167
|
return null;
|
|
20164
20168
|
}
|
|
20165
|
-
return (jsxs("div", { ref: containerRef, className: styles$
|
|
20169
|
+
return (jsxs("div", { ref: containerRef, className: styles$8.edit, style: { cursor: isDragging ? 'grabbing' : 'move' }, children: [jsx("div", { className: styles$8.border }), canRotateMap && jsx(RotateHandle, { onRotateStart: handleRotateStart, isRotating: isRotating }), jsx("div", { className: styles$8.drag, onMouseDown: handleDragStartEvent, onTouchStart: handleDragStartEvent }), jsx(DragHandle, { onDragStart: handleDragStartEvent, isDragging: isDragging })] }));
|
|
20166
20170
|
};
|
|
20167
20171
|
|
|
20168
20172
|
const SvgEditContext = createContext({
|
|
@@ -23595,9 +23599,9 @@ const Magnifier = ({ visible, dragState, polygonPoints, fillColor = 'rgba(255, 1
|
|
|
23595
23599
|
return ReactDOM.createPortal(magnifierContent, document.body);
|
|
23596
23600
|
};
|
|
23597
23601
|
|
|
23598
|
-
var css_248z$
|
|
23599
|
-
var styles$
|
|
23600
|
-
styleInject(css_248z$
|
|
23602
|
+
var css_248z$7 = ".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}";
|
|
23603
|
+
var styles$7 = {"pointerCursor":"index-module_pointerCursor__Ee6pr","polygonPath":"index-module_polygonPath__PynOn","dragging":"index-module_dragging__xSFdO","notCreate":"index-module_notCreate__bFnkV"};
|
|
23604
|
+
styleInject(css_248z$7);
|
|
23601
23605
|
|
|
23602
23606
|
/**
|
|
23603
23607
|
* 几何计算工具函数
|
|
@@ -24020,28 +24024,102 @@ const useCheckElement = () => {
|
|
|
24020
24024
|
};
|
|
24021
24025
|
};
|
|
24022
24026
|
|
|
24027
|
+
var css_248z$6 = ".Tooltip-module_tooltip__Wexlk {\n position: fixed;\n background-color: #fff;\n border-radius: 4px;\n height: 20px;\n line-height: 20px;\n font-size: 12px;\n color: #211F1F;\n padding: 0 4px;\n white-space: nowrap;\n z-index: 9999;\n cursor: pointer;\n user-select: none;\n}\n.Tooltip-module_tooltip__Wexlk.Tooltip-module_tooltipHover__Tfqme {\n height: 30px;\n padding: 5px 12px;\n}\n.Tooltip-module_tooltip__Wexlk.Tooltip-module_tooltipHover__Tfqme:hover {\n background-color: #FFEFE6;\n}";
|
|
24028
|
+
var styles$6 = {"tooltip":"Tooltip-module_tooltip__Wexlk","tooltipHover":"Tooltip-module_tooltipHover__Tfqme"};
|
|
24029
|
+
styleInject(css_248z$6);
|
|
24030
|
+
|
|
24031
|
+
var classnames = {exports: {}};
|
|
24032
|
+
|
|
24033
|
+
/*!
|
|
24034
|
+
Copyright (c) 2018 Jed Watson.
|
|
24035
|
+
Licensed under the MIT License (MIT), see
|
|
24036
|
+
http://jedwatson.github.io/classnames
|
|
24037
|
+
*/
|
|
24038
|
+
|
|
24039
|
+
(function (module) {
|
|
24040
|
+
/* global define */
|
|
24041
|
+
|
|
24042
|
+
(function () {
|
|
24043
|
+
|
|
24044
|
+
var hasOwn = {}.hasOwnProperty;
|
|
24045
|
+
|
|
24046
|
+
function classNames () {
|
|
24047
|
+
var classes = '';
|
|
24048
|
+
|
|
24049
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
24050
|
+
var arg = arguments[i];
|
|
24051
|
+
if (arg) {
|
|
24052
|
+
classes = appendClass(classes, parseValue(arg));
|
|
24053
|
+
}
|
|
24054
|
+
}
|
|
24055
|
+
|
|
24056
|
+
return classes;
|
|
24057
|
+
}
|
|
24058
|
+
|
|
24059
|
+
function parseValue (arg) {
|
|
24060
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
24061
|
+
return arg;
|
|
24062
|
+
}
|
|
24063
|
+
|
|
24064
|
+
if (typeof arg !== 'object') {
|
|
24065
|
+
return '';
|
|
24066
|
+
}
|
|
24067
|
+
|
|
24068
|
+
if (Array.isArray(arg)) {
|
|
24069
|
+
return classNames.apply(null, arg);
|
|
24070
|
+
}
|
|
24071
|
+
|
|
24072
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
24073
|
+
return arg.toString();
|
|
24074
|
+
}
|
|
24075
|
+
|
|
24076
|
+
var classes = '';
|
|
24077
|
+
|
|
24078
|
+
for (var key in arg) {
|
|
24079
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
24080
|
+
classes = appendClass(classes, key);
|
|
24081
|
+
}
|
|
24082
|
+
}
|
|
24083
|
+
|
|
24084
|
+
return classes;
|
|
24085
|
+
}
|
|
24086
|
+
|
|
24087
|
+
function appendClass (value, newClass) {
|
|
24088
|
+
if (!newClass) {
|
|
24089
|
+
return value;
|
|
24090
|
+
}
|
|
24091
|
+
|
|
24092
|
+
if (value) {
|
|
24093
|
+
return value + ' ' + newClass;
|
|
24094
|
+
}
|
|
24095
|
+
|
|
24096
|
+
return value + newClass;
|
|
24097
|
+
}
|
|
24098
|
+
|
|
24099
|
+
if (module.exports) {
|
|
24100
|
+
classNames.default = classNames;
|
|
24101
|
+
module.exports = classNames;
|
|
24102
|
+
} else {
|
|
24103
|
+
window.classNames = classNames;
|
|
24104
|
+
}
|
|
24105
|
+
}());
|
|
24106
|
+
} (classnames));
|
|
24107
|
+
|
|
24108
|
+
var classnamesExports = classnames.exports;
|
|
24109
|
+
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
24110
|
+
|
|
24023
24111
|
const Tooltip = ({ open, x, y, text, style, onClick }) => {
|
|
24024
24112
|
if (!open)
|
|
24025
24113
|
return null;
|
|
24026
24114
|
const tooltipStyle = {
|
|
24027
|
-
position: 'fixed',
|
|
24028
24115
|
left: x,
|
|
24029
24116
|
top: y,
|
|
24030
|
-
backgroundColor: '#fff',
|
|
24031
|
-
borderRadius: '4px',
|
|
24032
|
-
height: '20px',
|
|
24033
|
-
lineHeight: '16px',
|
|
24034
|
-
fontSize: '12px',
|
|
24035
|
-
color: '#211F1F',
|
|
24036
|
-
padding: '2px 4px',
|
|
24037
|
-
whiteSpace: 'nowrap',
|
|
24038
|
-
zIndex: 9999,
|
|
24039
|
-
cursor: 'pointer',
|
|
24040
|
-
userSelect: 'none',
|
|
24041
24117
|
...style,
|
|
24042
24118
|
};
|
|
24043
24119
|
// 使用 createPortal 挂载到 body
|
|
24044
|
-
return createPortal(jsx("div", {
|
|
24120
|
+
return createPortal(jsx("div", { className: classNames(styles$6.tooltip, {
|
|
24121
|
+
[styles$6.tooltipHover]: !!onClick,
|
|
24122
|
+
}), style: tooltipStyle, onClick: (e) => {
|
|
24045
24123
|
e.preventDefault();
|
|
24046
24124
|
e.stopPropagation();
|
|
24047
24125
|
onClick?.();
|
|
@@ -24187,6 +24265,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24187
24265
|
const [tooltipIndex, setTooltipIndex] = useState(null);
|
|
24188
24266
|
const [tooltipPos, setTooltipPos] = useState({ x: 0, y: 0 });
|
|
24189
24267
|
const [completeTooltipOpen, setCompleteTooltipOpen] = useState(false);
|
|
24268
|
+
const [moveTooltipOpen, setMoveTooltipOpen] = useState(false);
|
|
24190
24269
|
const updateTooltipPos = (target) => {
|
|
24191
24270
|
const rect = target.getBoundingClientRect();
|
|
24192
24271
|
setTooltipPos({
|
|
@@ -24455,8 +24534,8 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24455
24534
|
}, [dragState.currentPosition, checkCanNotCreateAtPosition, coordinates]);
|
|
24456
24535
|
const generateVertexClassName = useMemo(() => {
|
|
24457
24536
|
if (!dragState.isDragging)
|
|
24458
|
-
return styles$
|
|
24459
|
-
return showNotCreateCursor ? styles$
|
|
24537
|
+
return styles$7.pointerCursor;
|
|
24538
|
+
return showNotCreateCursor ? styles$7.notCreate : styles$7.dragging;
|
|
24460
24539
|
}, [dragState.isDragging, showNotCreateCursor]);
|
|
24461
24540
|
// 使用 useRef 来存储 requestAnimationFrame ID
|
|
24462
24541
|
const rafIdRef = useRef(null);
|
|
@@ -24747,7 +24826,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24747
24826
|
WebkitTouchCallout: 'none',
|
|
24748
24827
|
touchAction: 'none',
|
|
24749
24828
|
} })] }));
|
|
24750
|
-
})()] })), renderCoordinates.length >= 2 && (jsx("polygon", { className: canSelect ? styles$
|
|
24829
|
+
})()] })), renderCoordinates.length >= 2 && (jsx("polygon", { className: canSelect ? styles$7.pointerCursor : '', points: polygonPoints, fill: isHover ? hoverFillColor || fillColor : fillColor, fillOpacity: fillOpacity, stroke: "none" // 边框透明
|
|
24751
24830
|
, onClick: onPolygonClick })), jsx("g", { children: renderCoordinates.length >= 2 &&
|
|
24752
24831
|
pathSegments.map((segment, index) => {
|
|
24753
24832
|
if (segment.points.length < 2)
|
|
@@ -24755,14 +24834,14 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24755
24834
|
const pathData = createPathData(segment.points);
|
|
24756
24835
|
const isDash = segment.type === 1;
|
|
24757
24836
|
if (isDash && showStraddleBoundaryBorder) {
|
|
24758
|
-
return (jsx(DashPath, { className: canSelect ? styles$
|
|
24837
|
+
return (jsx(DashPath, { className: canSelect ? styles$7.polygonPath : '', points: segment.points, stroke: strokeColor, strokeWidth: isHover ? strokeWidth + 1 : strokeWidth, strokeOpacity: strokeOpacity }, index));
|
|
24759
24838
|
}
|
|
24760
24839
|
return (jsxs(Fragment, { children: [(editMode || createMode) && (jsx("path", { d: pathData, fill: "none", stroke: '#fff', strokeWidth: strokeWidth * 2, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", style: {
|
|
24761
24840
|
userSelect: 'none',
|
|
24762
24841
|
WebkitUserSelect: 'none',
|
|
24763
24842
|
WebkitTouchCallout: 'none',
|
|
24764
24843
|
touchAction: 'none',
|
|
24765
|
-
} }, 'warp' + index)), jsx("path", { d: pathData, fill: "none", stroke: strokeColor, strokeWidth: isHover ? strokeWidth + 1 : strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", className: canSelect ? styles$
|
|
24844
|
+
} }, 'warp' + index)), jsx("path", { d: pathData, fill: "none", stroke: strokeColor, strokeWidth: isHover ? strokeWidth + 1 : strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", className: canSelect ? styles$7.polygonPath : '', vectorEffect: "non-scaling-stroke", onClick: onPathClick, style: {
|
|
24766
24845
|
userSelect: 'none',
|
|
24767
24846
|
WebkitUserSelect: 'none',
|
|
24768
24847
|
WebkitTouchCallout: 'none',
|
|
@@ -24793,7 +24872,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24793
24872
|
: platform === PlatformType.H5
|
|
24794
24873
|
? strokeWidth * 2
|
|
24795
24874
|
: strokeWidth;
|
|
24796
|
-
return (jsx("line", { ...edgeLineCommon, stroke: edgeStroke, strokeWidth: edgeStrokeWidth, ...(isH5SolidHitOnly ? { strokeLinecap: 'round' } : {}), className: editMode ? styles$
|
|
24875
|
+
return (jsx("line", { ...edgeLineCommon, stroke: edgeStroke, strokeWidth: edgeStrokeWidth, ...(isH5SolidHitOnly ? { strokeLinecap: 'round' } : {}), className: editMode ? styles$7.pointerCursor : '', style: edgeLineStyle, vectorEffect: "non-scaling-stroke", ...(platform === PlatformType.H5
|
|
24797
24876
|
? {
|
|
24798
24877
|
onTouchStart: createReactEventHandler((e) => handleEdgeLongPressStart(e, index)),
|
|
24799
24878
|
onTouchEnd: createReactEventHandler(() => handleEdgeLongPressEnd()),
|
|
@@ -24863,7 +24942,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24863
24942
|
isDoubleClickingRef.current = false;
|
|
24864
24943
|
}, 300);
|
|
24865
24944
|
// 打开删除确认 Tooltip(仅在可编辑时)
|
|
24866
|
-
if (editMode || (createMode && completed)) {
|
|
24945
|
+
if ((editMode || (createMode && completed)) && renderCoordinates.length > 3) {
|
|
24867
24946
|
updateTooltipPos(e.target);
|
|
24868
24947
|
setTooltipIndex(idx);
|
|
24869
24948
|
}
|
|
@@ -24940,17 +25019,25 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24940
25019
|
}
|
|
24941
25020
|
}
|
|
24942
25021
|
},
|
|
24943
|
-
onMouseEnter:
|
|
24944
|
-
|
|
25022
|
+
onMouseEnter: (e) => {
|
|
25023
|
+
if (canComplete) {
|
|
24945
25024
|
setCompleteTooltipOpen(true);
|
|
25025
|
+
}
|
|
25026
|
+
if (editMode || (createMode && completed)) {
|
|
25027
|
+
setMoveTooltipOpen(true);
|
|
25028
|
+
}
|
|
25029
|
+
if (tooltipIndex === null) {
|
|
24946
25030
|
updateTooltipPos(e.target);
|
|
24947
25031
|
}
|
|
24948
|
-
|
|
24949
|
-
onMouseLeave:
|
|
24950
|
-
|
|
25032
|
+
},
|
|
25033
|
+
onMouseLeave: () => {
|
|
25034
|
+
if (canComplete) {
|
|
24951
25035
|
setCompleteTooltipOpen(false);
|
|
24952
25036
|
}
|
|
24953
|
-
|
|
25037
|
+
if (editMode || (createMode && completed)) {
|
|
25038
|
+
setMoveTooltipOpen(false);
|
|
25039
|
+
}
|
|
25040
|
+
},
|
|
24954
25041
|
}) }), platform === PlatformType.H5 && tooltipIndex === idx && coordinates.length > 3 && (jsxs("g", { transform: `translate(${coord[0] + 4 * overlayScale * 2}, ${coord[1] - 4 * overlayScale * 2}) scale(${overlayScale * 2})`, onClick: (e) => {
|
|
24955
25042
|
e.preventDefault();
|
|
24956
25043
|
e.stopPropagation();
|
|
@@ -24981,7 +25068,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24981
25068
|
onVertexDelete(renderCoordinates?.length - 1 - tooltipIndex);
|
|
24982
25069
|
}
|
|
24983
25070
|
setTooltipIndex(null);
|
|
24984
|
-
} })), platform === PlatformType.WEB && completeTooltipOpen && (jsx(Tooltip, { open: true, x: tooltipPos.x, y: tooltipPos.y, text: "Click to finish" }))] }));
|
|
25071
|
+
} })), platform === PlatformType.WEB && completeTooltipOpen && (jsx(Tooltip, { open: true, x: tooltipPos.x, y: tooltipPos.y, text: "Click to finish" })), platform === PlatformType.WEB && moveTooltipOpen && tooltipIndex === null && (jsx(Tooltip, { open: true, x: tooltipPos.x, y: tooltipPos.y, text: 'Drag to change' + (renderCoordinates.length > 3 ? ', double click to remove' : '') }))] }));
|
|
24985
25072
|
};
|
|
24986
25073
|
|
|
24987
25074
|
const MowPartitionContext = createContext({
|
|
@@ -28036,86 +28123,6 @@ var css_248z$1 = ".index-module_mapEdit__XC5Gw {\n position: absolute;\n left:
|
|
|
28036
28123
|
var styles$1 = {"mapEdit":"index-module_mapEdit__XC5Gw","createMode":"index-module_createMode__14EPH","notCreateCursor":"index-module_notCreateCursor__1-OjF"};
|
|
28037
28124
|
styleInject(css_248z$1);
|
|
28038
28125
|
|
|
28039
|
-
var classnames = {exports: {}};
|
|
28040
|
-
|
|
28041
|
-
/*!
|
|
28042
|
-
Copyright (c) 2018 Jed Watson.
|
|
28043
|
-
Licensed under the MIT License (MIT), see
|
|
28044
|
-
http://jedwatson.github.io/classnames
|
|
28045
|
-
*/
|
|
28046
|
-
|
|
28047
|
-
(function (module) {
|
|
28048
|
-
/* global define */
|
|
28049
|
-
|
|
28050
|
-
(function () {
|
|
28051
|
-
|
|
28052
|
-
var hasOwn = {}.hasOwnProperty;
|
|
28053
|
-
|
|
28054
|
-
function classNames () {
|
|
28055
|
-
var classes = '';
|
|
28056
|
-
|
|
28057
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
28058
|
-
var arg = arguments[i];
|
|
28059
|
-
if (arg) {
|
|
28060
|
-
classes = appendClass(classes, parseValue(arg));
|
|
28061
|
-
}
|
|
28062
|
-
}
|
|
28063
|
-
|
|
28064
|
-
return classes;
|
|
28065
|
-
}
|
|
28066
|
-
|
|
28067
|
-
function parseValue (arg) {
|
|
28068
|
-
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
28069
|
-
return arg;
|
|
28070
|
-
}
|
|
28071
|
-
|
|
28072
|
-
if (typeof arg !== 'object') {
|
|
28073
|
-
return '';
|
|
28074
|
-
}
|
|
28075
|
-
|
|
28076
|
-
if (Array.isArray(arg)) {
|
|
28077
|
-
return classNames.apply(null, arg);
|
|
28078
|
-
}
|
|
28079
|
-
|
|
28080
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
28081
|
-
return arg.toString();
|
|
28082
|
-
}
|
|
28083
|
-
|
|
28084
|
-
var classes = '';
|
|
28085
|
-
|
|
28086
|
-
for (var key in arg) {
|
|
28087
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
28088
|
-
classes = appendClass(classes, key);
|
|
28089
|
-
}
|
|
28090
|
-
}
|
|
28091
|
-
|
|
28092
|
-
return classes;
|
|
28093
|
-
}
|
|
28094
|
-
|
|
28095
|
-
function appendClass (value, newClass) {
|
|
28096
|
-
if (!newClass) {
|
|
28097
|
-
return value;
|
|
28098
|
-
}
|
|
28099
|
-
|
|
28100
|
-
if (value) {
|
|
28101
|
-
return value + ' ' + newClass;
|
|
28102
|
-
}
|
|
28103
|
-
|
|
28104
|
-
return value + newClass;
|
|
28105
|
-
}
|
|
28106
|
-
|
|
28107
|
-
if (module.exports) {
|
|
28108
|
-
classNames.default = classNames;
|
|
28109
|
-
module.exports = classNames;
|
|
28110
|
-
} else {
|
|
28111
|
-
window.classNames = classNames;
|
|
28112
|
-
}
|
|
28113
|
-
}());
|
|
28114
|
-
} (classnames));
|
|
28115
|
-
|
|
28116
|
-
var classnamesExports = classnames.exports;
|
|
28117
|
-
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
28118
|
-
|
|
28119
28126
|
/******************************************************************************
|
|
28120
28127
|
Copyright (c) Microsoft Corporation.
|
|
28121
28128
|
|
|
@@ -29818,7 +29825,7 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
|
|
|
29818
29825
|
* 这里做了一个配置,以防以后如果有多种不同的类型的情况,需要展示不同的元素
|
|
29819
29826
|
*/
|
|
29820
29827
|
const mapHasElements = useMemo(() => {
|
|
29821
|
-
//
|
|
29828
|
+
// 地理围栏地图,有充电桩,没有天线,没有割草机位置,没有分区名称气泡
|
|
29822
29829
|
if (mapType === MapType.GEO_FENCE) {
|
|
29823
29830
|
return {
|
|
29824
29831
|
hasChargingPile: true,
|
package/dist/index.js
CHANGED
|
@@ -10633,9 +10633,13 @@ var SvgMapOpacity;
|
|
|
10633
10633
|
* 地图渲染相关常量配置
|
|
10634
10634
|
*/
|
|
10635
10635
|
// 默认坐标
|
|
10636
|
+
// export const DEFAULT_COORDINATES = {
|
|
10637
|
+
// sw: [116.071044, 40.102099],
|
|
10638
|
+
// ne: [116.0734, 40.103901],
|
|
10639
|
+
// };
|
|
10636
10640
|
const DEFAULT_COORDINATES = {
|
|
10637
|
-
sw: [
|
|
10638
|
-
ne: [
|
|
10641
|
+
sw: [-1178e-6, -901e-6],
|
|
10642
|
+
ne: [0.001178, 0.000901],
|
|
10639
10643
|
};
|
|
10640
10644
|
/**
|
|
10641
10645
|
* 缩放因子 - 将米转换为像素
|
|
@@ -18602,10 +18606,10 @@ function estimateGpsFromMapBounds(mapData) {
|
|
|
18602
18606
|
const mapWidthMeters = maxXMeters - minXMeters;
|
|
18603
18607
|
const mapHeightMeters = maxYMeters - minYMeters;
|
|
18604
18608
|
// 凤凰岭的GPS坐标作为地图中心点
|
|
18605
|
-
const centerLat = 40.103;
|
|
18606
|
-
const centerLng = 116.072222;
|
|
18607
|
-
|
|
18608
|
-
|
|
18609
|
+
// const centerLat = 40.103;
|
|
18610
|
+
// const centerLng = 116.072222;
|
|
18611
|
+
const centerLat = 0;
|
|
18612
|
+
const centerLng = 0;
|
|
18609
18613
|
// 精确的坐标转换常数
|
|
18610
18614
|
// 1度纬度 = 约111,320米(在地球上任何地方都基本相同)
|
|
18611
18615
|
// 1度经度 = 约111,320 * cos(纬度) 米(随纬度变化)
|
|
@@ -20068,12 +20072,12 @@ function styleInject(css, ref) {
|
|
|
20068
20072
|
}
|
|
20069
20073
|
}
|
|
20070
20074
|
|
|
20071
|
-
var css_248z$
|
|
20072
|
-
var styles$
|
|
20073
|
-
styleInject(css_248z$
|
|
20075
|
+
var css_248z$8 = ".index-module_edit__-5VvX {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n pointer-events: auto;\n z-index: 1000;\n cursor: move;\n touch-action: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n.index-module_edit__-5VvX .index-module_border__JdNLM {\n position: absolute;\n inset: -10px;\n border: 2px dashed rgb(241, 102, 41);\n border-radius: 2px;\n pointer-events: none;\n}\n.index-module_edit__-5VvX .index-module_drag__uvdPG {\n position: absolute;\n inset: -10px;\n border-radius: 2px;\n}\n.index-module_edit__-5VvX .index-module_rotate__H-KIZ {\n position: absolute;\n top: -20px;\n right: -20px;\n width: 20px;\n height: 20px;\n cursor: grab;\n z-index: 1001;\n pointer-events: auto;\n}\n.index-module_edit__-5VvX .index-module_move__mZF8s {\n position: absolute;\n bottom: -20px;\n left: -20px;\n width: 20px;\n height: 20px;\n cursor: move;\n z-index: 1001;\n pointer-events: auto;\n}";
|
|
20076
|
+
var styles$8 = {"edit":"index-module_edit__-5VvX","border":"index-module_border__JdNLM","drag":"index-module_drag__uvdPG","rotate":"index-module_rotate__H-KIZ","move":"index-module_move__mZF8s"};
|
|
20077
|
+
styleInject(css_248z$8);
|
|
20074
20078
|
|
|
20075
20079
|
const RotateHandle = ({ onRotateStart, isRotating }) => {
|
|
20076
|
-
return (jsxRuntime.jsx("div", { className: styles$
|
|
20080
|
+
return (jsxRuntime.jsx("div", { className: styles$8.rotate, onMouseDown: (e) => onRotateStart(e), onTouchStart: (e) => onRotateStart(e), style: { cursor: isRotating ? 'grabbing' : 'grab' }, dangerouslySetInnerHTML: { __html: DEFAULT_ROTATE_ICON } }));
|
|
20077
20081
|
};
|
|
20078
20082
|
|
|
20079
20083
|
/**
|
|
@@ -20150,7 +20154,7 @@ const DragHandle = ({ onDragStart, isDragging }) => {
|
|
|
20150
20154
|
if (!isMobileDevice()) {
|
|
20151
20155
|
return null;
|
|
20152
20156
|
}
|
|
20153
|
-
return (jsxRuntime.jsx("div", { className: styles$
|
|
20157
|
+
return (jsxRuntime.jsx("div", { className: styles$8.move, onMouseDown: (e) => {
|
|
20154
20158
|
onDragStart(e);
|
|
20155
20159
|
}, onTouchStart: (e) => onDragStart(e), onMouseUp: (e) => {
|
|
20156
20160
|
// onDragEnd(e);
|
|
@@ -20182,7 +20186,7 @@ const MapDrag = ({ map: _map, dragCallbacks, onBoundaryLabelsCollapse, onTransfo
|
|
|
20182
20186
|
if (!isDragMap) {
|
|
20183
20187
|
return null;
|
|
20184
20188
|
}
|
|
20185
|
-
return (jsxRuntime.jsxs("div", { ref: containerRef, className: styles$
|
|
20189
|
+
return (jsxRuntime.jsxs("div", { ref: containerRef, className: styles$8.edit, style: { cursor: isDragging ? 'grabbing' : 'move' }, children: [jsxRuntime.jsx("div", { className: styles$8.border }), canRotateMap && jsxRuntime.jsx(RotateHandle, { onRotateStart: handleRotateStart, isRotating: isRotating }), jsxRuntime.jsx("div", { className: styles$8.drag, onMouseDown: handleDragStartEvent, onTouchStart: handleDragStartEvent }), jsxRuntime.jsx(DragHandle, { onDragStart: handleDragStartEvent, isDragging: isDragging })] }));
|
|
20186
20190
|
};
|
|
20187
20191
|
|
|
20188
20192
|
const SvgEditContext = React.createContext({
|
|
@@ -23615,9 +23619,9 @@ const Magnifier = ({ visible, dragState, polygonPoints, fillColor = 'rgba(255, 1
|
|
|
23615
23619
|
return ReactDOM.createPortal(magnifierContent, document.body);
|
|
23616
23620
|
};
|
|
23617
23621
|
|
|
23618
|
-
var css_248z$
|
|
23619
|
-
var styles$
|
|
23620
|
-
styleInject(css_248z$
|
|
23622
|
+
var css_248z$7 = ".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}";
|
|
23623
|
+
var styles$7 = {"pointerCursor":"index-module_pointerCursor__Ee6pr","polygonPath":"index-module_polygonPath__PynOn","dragging":"index-module_dragging__xSFdO","notCreate":"index-module_notCreate__bFnkV"};
|
|
23624
|
+
styleInject(css_248z$7);
|
|
23621
23625
|
|
|
23622
23626
|
/**
|
|
23623
23627
|
* 几何计算工具函数
|
|
@@ -24040,28 +24044,102 @@ const useCheckElement = () => {
|
|
|
24040
24044
|
};
|
|
24041
24045
|
};
|
|
24042
24046
|
|
|
24047
|
+
var css_248z$6 = ".Tooltip-module_tooltip__Wexlk {\n position: fixed;\n background-color: #fff;\n border-radius: 4px;\n height: 20px;\n line-height: 20px;\n font-size: 12px;\n color: #211F1F;\n padding: 0 4px;\n white-space: nowrap;\n z-index: 9999;\n cursor: pointer;\n user-select: none;\n}\n.Tooltip-module_tooltip__Wexlk.Tooltip-module_tooltipHover__Tfqme {\n height: 30px;\n padding: 5px 12px;\n}\n.Tooltip-module_tooltip__Wexlk.Tooltip-module_tooltipHover__Tfqme:hover {\n background-color: #FFEFE6;\n}";
|
|
24048
|
+
var styles$6 = {"tooltip":"Tooltip-module_tooltip__Wexlk","tooltipHover":"Tooltip-module_tooltipHover__Tfqme"};
|
|
24049
|
+
styleInject(css_248z$6);
|
|
24050
|
+
|
|
24051
|
+
var classnames = {exports: {}};
|
|
24052
|
+
|
|
24053
|
+
/*!
|
|
24054
|
+
Copyright (c) 2018 Jed Watson.
|
|
24055
|
+
Licensed under the MIT License (MIT), see
|
|
24056
|
+
http://jedwatson.github.io/classnames
|
|
24057
|
+
*/
|
|
24058
|
+
|
|
24059
|
+
(function (module) {
|
|
24060
|
+
/* global define */
|
|
24061
|
+
|
|
24062
|
+
(function () {
|
|
24063
|
+
|
|
24064
|
+
var hasOwn = {}.hasOwnProperty;
|
|
24065
|
+
|
|
24066
|
+
function classNames () {
|
|
24067
|
+
var classes = '';
|
|
24068
|
+
|
|
24069
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
24070
|
+
var arg = arguments[i];
|
|
24071
|
+
if (arg) {
|
|
24072
|
+
classes = appendClass(classes, parseValue(arg));
|
|
24073
|
+
}
|
|
24074
|
+
}
|
|
24075
|
+
|
|
24076
|
+
return classes;
|
|
24077
|
+
}
|
|
24078
|
+
|
|
24079
|
+
function parseValue (arg) {
|
|
24080
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
24081
|
+
return arg;
|
|
24082
|
+
}
|
|
24083
|
+
|
|
24084
|
+
if (typeof arg !== 'object') {
|
|
24085
|
+
return '';
|
|
24086
|
+
}
|
|
24087
|
+
|
|
24088
|
+
if (Array.isArray(arg)) {
|
|
24089
|
+
return classNames.apply(null, arg);
|
|
24090
|
+
}
|
|
24091
|
+
|
|
24092
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
24093
|
+
return arg.toString();
|
|
24094
|
+
}
|
|
24095
|
+
|
|
24096
|
+
var classes = '';
|
|
24097
|
+
|
|
24098
|
+
for (var key in arg) {
|
|
24099
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
24100
|
+
classes = appendClass(classes, key);
|
|
24101
|
+
}
|
|
24102
|
+
}
|
|
24103
|
+
|
|
24104
|
+
return classes;
|
|
24105
|
+
}
|
|
24106
|
+
|
|
24107
|
+
function appendClass (value, newClass) {
|
|
24108
|
+
if (!newClass) {
|
|
24109
|
+
return value;
|
|
24110
|
+
}
|
|
24111
|
+
|
|
24112
|
+
if (value) {
|
|
24113
|
+
return value + ' ' + newClass;
|
|
24114
|
+
}
|
|
24115
|
+
|
|
24116
|
+
return value + newClass;
|
|
24117
|
+
}
|
|
24118
|
+
|
|
24119
|
+
if (module.exports) {
|
|
24120
|
+
classNames.default = classNames;
|
|
24121
|
+
module.exports = classNames;
|
|
24122
|
+
} else {
|
|
24123
|
+
window.classNames = classNames;
|
|
24124
|
+
}
|
|
24125
|
+
}());
|
|
24126
|
+
} (classnames));
|
|
24127
|
+
|
|
24128
|
+
var classnamesExports = classnames.exports;
|
|
24129
|
+
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
24130
|
+
|
|
24043
24131
|
const Tooltip = ({ open, x, y, text, style, onClick }) => {
|
|
24044
24132
|
if (!open)
|
|
24045
24133
|
return null;
|
|
24046
24134
|
const tooltipStyle = {
|
|
24047
|
-
position: 'fixed',
|
|
24048
24135
|
left: x,
|
|
24049
24136
|
top: y,
|
|
24050
|
-
backgroundColor: '#fff',
|
|
24051
|
-
borderRadius: '4px',
|
|
24052
|
-
height: '20px',
|
|
24053
|
-
lineHeight: '16px',
|
|
24054
|
-
fontSize: '12px',
|
|
24055
|
-
color: '#211F1F',
|
|
24056
|
-
padding: '2px 4px',
|
|
24057
|
-
whiteSpace: 'nowrap',
|
|
24058
|
-
zIndex: 9999,
|
|
24059
|
-
cursor: 'pointer',
|
|
24060
|
-
userSelect: 'none',
|
|
24061
24137
|
...style,
|
|
24062
24138
|
};
|
|
24063
24139
|
// 使用 createPortal 挂载到 body
|
|
24064
|
-
return ReactDOM.createPortal(jsxRuntime.jsx("div", {
|
|
24140
|
+
return ReactDOM.createPortal(jsxRuntime.jsx("div", { className: classNames(styles$6.tooltip, {
|
|
24141
|
+
[styles$6.tooltipHover]: !!onClick,
|
|
24142
|
+
}), style: tooltipStyle, onClick: (e) => {
|
|
24065
24143
|
e.preventDefault();
|
|
24066
24144
|
e.stopPropagation();
|
|
24067
24145
|
onClick?.();
|
|
@@ -24207,6 +24285,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24207
24285
|
const [tooltipIndex, setTooltipIndex] = React.useState(null);
|
|
24208
24286
|
const [tooltipPos, setTooltipPos] = React.useState({ x: 0, y: 0 });
|
|
24209
24287
|
const [completeTooltipOpen, setCompleteTooltipOpen] = React.useState(false);
|
|
24288
|
+
const [moveTooltipOpen, setMoveTooltipOpen] = React.useState(false);
|
|
24210
24289
|
const updateTooltipPos = (target) => {
|
|
24211
24290
|
const rect = target.getBoundingClientRect();
|
|
24212
24291
|
setTooltipPos({
|
|
@@ -24475,8 +24554,8 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24475
24554
|
}, [dragState.currentPosition, checkCanNotCreateAtPosition, coordinates]);
|
|
24476
24555
|
const generateVertexClassName = React.useMemo(() => {
|
|
24477
24556
|
if (!dragState.isDragging)
|
|
24478
|
-
return styles$
|
|
24479
|
-
return showNotCreateCursor ? styles$
|
|
24557
|
+
return styles$7.pointerCursor;
|
|
24558
|
+
return showNotCreateCursor ? styles$7.notCreate : styles$7.dragging;
|
|
24480
24559
|
}, [dragState.isDragging, showNotCreateCursor]);
|
|
24481
24560
|
// 使用 useRef 来存储 requestAnimationFrame ID
|
|
24482
24561
|
const rafIdRef = React.useRef(null);
|
|
@@ -24767,7 +24846,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24767
24846
|
WebkitTouchCallout: 'none',
|
|
24768
24847
|
touchAction: 'none',
|
|
24769
24848
|
} })] }));
|
|
24770
|
-
})()] })), renderCoordinates.length >= 2 && (jsxRuntime.jsx("polygon", { className: canSelect ? styles$
|
|
24849
|
+
})()] })), renderCoordinates.length >= 2 && (jsxRuntime.jsx("polygon", { className: canSelect ? styles$7.pointerCursor : '', points: polygonPoints, fill: isHover ? hoverFillColor || fillColor : fillColor, fillOpacity: fillOpacity, stroke: "none" // 边框透明
|
|
24771
24850
|
, onClick: onPolygonClick })), jsxRuntime.jsx("g", { children: renderCoordinates.length >= 2 &&
|
|
24772
24851
|
pathSegments.map((segment, index) => {
|
|
24773
24852
|
if (segment.points.length < 2)
|
|
@@ -24775,14 +24854,14 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24775
24854
|
const pathData = createPathData(segment.points);
|
|
24776
24855
|
const isDash = segment.type === 1;
|
|
24777
24856
|
if (isDash && showStraddleBoundaryBorder) {
|
|
24778
|
-
return (jsxRuntime.jsx(DashPath, { className: canSelect ? styles$
|
|
24857
|
+
return (jsxRuntime.jsx(DashPath, { className: canSelect ? styles$7.polygonPath : '', points: segment.points, stroke: strokeColor, strokeWidth: isHover ? strokeWidth + 1 : strokeWidth, strokeOpacity: strokeOpacity }, index));
|
|
24779
24858
|
}
|
|
24780
24859
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(editMode || createMode) && (jsxRuntime.jsx("path", { d: pathData, fill: "none", stroke: '#fff', strokeWidth: strokeWidth * 2, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", style: {
|
|
24781
24860
|
userSelect: 'none',
|
|
24782
24861
|
WebkitUserSelect: 'none',
|
|
24783
24862
|
WebkitTouchCallout: 'none',
|
|
24784
24863
|
touchAction: 'none',
|
|
24785
|
-
} }, 'warp' + index)), jsxRuntime.jsx("path", { d: pathData, fill: "none", stroke: strokeColor, strokeWidth: isHover ? strokeWidth + 1 : strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", className: canSelect ? styles$
|
|
24864
|
+
} }, 'warp' + index)), jsxRuntime.jsx("path", { d: pathData, fill: "none", stroke: strokeColor, strokeWidth: isHover ? strokeWidth + 1 : strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", className: canSelect ? styles$7.polygonPath : '', vectorEffect: "non-scaling-stroke", onClick: onPathClick, style: {
|
|
24786
24865
|
userSelect: 'none',
|
|
24787
24866
|
WebkitUserSelect: 'none',
|
|
24788
24867
|
WebkitTouchCallout: 'none',
|
|
@@ -24813,7 +24892,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24813
24892
|
: platform === exports.PlatformType.H5
|
|
24814
24893
|
? strokeWidth * 2
|
|
24815
24894
|
: strokeWidth;
|
|
24816
|
-
return (jsxRuntime.jsx("line", { ...edgeLineCommon, stroke: edgeStroke, strokeWidth: edgeStrokeWidth, ...(isH5SolidHitOnly ? { strokeLinecap: 'round' } : {}), className: editMode ? styles$
|
|
24895
|
+
return (jsxRuntime.jsx("line", { ...edgeLineCommon, stroke: edgeStroke, strokeWidth: edgeStrokeWidth, ...(isH5SolidHitOnly ? { strokeLinecap: 'round' } : {}), className: editMode ? styles$7.pointerCursor : '', style: edgeLineStyle, vectorEffect: "non-scaling-stroke", ...(platform === exports.PlatformType.H5
|
|
24817
24896
|
? {
|
|
24818
24897
|
onTouchStart: createReactEventHandler((e) => handleEdgeLongPressStart(e, index)),
|
|
24819
24898
|
onTouchEnd: createReactEventHandler(() => handleEdgeLongPressEnd()),
|
|
@@ -24883,7 +24962,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24883
24962
|
isDoubleClickingRef.current = false;
|
|
24884
24963
|
}, 300);
|
|
24885
24964
|
// 打开删除确认 Tooltip(仅在可编辑时)
|
|
24886
|
-
if (editMode || (createMode && completed)) {
|
|
24965
|
+
if ((editMode || (createMode && completed)) && renderCoordinates.length > 3) {
|
|
24887
24966
|
updateTooltipPos(e.target);
|
|
24888
24967
|
setTooltipIndex(idx);
|
|
24889
24968
|
}
|
|
@@ -24960,17 +25039,25 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24960
25039
|
}
|
|
24961
25040
|
}
|
|
24962
25041
|
},
|
|
24963
|
-
onMouseEnter:
|
|
24964
|
-
|
|
25042
|
+
onMouseEnter: (e) => {
|
|
25043
|
+
if (canComplete) {
|
|
24965
25044
|
setCompleteTooltipOpen(true);
|
|
25045
|
+
}
|
|
25046
|
+
if (editMode || (createMode && completed)) {
|
|
25047
|
+
setMoveTooltipOpen(true);
|
|
25048
|
+
}
|
|
25049
|
+
if (tooltipIndex === null) {
|
|
24966
25050
|
updateTooltipPos(e.target);
|
|
24967
25051
|
}
|
|
24968
|
-
|
|
24969
|
-
onMouseLeave:
|
|
24970
|
-
|
|
25052
|
+
},
|
|
25053
|
+
onMouseLeave: () => {
|
|
25054
|
+
if (canComplete) {
|
|
24971
25055
|
setCompleteTooltipOpen(false);
|
|
24972
25056
|
}
|
|
24973
|
-
|
|
25057
|
+
if (editMode || (createMode && completed)) {
|
|
25058
|
+
setMoveTooltipOpen(false);
|
|
25059
|
+
}
|
|
25060
|
+
},
|
|
24974
25061
|
}) }), platform === exports.PlatformType.H5 && tooltipIndex === idx && coordinates.length > 3 && (jsxRuntime.jsxs("g", { transform: `translate(${coord[0] + 4 * overlayScale * 2}, ${coord[1] - 4 * overlayScale * 2}) scale(${overlayScale * 2})`, onClick: (e) => {
|
|
24975
25062
|
e.preventDefault();
|
|
24976
25063
|
e.stopPropagation();
|
|
@@ -25001,7 +25088,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
25001
25088
|
onVertexDelete(renderCoordinates?.length - 1 - tooltipIndex);
|
|
25002
25089
|
}
|
|
25003
25090
|
setTooltipIndex(null);
|
|
25004
|
-
} })), platform === exports.PlatformType.WEB && completeTooltipOpen && (jsxRuntime.jsx(Tooltip, { open: true, x: tooltipPos.x, y: tooltipPos.y, text: "Click to finish" }))] }));
|
|
25091
|
+
} })), platform === exports.PlatformType.WEB && completeTooltipOpen && (jsxRuntime.jsx(Tooltip, { open: true, x: tooltipPos.x, y: tooltipPos.y, text: "Click to finish" })), platform === exports.PlatformType.WEB && moveTooltipOpen && tooltipIndex === null && (jsxRuntime.jsx(Tooltip, { open: true, x: tooltipPos.x, y: tooltipPos.y, text: 'Drag to change' + (renderCoordinates.length > 3 ? ', double click to remove' : '') }))] }));
|
|
25005
25092
|
};
|
|
25006
25093
|
|
|
25007
25094
|
const MowPartitionContext = React.createContext({
|
|
@@ -28056,86 +28143,6 @@ var css_248z$1 = ".index-module_mapEdit__XC5Gw {\n position: absolute;\n left:
|
|
|
28056
28143
|
var styles$1 = {"mapEdit":"index-module_mapEdit__XC5Gw","createMode":"index-module_createMode__14EPH","notCreateCursor":"index-module_notCreateCursor__1-OjF"};
|
|
28057
28144
|
styleInject(css_248z$1);
|
|
28058
28145
|
|
|
28059
|
-
var classnames = {exports: {}};
|
|
28060
|
-
|
|
28061
|
-
/*!
|
|
28062
|
-
Copyright (c) 2018 Jed Watson.
|
|
28063
|
-
Licensed under the MIT License (MIT), see
|
|
28064
|
-
http://jedwatson.github.io/classnames
|
|
28065
|
-
*/
|
|
28066
|
-
|
|
28067
|
-
(function (module) {
|
|
28068
|
-
/* global define */
|
|
28069
|
-
|
|
28070
|
-
(function () {
|
|
28071
|
-
|
|
28072
|
-
var hasOwn = {}.hasOwnProperty;
|
|
28073
|
-
|
|
28074
|
-
function classNames () {
|
|
28075
|
-
var classes = '';
|
|
28076
|
-
|
|
28077
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
28078
|
-
var arg = arguments[i];
|
|
28079
|
-
if (arg) {
|
|
28080
|
-
classes = appendClass(classes, parseValue(arg));
|
|
28081
|
-
}
|
|
28082
|
-
}
|
|
28083
|
-
|
|
28084
|
-
return classes;
|
|
28085
|
-
}
|
|
28086
|
-
|
|
28087
|
-
function parseValue (arg) {
|
|
28088
|
-
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
28089
|
-
return arg;
|
|
28090
|
-
}
|
|
28091
|
-
|
|
28092
|
-
if (typeof arg !== 'object') {
|
|
28093
|
-
return '';
|
|
28094
|
-
}
|
|
28095
|
-
|
|
28096
|
-
if (Array.isArray(arg)) {
|
|
28097
|
-
return classNames.apply(null, arg);
|
|
28098
|
-
}
|
|
28099
|
-
|
|
28100
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
28101
|
-
return arg.toString();
|
|
28102
|
-
}
|
|
28103
|
-
|
|
28104
|
-
var classes = '';
|
|
28105
|
-
|
|
28106
|
-
for (var key in arg) {
|
|
28107
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
28108
|
-
classes = appendClass(classes, key);
|
|
28109
|
-
}
|
|
28110
|
-
}
|
|
28111
|
-
|
|
28112
|
-
return classes;
|
|
28113
|
-
}
|
|
28114
|
-
|
|
28115
|
-
function appendClass (value, newClass) {
|
|
28116
|
-
if (!newClass) {
|
|
28117
|
-
return value;
|
|
28118
|
-
}
|
|
28119
|
-
|
|
28120
|
-
if (value) {
|
|
28121
|
-
return value + ' ' + newClass;
|
|
28122
|
-
}
|
|
28123
|
-
|
|
28124
|
-
return value + newClass;
|
|
28125
|
-
}
|
|
28126
|
-
|
|
28127
|
-
if (module.exports) {
|
|
28128
|
-
classNames.default = classNames;
|
|
28129
|
-
module.exports = classNames;
|
|
28130
|
-
} else {
|
|
28131
|
-
window.classNames = classNames;
|
|
28132
|
-
}
|
|
28133
|
-
}());
|
|
28134
|
-
} (classnames));
|
|
28135
|
-
|
|
28136
|
-
var classnamesExports = classnames.exports;
|
|
28137
|
-
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
28138
|
-
|
|
28139
28146
|
/******************************************************************************
|
|
28140
28147
|
Copyright (c) Microsoft Corporation.
|
|
28141
28148
|
|
|
@@ -29838,7 +29845,7 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
|
|
|
29838
29845
|
* 这里做了一个配置,以防以后如果有多种不同的类型的情况,需要展示不同的元素
|
|
29839
29846
|
*/
|
|
29840
29847
|
const mapHasElements = React.useMemo(() => {
|
|
29841
|
-
//
|
|
29848
|
+
// 地理围栏地图,有充电桩,没有天线,没有割草机位置,没有分区名称气泡
|
|
29842
29849
|
if (mapType === exports.MapType.GEO_FENCE) {
|
|
29843
29850
|
return {
|
|
29844
29851
|
hasChargingPile: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../../src/render/svgElement/PolygonELement/components/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../../src/render/svgElement/PolygonELement/components/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,YAAY;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA2BnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/render/svgElement/PolygonELement/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6E,MAAM,OAAO,CAAC;AAsBlG;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,aAAa,MAAM,EAAE,EAAE,KAAG,MAE7D,CAAC;AA+BF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,aAAa,MAAM,EAAE,EAAE,EACvB,YAAW,OAAc,KACxB,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,CAyC5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,EAAE,EAAE,KAAG,MAUnD,CAAC;AAgBF,UAAU,mBAAmB;IAC3B,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAE5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAE3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,KAAK,IAAI,CAAC;IACxD,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAE/C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/render/svgElement/PolygonELement/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6E,MAAM,OAAO,CAAC;AAsBlG;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,aAAa,MAAM,EAAE,EAAE,KAAG,MAE7D,CAAC;AA+BF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,aAAa,MAAM,EAAE,EAAE,EACvB,YAAW,OAAc,KACxB,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,CAyC5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,EAAE,EAAE,KAAG,MAUnD,CAAC;AAgBF,UAAU,mBAAmB;IAC3B,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAE5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAE3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,KAAK,IAAI,CAAC;IACxD,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAE/C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA0zCxD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|