@fleet-frontend/mower-maps 0.0.9-beta.8 → 0.0.9-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/dist/index.esm.js CHANGED
@@ -1049,7 +1049,6 @@ class PathLayer extends BaseLayer {
1049
1049
  d += ' Z ';
1050
1050
  }
1051
1051
  });
1052
- console.error('svgElements----', svgElements);
1053
1052
  // 3. svgElements(直接拼接path字符串,建议逆时针)
1054
1053
  if (Array.isArray(svgElements)) {
1055
1054
  svgElements.forEach((svgPath) => {
@@ -8892,7 +8891,6 @@ const MowerMapRenderer = forwardRef(({ mapConfig, modelType, mapRef, mapJson, pa
8892
8891
  const currentProcessMowingStatusRef = useRef(false);
8893
8892
  const { updateProcessStateIsMowing, processStateIsMowing } = useProcessMowingState();
8894
8893
  const [mowPartitionData, setMowPartitionData] = useState(null);
8895
- const [robotStatus, setRobotStatus] = useState(null);
8896
8894
  // Debug相关状态
8897
8895
  const [debugInfo, setDebugInfo] = useState({});
8898
8896
  // 处理地图分区边界
@@ -9254,6 +9252,7 @@ const MowerMapRenderer = forwardRef(({ mapConfig, modelType, mapRef, mapJson, pa
9254
9252
  }
9255
9253
  const positionData = realTimeData?.find(item => item?.type === RealTimeDataType.LOCATION);
9256
9254
  const statusData = realTimeData?.find(item => item?.type === RealTimeDataType.STATUS);
9255
+ console.log('current->1', positionData, statusData);
9257
9256
  if (statusData || positionData) {
9258
9257
  const currentStatus = statusData?.vehicleState || positionData?.vehicleState;
9259
9258
  // 车辆回桩不会回传最后的park的位置,所以根据实时数据的状态数据判断车辆回到桩上
@@ -9263,12 +9262,13 @@ const MowerMapRenderer = forwardRef(({ mapConfig, modelType, mapRef, mapJson, pa
9263
9262
  else if (currentStatus === RobotStatus.WORKING) {
9264
9263
  // 兜底收不到割草地块的实时数据,使用状态来兜底
9265
9264
  overlayRef.current.resetBorderLayerHighlight();
9266
- setMowPartitionData({});
9267
- curMowPartitionData = {};
9265
+ setMowPartitionData(null);
9266
+ curMowPartitionData = null;
9268
9267
  }
9269
- else if (robotStatus !== currentStatus && currentStatus === RobotStatus.MOWING && !mowPartitionData?.partitionIds) {
9270
- // 如果当前是割草状态,但是地块数据不存在则认为是全局割草,则把所有地块都高亮
9268
+ else if (currentStatus === RobotStatus.MOWING && (curMowPartitionData && !curMowPartitionData?.partitionIds)) {
9269
+ // 如果当前是割草状态,但是地块数据初始化过且不存在则认为是全局割草,则把所有地块都高亮
9271
9270
  const allPartitionIds = mapJson?.sub_maps?.map(item => item?.id);
9271
+ console.log('allPartitionIds->', allPartitionIds, mapJson);
9272
9272
  setMowPartitionData({
9273
9273
  partitionIds: allPartitionIds
9274
9274
  });
@@ -9276,7 +9276,6 @@ const MowerMapRenderer = forwardRef(({ mapConfig, modelType, mapRef, mapJson, pa
9276
9276
  partitionIds: allPartitionIds
9277
9277
  };
9278
9278
  }
9279
- setRobotStatus(currentStatus);
9280
9279
  }
9281
9280
  if (!mapJson ||
9282
9281
  !pathJson ||
@@ -9286,7 +9285,6 @@ const MowerMapRenderer = forwardRef(({ mapConfig, modelType, mapRef, mapJson, pa
9286
9285
  // TODO:需要根据返回的数据,处理车辆的移动位置
9287
9286
  console.log('realTimeData----->', realTimeData, curMowPartitionData);
9288
9287
  if (curMowPartitionData) {
9289
- setMowPartitionData(curMowPartitionData);
9290
9288
  const isMowing = curMowPartitionData?.partitionIds && curMowPartitionData.partitionIds.length > 0;
9291
9289
  overlayRef.current.updateMowPartitionData(curMowPartitionData);
9292
9290
  console.log('isMowing', isMowing, curMowPartitionData);
package/dist/index.js CHANGED
@@ -1051,7 +1051,6 @@ class PathLayer extends BaseLayer {
1051
1051
  d += ' Z ';
1052
1052
  }
1053
1053
  });
1054
- console.error('svgElements----', svgElements);
1055
1054
  // 3. svgElements(直接拼接path字符串,建议逆时针)
1056
1055
  if (Array.isArray(svgElements)) {
1057
1056
  svgElements.forEach((svgPath) => {
@@ -8894,7 +8893,6 @@ const MowerMapRenderer = React.forwardRef(({ mapConfig, modelType, mapRef, mapJs
8894
8893
  const currentProcessMowingStatusRef = React.useRef(false);
8895
8894
  const { updateProcessStateIsMowing, processStateIsMowing } = useProcessMowingState();
8896
8895
  const [mowPartitionData, setMowPartitionData] = React.useState(null);
8897
- const [robotStatus, setRobotStatus] = React.useState(null);
8898
8896
  // Debug相关状态
8899
8897
  const [debugInfo, setDebugInfo] = React.useState({});
8900
8898
  // 处理地图分区边界
@@ -9256,6 +9254,7 @@ const MowerMapRenderer = React.forwardRef(({ mapConfig, modelType, mapRef, mapJs
9256
9254
  }
9257
9255
  const positionData = realTimeData?.find(item => item?.type === RealTimeDataType.LOCATION);
9258
9256
  const statusData = realTimeData?.find(item => item?.type === RealTimeDataType.STATUS);
9257
+ console.log('current->1', positionData, statusData);
9259
9258
  if (statusData || positionData) {
9260
9259
  const currentStatus = statusData?.vehicleState || positionData?.vehicleState;
9261
9260
  // 车辆回桩不会回传最后的park的位置,所以根据实时数据的状态数据判断车辆回到桩上
@@ -9265,12 +9264,13 @@ const MowerMapRenderer = React.forwardRef(({ mapConfig, modelType, mapRef, mapJs
9265
9264
  else if (currentStatus === RobotStatus.WORKING) {
9266
9265
  // 兜底收不到割草地块的实时数据,使用状态来兜底
9267
9266
  overlayRef.current.resetBorderLayerHighlight();
9268
- setMowPartitionData({});
9269
- curMowPartitionData = {};
9267
+ setMowPartitionData(null);
9268
+ curMowPartitionData = null;
9270
9269
  }
9271
- else if (robotStatus !== currentStatus && currentStatus === RobotStatus.MOWING && !mowPartitionData?.partitionIds) {
9272
- // 如果当前是割草状态,但是地块数据不存在则认为是全局割草,则把所有地块都高亮
9270
+ else if (currentStatus === RobotStatus.MOWING && (curMowPartitionData && !curMowPartitionData?.partitionIds)) {
9271
+ // 如果当前是割草状态,但是地块数据初始化过且不存在则认为是全局割草,则把所有地块都高亮
9273
9272
  const allPartitionIds = mapJson?.sub_maps?.map(item => item?.id);
9273
+ console.log('allPartitionIds->', allPartitionIds, mapJson);
9274
9274
  setMowPartitionData({
9275
9275
  partitionIds: allPartitionIds
9276
9276
  });
@@ -9278,7 +9278,6 @@ const MowerMapRenderer = React.forwardRef(({ mapConfig, modelType, mapRef, mapJs
9278
9278
  partitionIds: allPartitionIds
9279
9279
  };
9280
9280
  }
9281
- setRobotStatus(currentStatus);
9282
9281
  }
9283
9282
  if (!mapJson ||
9284
9283
  !pathJson ||
@@ -9288,7 +9287,6 @@ const MowerMapRenderer = React.forwardRef(({ mapConfig, modelType, mapRef, mapJs
9288
9287
  // TODO:需要根据返回的数据,处理车辆的移动位置
9289
9288
  console.log('realTimeData----->', realTimeData, curMowPartitionData);
9290
9289
  if (curMowPartitionData) {
9291
- setMowPartitionData(curMowPartitionData);
9292
9290
  const isMowing = curMowPartitionData?.partitionIds && curMowPartitionData.partitionIds.length > 0;
9293
9291
  overlayRef.current.updateMowPartitionData(curMowPartitionData);
9294
9292
  console.log('isMowing', isMowing, curMowPartitionData);
@@ -1 +1 @@
1
- {"version":3,"file":"MowerMapRenderer.d.ts","sourceRoot":"","sources":["../../src/render/MowerMapRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AA4Cf,OAAO,EAAa,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAO1F,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,GAAG,CAAC;KACb;CACF;AAgGD,eAAO,MAAM,gBAAgB,mGAqtB5B,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;AA4Cf,OAAO,EAAa,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAO1F,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,GAAG,CAAC;KACb;CACF;AAgGD,eAAO,MAAM,gBAAgB,mGAmtB5B,CAAC;AAIF,eAAe,gBAAgB,CAAC;AAChC,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PathLayer.d.ts","sourceRoot":"","sources":["../../../src/render/layers/PathLayer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;GAGG;AACH,qBAAa,SAAU,SAAQ,SAAS;IACtC,KAAK,EAAE,MAAM,CAAK;IAClB,KAAK,EAAE,MAAM,CAAK;IAClB,SAAS,EAAE,MAAM,CAAK;IACtB,aAAa,EAAE,GAAG,CAAM;;IAOxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAkE3B;;OAEG;IACI,OAAO,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IA4B7E;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAiC1B"}
1
+ {"version":3,"file":"PathLayer.d.ts","sourceRoot":"","sources":["../../../src/render/layers/PathLayer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;GAGG;AACH,qBAAa,SAAU,SAAQ,SAAS;IACtC,KAAK,EAAE,MAAM,CAAK;IAClB,KAAK,EAAE,MAAM,CAAK;IAClB,SAAS,EAAE,MAAM,CAAK;IACtB,aAAa,EAAE,GAAG,CAAM;;IAOxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAiE3B;;OAEG;IACI,OAAO,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IA4B7E;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAiC1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleet-frontend/mower-maps",
3
- "version": "0.0.9-beta.8",
3
+ "version": "0.0.9-beta.9",
4
4
  "type": "module",
5
5
  "description": "a mower maps in google maps",
6
6
  "main": "dist/index.js",