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

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
@@ -15439,6 +15439,11 @@ function calculateMapBounds(mapData, ignoreVisionOffAreas = true) {
15439
15439
  if (mapData.sub_maps) {
15440
15440
  for (const subMap of mapData.sub_maps) {
15441
15441
  allElements.push(...(subMap.elements || []));
15442
+ for (const element of subMap.elements) {
15443
+ if (element.tunnel) {
15444
+ allElements.push(element.tunnel);
15445
+ }
15446
+ }
15442
15447
  }
15443
15448
  }
15444
15449
  if (mapData.obstacles)
@@ -25252,7 +25257,7 @@ const VisionOffTransformWrapper = ({ data, isSelected = false, onSelect, onCance
25252
25257
  const infoBoxWidth = 300 * overlayScale; // 信息框宽度
25253
25258
  const infoBoxHeight = 50 * overlayScale; // 信息框高度
25254
25259
  const infoBoxX = centerX - infoBoxWidth / 2; // 居中对齐
25255
- const scale = platform === PlatformType.H5 ? 2 * overlayScale : 3 * overlayScale;
25260
+ const scale = platform === PlatformType.H5 ? 1.8 * overlayScale : 3 * overlayScale;
25256
25261
  const offsetLeft = 10 * scale;
25257
25262
  return (jsxs(Fragment, { children: [showInfo && (jsx("foreignObject", { x: infoBoxX, y: infoBoxY, width: infoBoxWidth, height: infoBoxHeight, style: { textAlign: 'center' }, children: jsxs("div", { style: {
25258
25263
  padding: `5px ${10 * overlayScale}px`,
@@ -25951,7 +25956,7 @@ const DoodleTransformWrapper = ({ data, isSelected = false, isSelectedWithoutOpe
25951
25956
  const infoBoxWidth = 300 * overlayScale; // 信息框宽度
25952
25957
  const infoBoxHeight = 40 * overlayScale; // 信息框高度
25953
25958
  const infoBoxX = centerX - infoBoxWidth / 2; // 居中对齐
25954
- const circleScale = 2 * overlayScale;
25959
+ const circleScale = platform === PlatformType.H5 ? 1.5 * overlayScale : 2 * overlayScale;
25955
25960
  return (jsxs(Fragment, { children: [jsx("polygon", { points: selectionBoxPoints.map((point) => `${point.x},${point.y}`).join(' '), fill: "none", stroke: "#B2B4B9", strokeWidth: "2", strokeDasharray: "5,5", vectorEffect: "non-scaling-stroke", style: { cursor: 'move' }, ...(platform === PlatformType.H5
25956
25961
  ? {
25957
25962
  onTouchStart: createReactEventHandler((e) => {
@@ -26032,7 +26037,7 @@ const DoodleTransformWrapper = ({ data, isSelected = false, isSelectedWithoutOpe
26032
26037
  const infoBoxWidth = 300 * overlayScale; // 信息框宽度
26033
26038
  const infoBoxHeight = 100 * overlayScale; // 信息框高度
26034
26039
  const infoBoxX = centerX - infoBoxWidth / 2; // 居中对齐
26035
- const scale = platform === PlatformType.H5 ? 1 * overlayScale : 2 * overlayScale;
26040
+ const scale = platform === PlatformType.H5 ? 1.8 * overlayScale : 2 * overlayScale;
26036
26041
  const offsetLeft = 10 * scale;
26037
26042
  return (jsxs(Fragment, { children: [showInfo && (jsx("foreignObject", { x: infoBoxX, y: infoBoxY, width: infoBoxWidth, height: infoBoxHeight, style: { textAlign: 'center' }, onClick: () => {
26038
26043
  onClickInfo?.();
@@ -27276,7 +27281,7 @@ const Antennas = React__default.memo(({ editMap, antennaConfig = [], viewBox, ro
27276
27281
  }, children: [jsx("div", { style: { marginBottom: 4, fontWeight: 600 }, children: item.tooltip.title }), jsxs("div", { style: { color: 'rgba(65, 93, 116, 1)', fontWeight: 400 }, children: [item.tooltip.statusText, item.tooltip.syncText || ''] })] })] }, `antenna-${item.type}`))) }));
27277
27282
  });
27278
27283
 
27279
- var css_248z$1 = ".index-module_mapEdit__XC5Gw {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n height: 100%;\n cursor: default;\n}\n.index-module_mapEdit__XC5Gw.index-module_createMode__14EPH {\n cursor: crosshair;\n}\n.index-module_mapEdit__XC5Gw.index-module_notCreateCursor__1-OjF {\n cursor: no-drop;\n}";
27284
+ var css_248z$1 = ".index-module_mapEdit__XC5Gw {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n height: 100%;\n cursor: default;\n min-width: 1px;\n min-height: 1px;\n}\n.index-module_mapEdit__XC5Gw.index-module_createMode__14EPH {\n cursor: crosshair;\n}\n.index-module_mapEdit__XC5Gw.index-module_notCreateCursor__1-OjF {\n cursor: no-drop;\n}";
27280
27285
  var styles$1 = {"mapEdit":"index-module_mapEdit__XC5Gw","createMode":"index-module_createMode__14EPH","notCreateCursor":"index-module_notCreateCursor__1-OjF"};
27281
27286
  styleInject(css_248z$1);
27282
27287
 
@@ -29244,7 +29249,17 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
29244
29249
  // 基于固定的参考zoom级别计算overlayScale
29245
29250
  const zoomDiff = currentZoom - REFERENCE_ZOOM;
29246
29251
  const scale = Math.pow(2, -zoomDiff); // 负数实现反向缩放
29247
- setOverlayScale(scale < 1 ? 1 : platform === PlatformType.H5 ? 1.5 * scale : scale);
29252
+ console.log('scale------->', scale);
29253
+ // setOverlayScale(scale < 1 ? 1 : platform === PlatformType.H5 ? 1.5 * scale : scale);
29254
+ if (scale < 1) {
29255
+ setOverlayScale(1);
29256
+ }
29257
+ else if (scale > 200) {
29258
+ setOverlayScale(platform === PlatformType.H5 ? 300 : 200);
29259
+ }
29260
+ else {
29261
+ setOverlayScale(platform === PlatformType.H5 ? 1.5 * scale : scale);
29262
+ }
29248
29263
  };
29249
29264
  // 使用lodash throttle进行节流处理: 100ms内只执行一次
29250
29265
  const handleZoomChanged = throttle$2(updateScale, 50);
package/dist/index.js CHANGED
@@ -15459,6 +15459,11 @@ function calculateMapBounds(mapData, ignoreVisionOffAreas = true) {
15459
15459
  if (mapData.sub_maps) {
15460
15460
  for (const subMap of mapData.sub_maps) {
15461
15461
  allElements.push(...(subMap.elements || []));
15462
+ for (const element of subMap.elements) {
15463
+ if (element.tunnel) {
15464
+ allElements.push(element.tunnel);
15465
+ }
15466
+ }
15462
15467
  }
15463
15468
  }
15464
15469
  if (mapData.obstacles)
@@ -25272,7 +25277,7 @@ const VisionOffTransformWrapper = ({ data, isSelected = false, onSelect, onCance
25272
25277
  const infoBoxWidth = 300 * overlayScale; // 信息框宽度
25273
25278
  const infoBoxHeight = 50 * overlayScale; // 信息框高度
25274
25279
  const infoBoxX = centerX - infoBoxWidth / 2; // 居中对齐
25275
- const scale = platform === exports.PlatformType.H5 ? 2 * overlayScale : 3 * overlayScale;
25280
+ const scale = platform === exports.PlatformType.H5 ? 1.8 * overlayScale : 3 * overlayScale;
25276
25281
  const offsetLeft = 10 * scale;
25277
25282
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [showInfo && (jsxRuntime.jsx("foreignObject", { x: infoBoxX, y: infoBoxY, width: infoBoxWidth, height: infoBoxHeight, style: { textAlign: 'center' }, children: jsxRuntime.jsxs("div", { style: {
25278
25283
  padding: `5px ${10 * overlayScale}px`,
@@ -25971,7 +25976,7 @@ const DoodleTransformWrapper = ({ data, isSelected = false, isSelectedWithoutOpe
25971
25976
  const infoBoxWidth = 300 * overlayScale; // 信息框宽度
25972
25977
  const infoBoxHeight = 40 * overlayScale; // 信息框高度
25973
25978
  const infoBoxX = centerX - infoBoxWidth / 2; // 居中对齐
25974
- const circleScale = 2 * overlayScale;
25979
+ const circleScale = platform === exports.PlatformType.H5 ? 1.5 * overlayScale : 2 * overlayScale;
25975
25980
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("polygon", { points: selectionBoxPoints.map((point) => `${point.x},${point.y}`).join(' '), fill: "none", stroke: "#B2B4B9", strokeWidth: "2", strokeDasharray: "5,5", vectorEffect: "non-scaling-stroke", style: { cursor: 'move' }, ...(platform === exports.PlatformType.H5
25976
25981
  ? {
25977
25982
  onTouchStart: createReactEventHandler((e) => {
@@ -26052,7 +26057,7 @@ const DoodleTransformWrapper = ({ data, isSelected = false, isSelectedWithoutOpe
26052
26057
  const infoBoxWidth = 300 * overlayScale; // 信息框宽度
26053
26058
  const infoBoxHeight = 100 * overlayScale; // 信息框高度
26054
26059
  const infoBoxX = centerX - infoBoxWidth / 2; // 居中对齐
26055
- const scale = platform === exports.PlatformType.H5 ? 1 * overlayScale : 2 * overlayScale;
26060
+ const scale = platform === exports.PlatformType.H5 ? 1.8 * overlayScale : 2 * overlayScale;
26056
26061
  const offsetLeft = 10 * scale;
26057
26062
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [showInfo && (jsxRuntime.jsx("foreignObject", { x: infoBoxX, y: infoBoxY, width: infoBoxWidth, height: infoBoxHeight, style: { textAlign: 'center' }, onClick: () => {
26058
26063
  onClickInfo?.();
@@ -27296,7 +27301,7 @@ const Antennas = React.memo(({ editMap, antennaConfig = [], viewBox, rotation =
27296
27301
  }, children: [jsxRuntime.jsx("div", { style: { marginBottom: 4, fontWeight: 600 }, children: item.tooltip.title }), jsxRuntime.jsxs("div", { style: { color: 'rgba(65, 93, 116, 1)', fontWeight: 400 }, children: [item.tooltip.statusText, item.tooltip.syncText || ''] })] })] }, `antenna-${item.type}`))) }));
27297
27302
  });
27298
27303
 
27299
- var css_248z$1 = ".index-module_mapEdit__XC5Gw {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n height: 100%;\n cursor: default;\n}\n.index-module_mapEdit__XC5Gw.index-module_createMode__14EPH {\n cursor: crosshair;\n}\n.index-module_mapEdit__XC5Gw.index-module_notCreateCursor__1-OjF {\n cursor: no-drop;\n}";
27304
+ var css_248z$1 = ".index-module_mapEdit__XC5Gw {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n height: 100%;\n cursor: default;\n min-width: 1px;\n min-height: 1px;\n}\n.index-module_mapEdit__XC5Gw.index-module_createMode__14EPH {\n cursor: crosshair;\n}\n.index-module_mapEdit__XC5Gw.index-module_notCreateCursor__1-OjF {\n cursor: no-drop;\n}";
27300
27305
  var styles$1 = {"mapEdit":"index-module_mapEdit__XC5Gw","createMode":"index-module_createMode__14EPH","notCreateCursor":"index-module_notCreateCursor__1-OjF"};
27301
27306
  styleInject(css_248z$1);
27302
27307
 
@@ -29264,7 +29269,17 @@ modelType, showStraddleBoundaryBorder = true, mapRef, mapJson, pathJson, realTim
29264
29269
  // 基于固定的参考zoom级别计算overlayScale
29265
29270
  const zoomDiff = currentZoom - REFERENCE_ZOOM;
29266
29271
  const scale = Math.pow(2, -zoomDiff); // 负数实现反向缩放
29267
- setOverlayScale(scale < 1 ? 1 : platform === exports.PlatformType.H5 ? 1.5 * scale : scale);
29272
+ console.log('scale------->', scale);
29273
+ // setOverlayScale(scale < 1 ? 1 : platform === PlatformType.H5 ? 1.5 * scale : scale);
29274
+ if (scale < 1) {
29275
+ setOverlayScale(1);
29276
+ }
29277
+ else if (scale > 200) {
29278
+ setOverlayScale(platform === exports.PlatformType.H5 ? 300 : 200);
29279
+ }
29280
+ else {
29281
+ setOverlayScale(platform === exports.PlatformType.H5 ? 1.5 * scale : scale);
29282
+ }
29268
29283
  };
29269
29284
  // 使用lodash throttle进行节流处理: 100ms内只执行一次
29270
29285
  const handleZoomChanged = throttle$2(updateScale, 50);
@@ -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,mGA8sB5B,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,OAA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AE,OAAO,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAoDpF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleet-frontend/mower-maps",
3
- "version": "0.2.0-beta.53",
3
+ "version": "0.2.0-beta.55",
4
4
  "type": "module",
5
5
  "description": "a mower maps in google maps",
6
6
  "main": "dist/index.js",