@fleet-frontend/mower-maps 0.2.0-beta.24 → 0.2.0-beta.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +95 -26
- package/dist/index.js +95 -26
- package/dist/processor/MapDataProcessor.d.ts.map +1 -1
- package/dist/render/MowerMapRenderer.d.ts.map +1 -1
- package/dist/render/svgEditMap/hooks/useCreateVisionOffElement.d.ts +1 -1
- package/dist/render/svgEditMap/hooks/useCreateVisionOffElement.d.ts.map +1 -1
- package/dist/render/svgEditMap/index.d.ts.map +1 -1
- package/dist/utils/mapBounds.d.ts +8 -0
- package/dist/utils/mapBounds.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1445,6 +1445,66 @@ function calculateMapBounds(mapData) {
|
|
|
1445
1445
|
}
|
|
1446
1446
|
return { minX, minY, maxX, maxY };
|
|
1447
1447
|
}
|
|
1448
|
+
/**
|
|
1449
|
+
* 计算所有地块围成的边界
|
|
1450
|
+
* @param bounds
|
|
1451
|
+
* @param margin
|
|
1452
|
+
* @returns
|
|
1453
|
+
*/
|
|
1454
|
+
function calculateBoundaryBounds(mapData) {
|
|
1455
|
+
let minX = Infinity;
|
|
1456
|
+
let minY = Infinity;
|
|
1457
|
+
let maxX = -Infinity;
|
|
1458
|
+
let maxY = -Infinity;
|
|
1459
|
+
// 更新边界的辅助函数
|
|
1460
|
+
const updateBounds = (points) => {
|
|
1461
|
+
for (const point of points) {
|
|
1462
|
+
if (point.length >= 2) {
|
|
1463
|
+
minX = Math.min(minX, point[0]);
|
|
1464
|
+
minY = Math.min(minY, point[1]);
|
|
1465
|
+
maxX = Math.max(maxX, point[0]);
|
|
1466
|
+
maxY = Math.max(maxY, point[1]);
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
};
|
|
1470
|
+
// 处理所有地图元素
|
|
1471
|
+
const allElements = [];
|
|
1472
|
+
// 收集所有元素
|
|
1473
|
+
if (mapData.sub_maps) {
|
|
1474
|
+
for (const subMap of mapData.sub_maps) {
|
|
1475
|
+
allElements.push(...subMap.elements);
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
// 计算元素边界
|
|
1479
|
+
for (const element of allElements) {
|
|
1480
|
+
if (element.type === 'BOUNDARY' && element.points) {
|
|
1481
|
+
const convertedPoints = convertPointsFormat(element.points);
|
|
1482
|
+
if (convertedPoints) {
|
|
1483
|
+
updateBounds(convertedPoints);
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
if (element.type === 'BOUNDARY' && element.position) {
|
|
1487
|
+
const point = convertPositionFormat(element.position);
|
|
1488
|
+
if (point)
|
|
1489
|
+
updateBounds([[point.x, point.y]]);
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
// 如果没有找到边界,返回默认值
|
|
1493
|
+
if (minX === Infinity) {
|
|
1494
|
+
return { minX: 0, minY: 0, maxX: 100, maxY: 100 };
|
|
1495
|
+
}
|
|
1496
|
+
return { minX, minY, maxX, maxY };
|
|
1497
|
+
}
|
|
1498
|
+
function calculateBoundaryBoundsCenter(mapData) {
|
|
1499
|
+
const boundaryBounds = calculateBoundaryBounds(mapData);
|
|
1500
|
+
if (boundaryBounds.minX === Infinity) {
|
|
1501
|
+
return [50, 50];
|
|
1502
|
+
}
|
|
1503
|
+
return [
|
|
1504
|
+
boundaryBounds.minX + (boundaryBounds.maxX - boundaryBounds.minX) / 2,
|
|
1505
|
+
boundaryBounds.minY + (boundaryBounds.maxY - boundaryBounds.minY) / 2,
|
|
1506
|
+
];
|
|
1507
|
+
}
|
|
1448
1508
|
/**
|
|
1449
1509
|
* 检查GPS坐标是否有效
|
|
1450
1510
|
*/
|
|
@@ -13802,19 +13862,24 @@ class MapDataProcessor {
|
|
|
13802
13862
|
case 'OBSTACLE': {
|
|
13803
13863
|
try {
|
|
13804
13864
|
// 为ObstacleData创建兼容的MapElement接口
|
|
13805
|
-
|
|
13806
|
-
|
|
13807
|
-
|
|
13808
|
-
|
|
13809
|
-
|
|
13810
|
-
|
|
13811
|
-
|
|
13812
|
-
|
|
13813
|
-
|
|
13814
|
-
|
|
13815
|
-
|
|
13816
|
-
|
|
13817
|
-
|
|
13865
|
+
if (element.status !== 1 ||
|
|
13866
|
+
(element.status === 1 &&
|
|
13867
|
+
element.start_timestamp <= Date.now() / 1000 &&
|
|
13868
|
+
element.end_timestamp >= Date.now() / 1000)) {
|
|
13869
|
+
const mapElement = element;
|
|
13870
|
+
const obstacleElement = ObstacleDataBuilder.fromMapElement(mapElement, this.mapConfig.obstacle);
|
|
13871
|
+
if (obstacleElement) {
|
|
13872
|
+
result.push(obstacleElement);
|
|
13873
|
+
obstaclesObj[`obstacle-${obstacleElement.originalData.id}`] = {
|
|
13874
|
+
...obstacleElement,
|
|
13875
|
+
};
|
|
13876
|
+
const { addObstacles } = usePartitionDataStore.getState();
|
|
13877
|
+
addObstacles(`${this.sn}`, obstaclesObj);
|
|
13878
|
+
// const { addObstacles } = usePartitionDataStore.getState();
|
|
13879
|
+
// addObstacles(`obstacle-${obstacleElement.originalData.id}`, {
|
|
13880
|
+
// ...obstacleElement,
|
|
13881
|
+
// });
|
|
13882
|
+
}
|
|
13818
13883
|
}
|
|
13819
13884
|
}
|
|
13820
13885
|
catch (error) {
|
|
@@ -13873,7 +13938,9 @@ class MapDataProcessor {
|
|
|
13873
13938
|
'scale' in element &&
|
|
13874
13939
|
element.scale !== undefined &&
|
|
13875
13940
|
'direction' in element &&
|
|
13876
|
-
element.direction !== undefined
|
|
13941
|
+
element.direction !== undefined &&
|
|
13942
|
+
(element.expiration_ts === undefined ||
|
|
13943
|
+
element.expiration_ts > Math.floor(Date.now() / 1000))) {
|
|
13877
13944
|
const mapElement = element;
|
|
13878
13945
|
const svgElement = SvgElementDataBuilder.fromMapElement(mapElement, this.mapConfig.doodle);
|
|
13879
13946
|
if (svgElement) {
|
|
@@ -13893,7 +13960,9 @@ class MapDataProcessor {
|
|
|
13893
13960
|
else if ('points' in element &&
|
|
13894
13961
|
element.points &&
|
|
13895
13962
|
Array.isArray(element.points) &&
|
|
13896
|
-
element.points.length >= 3
|
|
13963
|
+
element.points.length >= 3 &&
|
|
13964
|
+
(element.expiration_ts === undefined ||
|
|
13965
|
+
element.expiration_ts > Math.floor(Date.now() / 1000))) {
|
|
13897
13966
|
const mapElement = element;
|
|
13898
13967
|
const polygonElement = ObstacleDataBuilder.createTimeLimitObstacle(mapElement, this.mapConfig.obstacle);
|
|
13899
13968
|
if (polygonElement) {
|
|
@@ -19895,13 +19964,11 @@ CreateObstacleElement.displayName = 'CreateObstacleElement';
|
|
|
19895
19964
|
const MIN_ELEMENT_WIDTH = 50;
|
|
19896
19965
|
const useCreateVisionOffElement = () => {
|
|
19897
19966
|
const { editMapInfo } = useMapEditContext();
|
|
19898
|
-
const { svgViewBox } = useCommonContext();
|
|
19967
|
+
const { svgViewBox, mapJson } = useCommonContext();
|
|
19899
19968
|
const centerPoint = useMemo(() => {
|
|
19900
|
-
|
|
19901
|
-
return null;
|
|
19902
|
-
const center = [svgViewBox.x + svgViewBox.width / 2, svgViewBox.y + svgViewBox.height / 2];
|
|
19969
|
+
const center = calculateBoundaryBoundsCenter(mapJson);
|
|
19903
19970
|
return center;
|
|
19904
|
-
}, [
|
|
19971
|
+
}, [mapJson]);
|
|
19905
19972
|
const elementWidth = useMemo(() => {
|
|
19906
19973
|
if (!svgViewBox)
|
|
19907
19974
|
return MIN_ELEMENT_WIDTH;
|
|
@@ -19955,7 +20022,7 @@ const SvgEditMap = forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMapChang
|
|
|
19955
20022
|
const isCreating = useMemo(() => {
|
|
19956
20023
|
return editMapInfo.createMode === CreateStatus.CREATING;
|
|
19957
20024
|
}, [editMapInfo.createMode]);
|
|
19958
|
-
|
|
20025
|
+
useMemo(() => {
|
|
19959
20026
|
if (!svgRef || !centerPoint)
|
|
19960
20027
|
return null;
|
|
19961
20028
|
const elementWidth = 50 * 10;
|
|
@@ -20108,8 +20175,9 @@ const SvgEditMap = forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMapChang
|
|
|
20108
20175
|
newElement = initChannel();
|
|
20109
20176
|
}
|
|
20110
20177
|
else if (type === DataType.VISION_OFF) {
|
|
20178
|
+
const points = getVisionOffPoints();
|
|
20111
20179
|
newElement = initVisionOff();
|
|
20112
|
-
newElement.points =
|
|
20180
|
+
newElement.points = points;
|
|
20113
20181
|
}
|
|
20114
20182
|
else if (type === DataType.DOODLE) {
|
|
20115
20183
|
addDoodle(item);
|
|
@@ -20543,12 +20611,13 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
|
|
|
20543
20611
|
// }, [mapJson]);
|
|
20544
20612
|
const mowerPositionData = useMemo(() => {
|
|
20545
20613
|
// realTimeData 中包含三个种类的数据,之需要实时坐标的数据即可。
|
|
20614
|
+
// 在初始的状态按照正常图标进行渲染,所以构造一个基本在rtk桩的一个数据
|
|
20546
20615
|
if (!realTimeData || realTimeData.length === 0)
|
|
20547
20616
|
return {
|
|
20548
|
-
postureX: 0,
|
|
20549
|
-
postureY: 0,
|
|
20550
|
-
postureTheta: 0,
|
|
20551
|
-
vehicleState: RobotStatus.
|
|
20617
|
+
postureX: 0.01,
|
|
20618
|
+
postureY: 0.1,
|
|
20619
|
+
postureTheta: 0.01,
|
|
20620
|
+
vehicleState: RobotStatus.PARKED,
|
|
20552
20621
|
};
|
|
20553
20622
|
let currentPositionData;
|
|
20554
20623
|
if (realTimeData.length === 1 && realTimeData[0].type === RealTimeDataType.LOCATION) {
|
package/dist/index.js
CHANGED
|
@@ -1465,6 +1465,66 @@ function calculateMapBounds(mapData) {
|
|
|
1465
1465
|
}
|
|
1466
1466
|
return { minX, minY, maxX, maxY };
|
|
1467
1467
|
}
|
|
1468
|
+
/**
|
|
1469
|
+
* 计算所有地块围成的边界
|
|
1470
|
+
* @param bounds
|
|
1471
|
+
* @param margin
|
|
1472
|
+
* @returns
|
|
1473
|
+
*/
|
|
1474
|
+
function calculateBoundaryBounds(mapData) {
|
|
1475
|
+
let minX = Infinity;
|
|
1476
|
+
let minY = Infinity;
|
|
1477
|
+
let maxX = -Infinity;
|
|
1478
|
+
let maxY = -Infinity;
|
|
1479
|
+
// 更新边界的辅助函数
|
|
1480
|
+
const updateBounds = (points) => {
|
|
1481
|
+
for (const point of points) {
|
|
1482
|
+
if (point.length >= 2) {
|
|
1483
|
+
minX = Math.min(minX, point[0]);
|
|
1484
|
+
minY = Math.min(minY, point[1]);
|
|
1485
|
+
maxX = Math.max(maxX, point[0]);
|
|
1486
|
+
maxY = Math.max(maxY, point[1]);
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
};
|
|
1490
|
+
// 处理所有地图元素
|
|
1491
|
+
const allElements = [];
|
|
1492
|
+
// 收集所有元素
|
|
1493
|
+
if (mapData.sub_maps) {
|
|
1494
|
+
for (const subMap of mapData.sub_maps) {
|
|
1495
|
+
allElements.push(...subMap.elements);
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
// 计算元素边界
|
|
1499
|
+
for (const element of allElements) {
|
|
1500
|
+
if (element.type === 'BOUNDARY' && element.points) {
|
|
1501
|
+
const convertedPoints = convertPointsFormat(element.points);
|
|
1502
|
+
if (convertedPoints) {
|
|
1503
|
+
updateBounds(convertedPoints);
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
if (element.type === 'BOUNDARY' && element.position) {
|
|
1507
|
+
const point = convertPositionFormat(element.position);
|
|
1508
|
+
if (point)
|
|
1509
|
+
updateBounds([[point.x, point.y]]);
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
// 如果没有找到边界,返回默认值
|
|
1513
|
+
if (minX === Infinity) {
|
|
1514
|
+
return { minX: 0, minY: 0, maxX: 100, maxY: 100 };
|
|
1515
|
+
}
|
|
1516
|
+
return { minX, minY, maxX, maxY };
|
|
1517
|
+
}
|
|
1518
|
+
function calculateBoundaryBoundsCenter(mapData) {
|
|
1519
|
+
const boundaryBounds = calculateBoundaryBounds(mapData);
|
|
1520
|
+
if (boundaryBounds.minX === Infinity) {
|
|
1521
|
+
return [50, 50];
|
|
1522
|
+
}
|
|
1523
|
+
return [
|
|
1524
|
+
boundaryBounds.minX + (boundaryBounds.maxX - boundaryBounds.minX) / 2,
|
|
1525
|
+
boundaryBounds.minY + (boundaryBounds.maxY - boundaryBounds.minY) / 2,
|
|
1526
|
+
];
|
|
1527
|
+
}
|
|
1468
1528
|
/**
|
|
1469
1529
|
* 检查GPS坐标是否有效
|
|
1470
1530
|
*/
|
|
@@ -13822,19 +13882,24 @@ class MapDataProcessor {
|
|
|
13822
13882
|
case 'OBSTACLE': {
|
|
13823
13883
|
try {
|
|
13824
13884
|
// 为ObstacleData创建兼容的MapElement接口
|
|
13825
|
-
|
|
13826
|
-
|
|
13827
|
-
|
|
13828
|
-
|
|
13829
|
-
|
|
13830
|
-
|
|
13831
|
-
|
|
13832
|
-
|
|
13833
|
-
|
|
13834
|
-
|
|
13835
|
-
|
|
13836
|
-
|
|
13837
|
-
|
|
13885
|
+
if (element.status !== 1 ||
|
|
13886
|
+
(element.status === 1 &&
|
|
13887
|
+
element.start_timestamp <= Date.now() / 1000 &&
|
|
13888
|
+
element.end_timestamp >= Date.now() / 1000)) {
|
|
13889
|
+
const mapElement = element;
|
|
13890
|
+
const obstacleElement = ObstacleDataBuilder.fromMapElement(mapElement, this.mapConfig.obstacle);
|
|
13891
|
+
if (obstacleElement) {
|
|
13892
|
+
result.push(obstacleElement);
|
|
13893
|
+
obstaclesObj[`obstacle-${obstacleElement.originalData.id}`] = {
|
|
13894
|
+
...obstacleElement,
|
|
13895
|
+
};
|
|
13896
|
+
const { addObstacles } = usePartitionDataStore.getState();
|
|
13897
|
+
addObstacles(`${this.sn}`, obstaclesObj);
|
|
13898
|
+
// const { addObstacles } = usePartitionDataStore.getState();
|
|
13899
|
+
// addObstacles(`obstacle-${obstacleElement.originalData.id}`, {
|
|
13900
|
+
// ...obstacleElement,
|
|
13901
|
+
// });
|
|
13902
|
+
}
|
|
13838
13903
|
}
|
|
13839
13904
|
}
|
|
13840
13905
|
catch (error) {
|
|
@@ -13893,7 +13958,9 @@ class MapDataProcessor {
|
|
|
13893
13958
|
'scale' in element &&
|
|
13894
13959
|
element.scale !== undefined &&
|
|
13895
13960
|
'direction' in element &&
|
|
13896
|
-
element.direction !== undefined
|
|
13961
|
+
element.direction !== undefined &&
|
|
13962
|
+
(element.expiration_ts === undefined ||
|
|
13963
|
+
element.expiration_ts > Math.floor(Date.now() / 1000))) {
|
|
13897
13964
|
const mapElement = element;
|
|
13898
13965
|
const svgElement = SvgElementDataBuilder.fromMapElement(mapElement, this.mapConfig.doodle);
|
|
13899
13966
|
if (svgElement) {
|
|
@@ -13913,7 +13980,9 @@ class MapDataProcessor {
|
|
|
13913
13980
|
else if ('points' in element &&
|
|
13914
13981
|
element.points &&
|
|
13915
13982
|
Array.isArray(element.points) &&
|
|
13916
|
-
element.points.length >= 3
|
|
13983
|
+
element.points.length >= 3 &&
|
|
13984
|
+
(element.expiration_ts === undefined ||
|
|
13985
|
+
element.expiration_ts > Math.floor(Date.now() / 1000))) {
|
|
13917
13986
|
const mapElement = element;
|
|
13918
13987
|
const polygonElement = ObstacleDataBuilder.createTimeLimitObstacle(mapElement, this.mapConfig.obstacle);
|
|
13919
13988
|
if (polygonElement) {
|
|
@@ -19915,13 +19984,11 @@ CreateObstacleElement.displayName = 'CreateObstacleElement';
|
|
|
19915
19984
|
const MIN_ELEMENT_WIDTH = 50;
|
|
19916
19985
|
const useCreateVisionOffElement = () => {
|
|
19917
19986
|
const { editMapInfo } = useMapEditContext();
|
|
19918
|
-
const { svgViewBox } = useCommonContext();
|
|
19987
|
+
const { svgViewBox, mapJson } = useCommonContext();
|
|
19919
19988
|
const centerPoint = React.useMemo(() => {
|
|
19920
|
-
|
|
19921
|
-
return null;
|
|
19922
|
-
const center = [svgViewBox.x + svgViewBox.width / 2, svgViewBox.y + svgViewBox.height / 2];
|
|
19989
|
+
const center = calculateBoundaryBoundsCenter(mapJson);
|
|
19923
19990
|
return center;
|
|
19924
|
-
}, [
|
|
19991
|
+
}, [mapJson]);
|
|
19925
19992
|
const elementWidth = React.useMemo(() => {
|
|
19926
19993
|
if (!svgViewBox)
|
|
19927
19994
|
return MIN_ELEMENT_WIDTH;
|
|
@@ -19975,7 +20042,7 @@ const SvgEditMap = React.forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMa
|
|
|
19975
20042
|
const isCreating = React.useMemo(() => {
|
|
19976
20043
|
return editMapInfo.createMode === exports.CreateStatus.CREATING;
|
|
19977
20044
|
}, [editMapInfo.createMode]);
|
|
19978
|
-
|
|
20045
|
+
React.useMemo(() => {
|
|
19979
20046
|
if (!svgRef || !centerPoint)
|
|
19980
20047
|
return null;
|
|
19981
20048
|
const elementWidth = 50 * 10;
|
|
@@ -20128,8 +20195,9 @@ const SvgEditMap = React.forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMa
|
|
|
20128
20195
|
newElement = initChannel();
|
|
20129
20196
|
}
|
|
20130
20197
|
else if (type === exports.DataType.VISION_OFF) {
|
|
20198
|
+
const points = getVisionOffPoints();
|
|
20131
20199
|
newElement = initVisionOff();
|
|
20132
|
-
newElement.points =
|
|
20200
|
+
newElement.points = points;
|
|
20133
20201
|
}
|
|
20134
20202
|
else if (type === exports.DataType.DOODLE) {
|
|
20135
20203
|
addDoodle(item);
|
|
@@ -20563,12 +20631,13 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
|
|
|
20563
20631
|
// }, [mapJson]);
|
|
20564
20632
|
const mowerPositionData = React.useMemo(() => {
|
|
20565
20633
|
// realTimeData 中包含三个种类的数据,之需要实时坐标的数据即可。
|
|
20634
|
+
// 在初始的状态按照正常图标进行渲染,所以构造一个基本在rtk桩的一个数据
|
|
20566
20635
|
if (!realTimeData || realTimeData.length === 0)
|
|
20567
20636
|
return {
|
|
20568
|
-
postureX: 0,
|
|
20569
|
-
postureY: 0,
|
|
20570
|
-
postureTheta: 0,
|
|
20571
|
-
vehicleState: RobotStatus.
|
|
20637
|
+
postureX: 0.01,
|
|
20638
|
+
postureY: 0.1,
|
|
20639
|
+
postureTheta: 0.01,
|
|
20640
|
+
vehicleState: RobotStatus.PARKED,
|
|
20572
20641
|
};
|
|
20573
20642
|
let currentPositionData;
|
|
20574
20643
|
if (realTimeData.length === 1 && realTimeData[0].type === RealTimeDataType.LOCATION) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapDataProcessor.d.ts","sourceRoot":"","sources":["../../src/processor/MapDataProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACL,OAAO,EAOP,WAAW,EAEX,SAAS,EACV,MAAM,UAAU,CAAC;AAkBlB;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,SAAS,CAAY;IACpC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAS;IAC1B;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAG,WAAW,EAAE;IAsCxF;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAgDnC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;
|
|
1
|
+
{"version":3,"file":"MapDataProcessor.d.ts","sourceRoot":"","sources":["../../src/processor/MapDataProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACL,OAAO,EAOP,WAAW,EAEX,SAAS,EACV,MAAM,UAAU,CAAC;AAkBlB;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,SAAS,CAAY;IACpC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAS;IAC1B;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAG,WAAW,EAAE;IAsCxF;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAgDnC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAwNjC;;OAEG;IACH,MAAM,CAAC,kBAAkB,CACvB,QAAQ,EAAE,WAAW,EAAE,GAAG,SAAS,EACnC,aAAa,EAAE;QACb,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;KAC5B,GACA,WAAW,EAAE;CAOjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MowerMapRenderer.d.ts","sourceRoot":"","sources":["../../src/render/MowerMapRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAef,OAAO,EAGL,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AA2B3B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,GAAG,CAAC;KACb;CACF;AA8FD,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"MowerMapRenderer.d.ts","sourceRoot":"","sources":["../../src/render/MowerMapRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAef,OAAO,EAGL,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AA2B3B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,GAAG,CAAC;KACb;CACF;AA8FD,eAAO,MAAM,gBAAgB,mGA+sB5B,CAAC;AAIF,eAAe,gBAAgB,CAAC;AAChC,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCreateVisionOffElement.d.ts","sourceRoot":"","sources":["../../../../src/render/svgEditMap/hooks/useCreateVisionOffElement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCreateVisionOffElement.d.ts","sourceRoot":"","sources":["../../../../src/render/svgEditMap/hooks/useCreateVisionOffElement.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,yBAAyB;;;CAwC9B,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/render/svgEditMap/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAOT,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,SAAS,EACT,OAAO,EAEP,KAAK,EACN,MAAM,SAAS,CAAC;AAcjB,OAAO,EAEL,WAAW,EAEX,cAAc,EAEf,MAAM,mBAAmB,CAAC;AAe3B,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACxD,aAAa,EAAE,MAAM,aAAa,GAAG,IAAI,CAAC;IAC1C,mBAAmB,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IAE9C,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IACvD,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,WAAW,CAAC;IAEnC,sBAAsB,CAAC,EAAE,MAAM;QAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC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所有地块围成的边界
|
|
9
|
+
* @param bounds
|
|
10
|
+
* @param margin
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare function calculateBoundaryBounds(mapData: MapData): MapBounds;
|
|
14
|
+
export declare function calculateBoundaryBoundsCenter(mapData: MapData): [number, number];
|
|
7
15
|
/**
|
|
8
16
|
* 扩展边界(添加边距)
|
|
9
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapBounds.d.ts","sourceRoot":"","sources":["../../src/utils/mapBounds.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAqD9D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAOzE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,KAAK,CAKxD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAKlF;AAiBD;;;;GAIG;AAEH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG;IAC1D,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtB,GAAG,IAAI,CA4EP;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAoDpF"}
|
|
1
|
+
{"version":3,"file":"mapBoun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