@fleet-frontend/mower-maps 0.2.0-beta.55 → 0.2.0-beta.57

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 CHANGED
@@ -22474,11 +22474,13 @@ const ChannelClipPath = React__default.memo(() => {
22474
22474
  const boundaryData = svgElementDatas?.[DataType.BOUNDARY] || [];
22475
22475
  const [minX, minY, maxX, maxY] = useMemo(() => {
22476
22476
  const baseVal = svgViewBox;
22477
+ //.因为channel会有宽度,为了防止channel在边界会被截断,需要给边界留出一定的余量
22478
+ const padding = 20;
22477
22479
  return [
22478
- baseVal?.x || 0,
22479
- baseVal?.y || 0,
22480
- (baseVal?.x || 0) + (baseVal?.width || 0),
22481
- (baseVal?.y || 0) + (baseVal?.height || 0),
22480
+ (baseVal?.x || 0) - padding,
22481
+ (baseVal?.y || 0) - padding,
22482
+ (baseVal?.x || 0) + (baseVal?.width || 0) + padding,
22483
+ (baseVal?.y || 0) + (baseVal?.height || 0) + padding,
22482
22484
  ];
22483
22485
  }, [svgViewBox]);
22484
22486
  /**
@@ -29156,27 +29158,30 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
29156
29158
  }
29157
29159
  const positionData = realTimeData?.find((item) => item?.type === RealTimeDataType.LOCATION);
29158
29160
  if (positionData) {
29159
- const currentStatus = positionData?.vehicleState;
29160
- if (currentStatus === RobotStatus.WORKING) {
29161
+ // 如果当前是taskDelay的状态,或者状态为mowing或者standby,则指定的地块需要高亮,或者全局高亮
29162
+ if ((positionData?.taskDelay || positionData?.vehicleState === RobotStatus.MOWING || positionData?.vehicleState === RobotStatus.STANDBY) &&
29163
+ curMowPartitionData &&
29164
+ !curMowPartitionData?.partitionIds) {
29165
+ // 设置全局高亮
29166
+ if (curMowPartitionData &&
29167
+ !curMowPartitionData?.partitionIds) {
29168
+ const allPartitionIds = generateBoundaryData(mapJson)
29169
+ ?.filter((item) => !item?.isIsolated)
29170
+ .map((item) => item?.id);
29171
+ setMowPartitionData({
29172
+ partitionIds: allPartitionIds,
29173
+ });
29174
+ curMowPartitionData = {
29175
+ partitionIds: allPartitionIds,
29176
+ };
29177
+ }
29178
+ }
29179
+ else if (!positionData?.taskDelay && positionData?.vehicleState === RobotStatus.WORKING) {
29161
29180
  // 兜底收不到割草地块的实时数据,使用状态来兜底
29162
29181
  setMowingPartitions(undefined);
29163
29182
  setMowPartitionData({});
29164
29183
  curMowPartitionData = {};
29165
29184
  }
29166
- else if (currentStatus === RobotStatus.MOWING &&
29167
- curMowPartitionData &&
29168
- !curMowPartitionData?.partitionIds) {
29169
- // 如果当前是割草状态,但是地块数据初始化过且不存在则认为是全局割草,则把所有非孤立子区域地块都高亮
29170
- const allPartitionIds = generateBoundaryData(mapJson)
29171
- ?.filter((item) => !item?.isIsolated)
29172
- .map((item) => item?.id);
29173
- setMowPartitionData({
29174
- partitionIds: allPartitionIds,
29175
- });
29176
- curMowPartitionData = {
29177
- partitionIds: allPartitionIds,
29178
- };
29179
- }
29180
29185
  }
29181
29186
  if (!mapJson || !svgMapRef.current)
29182
29187
  return;
package/dist/index.js CHANGED
@@ -22494,11 +22494,13 @@ const ChannelClipPath = React.memo(() => {
22494
22494
  const boundaryData = svgElementDatas?.[exports.DataType.BOUNDARY] || [];
22495
22495
  const [minX, minY, maxX, maxY] = React.useMemo(() => {
22496
22496
  const baseVal = svgViewBox;
22497
+ //.因为channel会有宽度,为了防止channel在边界会被截断,需要给边界留出一定的余量
22498
+ const padding = 20;
22497
22499
  return [
22498
- baseVal?.x || 0,
22499
- baseVal?.y || 0,
22500
- (baseVal?.x || 0) + (baseVal?.width || 0),
22501
- (baseVal?.y || 0) + (baseVal?.height || 0),
22500
+ (baseVal?.x || 0) - padding,
22501
+ (baseVal?.y || 0) - padding,
22502
+ (baseVal?.x || 0) + (baseVal?.width || 0) + padding,
22503
+ (baseVal?.y || 0) + (baseVal?.height || 0) + padding,
22502
22504
  ];
22503
22505
  }, [svgViewBox]);
22504
22506
  /**
@@ -29176,27 +29178,30 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
29176
29178
  }
29177
29179
  const positionData = realTimeData?.find((item) => item?.type === RealTimeDataType.LOCATION);
29178
29180
  if (positionData) {
29179
- const currentStatus = positionData?.vehicleState;
29180
- if (currentStatus === RobotStatus.WORKING) {
29181
+ // 如果当前是taskDelay的状态,或者状态为mowing或者standby,则指定的地块需要高亮,或者全局高亮
29182
+ if ((positionData?.taskDelay || positionData?.vehicleState === RobotStatus.MOWING || positionData?.vehicleState === RobotStatus.STANDBY) &&
29183
+ curMowPartitionData &&
29184
+ !curMowPartitionData?.partitionIds) {
29185
+ // 设置全局高亮
29186
+ if (curMowPartitionData &&
29187
+ !curMowPartitionData?.partitionIds) {
29188
+ const allPartitionIds = generateBoundaryData(mapJson)
29189
+ ?.filter((item) => !item?.isIsolated)
29190
+ .map((item) => item?.id);
29191
+ setMowPartitionData({
29192
+ partitionIds: allPartitionIds,
29193
+ });
29194
+ curMowPartitionData = {
29195
+ partitionIds: allPartitionIds,
29196
+ };
29197
+ }
29198
+ }
29199
+ else if (!positionData?.taskDelay && positionData?.vehicleState === RobotStatus.WORKING) {
29181
29200
  // 兜底收不到割草地块的实时数据,使用状态来兜底
29182
29201
  setMowingPartitions(undefined);
29183
29202
  setMowPartitionData({});
29184
29203
  curMowPartitionData = {};
29185
29204
  }
29186
- else if (currentStatus === RobotStatus.MOWING &&
29187
- curMowPartitionData &&
29188
- !curMowPartitionData?.partitionIds) {
29189
- // 如果当前是割草状态,但是地块数据初始化过且不存在则认为是全局割草,则把所有非孤立子区域地块都高亮
29190
- const allPartitionIds = generateBoundaryData(mapJson)
29191
- ?.filter((item) => !item?.isIsolated)
29192
- .map((item) => item?.id);
29193
- setMowPartitionData({
29194
- partitionIds: allPartitionIds,
29195
- });
29196
- curMowPartitionData = {
29197
- partitionIds: allPartitionIds,
29198
- };
29199
- }
29200
29205
  }
29201
29206
  if (!mapJson || !svgMapRef.current)
29202
29207
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"MowerMapRenderer.d.ts","sourceRoot":"","sources":["../../src/render/MowerMapRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAuBf,OAAO,EAGL,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AA0B3B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,GAAG,CAAC;KACb;CACF;AA8FD,eAAO,MAAM,gBAAgB,mGAstB5B,CAAC;AAIF,eAAe,gBAAgB,CAAC;AAChC,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"MowerMapRenderer.d.ts","sourceRoot":"","sources":["../../src/render/MowerMapRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAuBf,OAAO,EAGL,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AA0B3B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,GAAG,CAAC;KACb;CACF;AA8FD,eAAO,MAAM,gBAAgB,mGAutB5B,CAAC;AAIF,eAAe,gBAAgB,CAAC;AAChC,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/render/svgElement/ChannelClipPath/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,QAAA,MAAM,eAAe,0EA+MnB,CAAC;AAEH,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/render/svgElement/ChannelClipPath/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,QAAA,MAAM,eAAe,0EAiNnB,CAAC;AAEH,eAAe,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleet-frontend/mower-maps",
3
- "version": "0.2.0-beta.55",
3
+ "version": "0.2.0-beta.57",
4
4
  "type": "module",
5
5
  "description": "a mower maps in google maps",
6
6
  "main": "dist/index.js",