@fleet-frontend/mower-maps 0.2.0-beta.27 → 0.2.0-beta.29
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/config/constants.d.ts +1 -0
- package/dist/config/constants.d.ts.map +1 -1
- package/dist/index.esm.js +232 -48
- package/dist/index.js +232 -48
- package/dist/processor/MapDataProcessor.d.ts.map +1 -1
- package/dist/processor/builder/MowGateDataBuilder.d.ts +16 -0
- package/dist/processor/builder/MowGateDataBuilder.d.ts.map +1 -0
- package/dist/render/MowerMapOverlay.d.ts.map +1 -1
- package/dist/render/MowerMapRenderer.d.ts.map +1 -1
- package/dist/render/SvgMapView.d.ts.map +1 -1
- package/dist/render/antennas/useAntennaInfo.d.ts.map +1 -1
- package/dist/render/boundaryLabels/useBoundaryLabels.d.ts.map +1 -1
- package/dist/render/drag/index.d.ts +1 -0
- package/dist/render/drag/index.d.ts.map +1 -1
- package/dist/render/layers/DrawLayer.d.ts +1 -0
- package/dist/render/layers/DrawLayer.d.ts.map +1 -1
- package/dist/render/layers/MowGateLayer.d.ts +19 -0
- package/dist/render/layers/MowGateLayer.d.ts.map +1 -0
- package/dist/types/common.d.ts +1 -1
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/elements.d.ts +12 -1
- package/dist/types/elements.d.ts.map +1 -1
- package/dist/types/layers.d.ts +1 -1
- package/dist/types/layers.d.ts.map +1 -1
- package/dist/types/map.d.ts +12 -0
- package/dist/types/map.d.ts.map +1 -1
- package/dist/types/renderer.d.ts +1 -0
- package/dist/types/renderer.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -72,6 +72,7 @@ export declare const LAYER_DEFAULT_TYPE: {
|
|
|
72
72
|
readonly SVG: "svg";
|
|
73
73
|
readonly VISION_OFF_AREA: "vision_off_area";
|
|
74
74
|
readonly ANTENNA: "antenna";
|
|
75
|
+
readonly MOW_GATE: "mow_gate";
|
|
75
76
|
};
|
|
76
77
|
export { RobotStatus, RTK_STATE, REAL_TIME_DATA_TYPE } from '../types/constants';
|
|
77
78
|
export declare const ISOLATED_BOUNDARY_SVG = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g opacity=\"0.6\">\n<rect width=\"24\" height=\"24\" rx=\"12\" fill=\"#1E1E1F\" fill-opacity=\"0.5\"/>\n<path d=\"M8.20573 12.4961C6.739 11.1707 4.85775 11.2284 3.60938 11.1707C6.17744 13.0156 6.05584 15.7887 5.67404 16.9446H14.327C13.837 13.1673 15.5321 10.1289 16.4408 9.08187C15.0342 9.46118 13.5794 10.8303 13.0278 11.4674C12.8102 8.94572 13.992 5.97489 14.61 4.80469C12.5235 5.92214 11.0501 8.26056 10.4938 9.56261C9.22803 7.5947 6.83894 7.17806 5.883 6.9432C8.20573 10.2373 8.00039 11.1707 8.20573 12.4961Z\" fill=\"white\"/>\n<mask id=\"path-3-outside-1_9822_43516\" maskUnits=\"userSpaceOnUse\" x=\"13.2344\" y=\"7.20545\" width=\"12.0208\" height=\"12.0208\" fill=\"black\">\n<rect fill=\"white\" x=\"13.2344\" y=\"7.20545\" width=\"12.0208\" height=\"12.0208\"/>\n<path d=\"M20.6852 11.1208C19.9042 10.3398 18.6378 10.3398 17.8568 11.1208L17.2733 11.7043C16.6707 12.3069 16.5358 13.1973 16.8631 13.9319L17.5916 13.2034C17.5657 12.9181 17.6619 12.6236 17.8803 12.4052L18.5674 11.7181C18.9579 11.3276 19.5911 11.3276 19.9816 11.7181L20.4056 12.1421C20.7959 12.5326 20.796 13.1658 20.4056 13.5563L19.7185 14.2434C19.5128 14.449 19.2393 14.5457 18.9699 14.5348L18.2235 15.2812C18.9538 15.596 19.8325 15.4565 20.429 14.86L21.0125 14.2765C21.7935 13.4955 21.7936 12.2291 21.0125 11.4481L20.6852 11.1208Z\"/>\n</mask>\n<path d=\"M20.6852 11.1208C19.9042 10.3398 18.6378 10.3398 17.8568 11.1208L17.2733 11.7043C16.6707 12.3069 16.5358 13.1973 16.8631 13.9319L17.5916 13.2034C17.5657 12.9181 17.6619 12.6236 17.8803 12.4052L18.5674 11.7181C18.9579 11.3276 19.5911 11.3276 19.9816 11.7181L20.4056 12.1421C20.7959 12.5326 20.796 13.1658 20.4056 13.5563L19.7185 14.2434C19.5128 14.449 19.2393 14.5457 18.9699 14.5348L18.2235 15.2812C18.9538 15.596 19.8325 15.4565 20.429 14.86L21.0125 14.2765C21.7935 13.4955 21.7936 12.2291 21.0125 11.4481L20.6852 11.1208Z\" fill=\"white\"/>\n<path d=\"M20.6852 11.1208L21.7458 10.0601L21.7459 10.0601L20.6852 11.1208ZM17.8568 11.1208L16.7961 10.0601L16.7962 10.0601L17.8568 11.1208ZM17.2733 11.7043L16.2126 10.6437L16.2126 10.6436L17.2733 11.7043ZM16.8631 13.9319L17.9238 14.9926L16.381 16.5354L15.493 14.5425L16.8631 13.9319ZM17.5916 13.2034L19.0855 13.0678L19.149 13.7674L18.6523 14.2641L17.5916 13.2034ZM20.4056 12.1421L21.4662 11.0814L21.4665 11.0817L20.4056 12.1421ZM18.9699 14.5348L17.9093 13.4741L18.3741 13.0093L19.0309 13.036L18.9699 14.5348ZM18.2235 15.2812L17.6298 16.6587L15.5997 15.7837L17.1628 14.2206L18.2235 15.2812ZM20.429 14.86L21.4897 15.9207L21.4897 15.9207L20.429 14.86ZM21.0125 14.2765L22.0732 15.3371L22.0732 15.3372L21.0125 14.2765ZM20.6852 11.1208L19.6246 12.1815C19.4294 11.9862 19.1127 11.9863 18.9174 12.1815L17.8568 11.1208L16.7962 10.0601C18.163 8.69337 20.379 8.6934 21.7458 10.0601L20.6852 11.1208ZM17.8568 11.1208L18.9175 12.1814L18.334 12.7649L17.2733 11.7043L16.2126 10.6436L16.7961 10.0601L17.8568 11.1208ZM17.2733 11.7043L18.334 12.7649C18.1877 12.9112 18.1488 13.1318 18.2333 13.3214L16.8631 13.9319L15.493 14.5425C14.9228 13.2629 15.1537 11.7026 16.2126 10.6437L17.2733 11.7043ZM16.8631 13.9319L15.8025 12.8713L16.531 12.1428L17.5916 13.2034L18.6523 14.2641L17.9238 14.9926L16.8631 13.9319ZM17.5916 13.2034L16.0978 13.339C16.0334 12.6302 16.2727 11.8914 16.8196 11.3445L17.8803 12.4052L18.9409 13.4658C19.051 13.3558 19.098 13.206 19.0855 13.0678L17.5916 13.2034ZM17.8803 12.4052L16.8196 11.3445L17.5067 10.6574L18.5674 11.7181L19.628 12.7788L18.9409 13.4658L17.8803 12.4052ZM18.5674 11.7181L17.5067 10.6574C18.483 9.68112 20.0659 9.68112 21.0422 10.6574L19.9816 11.7181L18.9209 12.7788C19.1162 12.974 19.4328 12.974 19.628 12.7788L18.5674 11.7181ZM19.9816 11.7181L21.0422 10.6574L21.4662 11.0814L20.4056 12.1421L19.3449 13.2027L18.9209 12.7788L19.9816 11.7181ZM20.4056 12.1421L21.4665 11.0817C22.4419 12.0577 22.4428 13.6404 21.4662 14.617L20.4056 13.5563L19.3449 12.4956C19.1493 12.6913 19.1498 13.0076 19.3446 13.2024L20.4056 12.1421ZM20.4056 13.5563L21.4662 14.617L20.7791 15.304L19.7185 14.2434L18.6578 13.1827L19.3449 12.4956L20.4056 13.5563ZM19.7185 14.2434L20.7791 15.304C20.2628 15.8204 19.5762 16.0607 18.909 16.0335L18.9699 14.5348L19.0309 13.036C18.9025 13.0308 18.7629 13.0777 18.6578 13.1827L19.7185 14.2434ZM18.9699 14.5348L20.0306 15.5954L19.2841 16.3419L18.2235 15.2812L17.1628 14.2206L17.9093 13.4741L18.9699 14.5348ZM18.2235 15.2812L18.8172 13.9037C19.0042 13.9843 19.2223 13.9455 19.3684 13.7993L20.429 14.86L21.4897 15.9207C20.4427 16.9676 18.9034 17.2077 17.6298 16.6587L18.2235 15.2812ZM20.429 14.86L19.3684 13.7994L19.9519 13.2159L21.0125 14.2765L22.0732 15.3372L21.4897 15.9207L20.429 14.86ZM21.0125 14.2765L19.9518 13.2159C20.1471 13.0206 20.1471 12.704 19.9519 12.5088L21.0125 11.4481L22.0732 10.3874C23.4401 11.7543 23.4399 13.9703 22.0732 15.3371L21.0125 14.2765ZM21.0125 11.4481L19.9519 12.5088L19.6246 12.1814L20.6852 11.1208L21.7459 10.0601L22.0732 10.3874L21.0125 11.4481Z\" fill=\"#8E8E8F\" mask=\"url(#path-3-outside-1_9822_43516)\"/>\n<mask id=\"path-5-outside-2_9822_43516\" maskUnits=\"userSpaceOnUse\" x=\"9.22265\" y=\"10.388\" width=\"12.7279\" height=\"12.7279\" fill=\"black\">\n<rect fill=\"white\" x=\"9.22265\" y=\"10.388\" width=\"12.7279\" height=\"12.7279\"/>\n<path d=\"M16.1708 14.5077C15.4353 14.1778 14.5422 14.3133 13.9383 14.9172L13.3548 15.5007C12.574 16.2818 12.5738 17.5481 13.3548 18.3291L13.6821 18.6564C14.4631 19.4374 15.7295 19.4373 16.5105 18.6564L17.094 18.0729C17.6895 17.4775 17.8299 16.6003 17.5173 15.8708L16.7743 16.6138C16.7828 16.8803 16.6863 17.1494 16.4829 17.3527L15.7952 18.0405C15.4046 18.4309 14.7714 18.431 14.3809 18.0405L13.957 17.6165C13.5667 17.226 13.5666 16.5927 13.957 16.2023L14.6447 15.5145C14.8654 15.2939 15.1639 15.1979 15.452 15.2266L16.1708 14.5077Z\"/>\n</mask>\n<path d=\"M16.1708 14.5077C15.4353 14.1778 14.5422 14.3133 13.9383 14.9172L13.3548 15.5007C12.574 16.2818 12.5738 17.5481 13.3548 18.3291L13.6821 18.6564C14.4631 19.4374 15.7295 19.4373 16.5105 18.6564L17.094 18.0729C17.6895 17.4775 17.8299 16.6003 17.5173 15.8708L16.7743 16.6138C16.7828 16.8803 16.6863 17.1494 16.4829 17.3527L15.7952 18.0405C15.4046 18.4309 14.7714 18.431 14.3809 18.0405L13.957 17.6165C13.5667 17.226 13.5666 16.5927 13.957 16.2023L14.6447 15.5145C14.8654 15.2939 15.1639 15.1979 15.452 15.2266L16.1708 14.5077Z\" fill=\"white\"/>\n<path d=\"M16.1708 14.5077L16.7847 13.1391L18.7701 14.0297L17.2315 15.5684L16.1708 14.5077ZM13.3548 15.5007L12.294 14.4402L12.2941 14.44L13.3548 15.5007ZM16.5105 18.6564L17.5712 19.7171L17.5711 19.7172L16.5105 18.6564ZM17.5173 15.8708L16.4567 14.8102L18.0236 13.2433L18.8962 15.2802L17.5173 15.8708ZM16.7743 16.6138L15.2751 16.6613L15.2545 16.0123L15.7137 15.5532L16.7743 16.6138ZM15.7952 18.0405L16.8558 19.1011L16.8556 19.1013L15.7952 18.0405ZM13.957 17.6165L12.8963 18.6772L12.8959 18.6767L13.957 17.6165ZM13.957 16.2023L12.8961 15.1418L12.8963 15.1416L13.957 16.2023ZM15.452 15.2266L16.5126 16.2872L16.0102 16.7896L15.3032 16.7192L15.452 15.2266ZM16.1708 14.5077L15.5569 15.8763C15.3688 15.792 15.1469 15.8299 14.999 15.9779L13.9383 14.9172L12.8776 13.8565C13.9375 12.7967 15.5018 12.5636 16.7847 13.1391L16.1708 14.5077ZM13.9383 14.9172L14.999 15.9779L14.4155 16.5614L13.3548 15.5007L12.2941 14.44L12.8776 13.8565L13.9383 14.9172ZM13.3548 15.5007L14.4156 16.5612C14.2202 16.7567 14.2204 17.0734 14.4155 17.2685L13.3548 18.3291L12.2941 19.3898C10.9272 18.0229 10.9277 15.8069 12.294 14.4402L13.3548 15.5007ZM13.3548 18.3291L14.4155 17.2685L14.7428 17.5958L13.6821 18.6564L12.6215 19.7171L12.2941 19.3898L13.3548 18.3291ZM13.6821 18.6564L14.7428 17.5958C14.9378 17.7908 15.2546 17.791 15.45 17.5956L16.5105 18.6564L17.5711 19.7172C16.2044 21.0836 13.9884 21.084 12.6215 19.7171L13.6821 18.6564ZM16.5105 18.6564L15.4499 17.5958L16.0334 17.0123L17.094 18.0729L18.1547 19.1336L17.5712 19.7171L16.5105 18.6564ZM17.094 18.0729L16.0334 17.0123C16.1795 16.8662 16.2185 16.6481 16.1385 16.4615L17.5173 15.8708L18.8962 15.2802C19.4413 16.5526 19.1996 18.0887 18.1547 19.1336L17.094 18.0729ZM17.5173 15.8708L18.578 16.9315L17.835 17.6745L16.7743 16.6138L15.7137 15.5532L16.4567 14.8102L17.5173 15.8708ZM16.7743 16.6138L18.2736 16.5664C18.2945 17.226 18.0544 17.9026 17.5436 18.4134L16.4829 17.3527L15.4223 16.2921C15.3182 16.3961 15.2711 16.5346 15.2751 16.6613L16.7743 16.6138ZM16.4829 17.3527L17.5436 18.4134L16.8558 19.1011L15.7952 18.0405L14.7345 16.9798L15.4223 16.2921L16.4829 17.3527ZM15.7952 18.0405L16.8556 19.1013C15.8795 20.0771 14.2967 20.0776 13.3203 19.1011L14.3809 18.0405L15.4416 16.9798C15.2461 16.7844 14.9297 16.7847 14.7347 16.9797L15.7952 18.0405ZM14.3809 18.0405L13.3203 19.1011L12.8963 18.6772L13.957 17.6165L15.0176 16.5558L15.4416 16.9798L14.3809 18.0405ZM13.957 17.6165L12.8959 18.6767C11.9207 17.7008 11.92 16.1182 12.8961 15.1418L13.957 16.2023L15.0178 17.2628C15.2133 17.0672 15.2128 16.7512 15.018 16.5563L13.957 17.6165ZM13.957 16.2023L12.8963 15.1416L13.5841 14.4539L14.6447 15.5145L15.7054 16.5752L15.0176 17.2629L13.957 16.2023ZM14.6447 15.5145L13.5841 14.4539C14.1364 13.9015 14.8848 13.6626 15.6007 13.734L15.452 15.2266L15.3032 16.7192C15.443 16.7331 15.5943 16.6862 15.7054 16.5752L14.6447 15.5145ZM15.452 15.2266L14.3913 14.1659L15.1101 13.4471L16.1708 14.5077L17.2315 15.5684L16.5126 16.2872L15.452 15.2266Z\" fill=\"#8E8E8F\" mask=\"url(#path-5-outside-2_9822_43516)\"/>\n<path d=\"M20.6852 11.1208C19.9042 10.3398 18.6378 10.3398 17.8568 11.1208L17.2733 11.7043C16.6707 12.3069 16.5358 13.1973 16.8631 13.9319L17.5916 13.2034C17.5657 12.9181 17.6619 12.6236 17.8803 12.4052L18.5674 11.7181C18.9579 11.3276 19.5911 11.3276 19.9816 11.7181L20.4056 12.1421C20.7959 12.5326 20.796 13.1658 20.4056 13.5563L19.7185 14.2434C19.5128 14.449 19.2393 14.5457 18.9699 14.5348L18.2235 15.2812C18.9538 15.596 19.8325 15.4565 20.429 14.86L21.0125 14.2765C21.7935 13.4955 21.7936 12.2291 21.0125 11.4481L20.6852 11.1208Z\" fill=\"white\"/>\n<rect width=\"2.59942\" height=\"2.97264\" rx=\"1\" transform=\"matrix(-0.707107 -0.707107 -0.707107 0.707107 21.1133 12.8486)\" fill=\"#8E8E8F\"/>\n<rect width=\"1.91578\" height=\"4.24403\" transform=\"matrix(-0.707107 -0.707107 -0.707107 0.707107 19.6992 13.8066)\" fill=\"#8E8E8F\"/>\n<rect width=\"2.59942\" height=\"2.97264\" rx=\"1\" transform=\"matrix(-0.707107 -0.707107 -0.707107 0.707107 17.3125 16.6455)\" fill=\"#8E8E8F\"/>\n</g>\n</svg>";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,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
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,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"}
|
package/dist/index.esm.js
CHANGED
|
@@ -101,6 +101,7 @@ const LAYER_DEFAULT_TYPE = {
|
|
|
101
101
|
SVG: 'svg',
|
|
102
102
|
VISION_OFF_AREA: 'vision_off_area',
|
|
103
103
|
ANTENNA: 'antenna',
|
|
104
|
+
MOW_GATE: 'mow_gate',
|
|
104
105
|
};
|
|
105
106
|
/**
|
|
106
107
|
* 遍历割草任务,下述四个字段可以在路径中唯一确定遍历的位置(当前区域、当前块、当前行、在当前行上的路程)
|
|
@@ -8624,6 +8625,23 @@ const useDrag = ({ dragCallbacks, onBoundaryLabelsCollapse, onTransformChange, }
|
|
|
8624
8625
|
|
|
8625
8626
|
// 编辑模式相关常量配置
|
|
8626
8627
|
// 默认的旋转图标
|
|
8628
|
+
const DEFAULT_ROTATE_ICON = `
|
|
8629
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8630
|
+
<g clip-path="url(#clip0_8198_30743)">
|
|
8631
|
+
<path d="M20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10C0 4.47715 4.47715 0 10 0C15.5228 0 20 4.47715 20 10Z" fill="url(#paint0_linear_8198_30743)"/>
|
|
8632
|
+
<path d="M11.4894 14.7176C10.4257 14.9506 9.31616 14.8595 8.30481 14.4558C7.29342 14.0521 6.4264 13.3535 5.81555 12.4519C5.24299 11.6068 4.92013 10.6187 4.88196 9.60134L4.87805 9.39724C4.87805 8.94523 5.24441 8.57892 5.69641 8.57888C6.12014 8.57888 6.46888 8.90061 6.51087 9.31325L6.51477 9.39724L6.52551 9.68142C6.57513 10.3429 6.79716 10.9821 7.17102 11.534C7.54479 12.0855 8.05583 12.528 8.65149 12.8191L8.91223 12.9343C9.61943 13.2166 10.395 13.2809 11.1388 13.1179L11.4142 13.0467C11.6075 12.9889 11.795 12.9149 11.9757 12.8279L10.8282 12.3865C10.4074 12.2245 10.1977 11.7518 10.3595 11.3308C10.5215 10.9099 10.9941 10.7003 11.4152 10.8621L13.9562 11.8386C14.3773 12.0005 14.5878 12.4732 14.4259 12.8943C14.3891 12.9901 14.3364 13.0752 14.2716 13.1472L14.2726 13.1482C13.5227 13.9377 12.5531 14.4845 11.4894 14.7176Z" fill="white"/>
|
|
8633
|
+
<path d="M8.51062 4.54807C9.57433 4.31505 10.6838 4.40612 11.6952 4.80979C12.7066 5.21356 13.5736 5.91214 14.1844 6.8137C14.757 7.65884 15.0799 8.64688 15.118 9.66429L15.1219 9.86839C15.1219 10.3204 14.7556 10.6867 14.3036 10.6867C13.8799 10.6867 13.5311 10.365 13.4891 9.95237L13.4852 9.86839L13.4745 9.58421C13.4249 8.92272 13.2028 8.28348 12.829 7.73167C12.4552 7.18008 11.9442 6.73767 11.3485 6.44651L11.0878 6.33128C10.3806 6.04903 9.60501 5.98477 8.8612 6.14768L8.58581 6.21897C8.39252 6.27673 8.20502 6.35068 8.02429 6.43772L9.17175 6.87913C9.59256 7.04116 9.8023 7.51383 9.6405 7.93479C9.47855 8.35574 9.00587 8.56537 8.58484 8.40354L6.04382 7.42698C5.6227 7.26512 5.41224 6.79244 5.57409 6.37132C5.61094 6.27552 5.66365 6.19044 5.72839 6.11839L5.72742 6.11741C6.47734 5.32789 7.44693 4.78114 8.51062 4.54807Z" fill="white"/>
|
|
8634
|
+
</g>
|
|
8635
|
+
<defs>
|
|
8636
|
+
<linearGradient id="paint0_linear_8198_30743" x1="17.7273" y1="16.3636" x2="-1.21533" y2="2.08814e-07" gradientUnits="userSpaceOnUse">
|
|
8637
|
+
<stop stop-color="#F16629"/>
|
|
8638
|
+
<stop offset="1" stop-color="#F1A129"/>
|
|
8639
|
+
</linearGradient>
|
|
8640
|
+
<clipPath id="clip0_8198_30743">
|
|
8641
|
+
<rect width="20" height="20" fill="white" transform="matrix(-1 0 0 1 20 0)"/>
|
|
8642
|
+
</clipPath>
|
|
8643
|
+
</defs>
|
|
8644
|
+
</svg>`;
|
|
8627
8645
|
// 默认的拖拽图标
|
|
8628
8646
|
const DEFAULT_DRAG_ICON = `
|
|
8629
8647
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -8637,6 +8655,41 @@ const DEFAULT_DRAG_ICON = `
|
|
|
8637
8655
|
</defs>
|
|
8638
8656
|
</svg>`;
|
|
8639
8657
|
|
|
8658
|
+
function styleInject(css, ref) {
|
|
8659
|
+
if ( ref === void 0 ) ref = {};
|
|
8660
|
+
var insertAt = ref.insertAt;
|
|
8661
|
+
|
|
8662
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
8663
|
+
|
|
8664
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
8665
|
+
var style = document.createElement('style');
|
|
8666
|
+
style.type = 'text/css';
|
|
8667
|
+
|
|
8668
|
+
if (insertAt === 'top') {
|
|
8669
|
+
if (head.firstChild) {
|
|
8670
|
+
head.insertBefore(style, head.firstChild);
|
|
8671
|
+
} else {
|
|
8672
|
+
head.appendChild(style);
|
|
8673
|
+
}
|
|
8674
|
+
} else {
|
|
8675
|
+
head.appendChild(style);
|
|
8676
|
+
}
|
|
8677
|
+
|
|
8678
|
+
if (style.styleSheet) {
|
|
8679
|
+
style.styleSheet.cssText = css;
|
|
8680
|
+
} else {
|
|
8681
|
+
style.appendChild(document.createTextNode(css));
|
|
8682
|
+
}
|
|
8683
|
+
}
|
|
8684
|
+
|
|
8685
|
+
var css_248z$6 = ".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}";
|
|
8686
|
+
var styles$6 = {"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"};
|
|
8687
|
+
styleInject(css_248z$6);
|
|
8688
|
+
|
|
8689
|
+
const RotateHandle = ({ onRotateStart, isRotating }) => {
|
|
8690
|
+
return (jsx("div", { className: styles$6.rotate, onMouseDown: (e) => onRotateStart(e), onTouchStart: (e) => onRotateStart(e), style: { cursor: isRotating ? 'grabbing' : 'grab' }, dangerouslySetInnerHTML: { __html: DEFAULT_ROTATE_ICON } }));
|
|
8691
|
+
};
|
|
8692
|
+
|
|
8640
8693
|
/**
|
|
8641
8694
|
* 高级节流函数
|
|
8642
8695
|
* @param func 要节流的函数
|
|
@@ -8706,37 +8759,6 @@ function isMobileDevice() {
|
|
|
8706
8759
|
return isMobileUserAgent || (hasTouchScreen && isSmallScreen);
|
|
8707
8760
|
}
|
|
8708
8761
|
|
|
8709
|
-
function styleInject(css, ref) {
|
|
8710
|
-
if ( ref === void 0 ) ref = {};
|
|
8711
|
-
var insertAt = ref.insertAt;
|
|
8712
|
-
|
|
8713
|
-
if (!css || typeof document === 'undefined') { return; }
|
|
8714
|
-
|
|
8715
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
8716
|
-
var style = document.createElement('style');
|
|
8717
|
-
style.type = 'text/css';
|
|
8718
|
-
|
|
8719
|
-
if (insertAt === 'top') {
|
|
8720
|
-
if (head.firstChild) {
|
|
8721
|
-
head.insertBefore(style, head.firstChild);
|
|
8722
|
-
} else {
|
|
8723
|
-
head.appendChild(style);
|
|
8724
|
-
}
|
|
8725
|
-
} else {
|
|
8726
|
-
head.appendChild(style);
|
|
8727
|
-
}
|
|
8728
|
-
|
|
8729
|
-
if (style.styleSheet) {
|
|
8730
|
-
style.styleSheet.cssText = css;
|
|
8731
|
-
} else {
|
|
8732
|
-
style.appendChild(document.createTextNode(css));
|
|
8733
|
-
}
|
|
8734
|
-
}
|
|
8735
|
-
|
|
8736
|
-
var css_248z$6 = ".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}";
|
|
8737
|
-
var styles$6 = {"edit":"index-module_edit__-5VvX","border":"index-module_border__JdNLM","drag":"index-module_drag__uvdPG","move":"index-module_move__mZF8s"};
|
|
8738
|
-
styleInject(css_248z$6);
|
|
8739
|
-
|
|
8740
8762
|
const DragHandle = ({ onDragStart, isDragging }) => {
|
|
8741
8763
|
// 在PC设备上隐藏拖拽手柄
|
|
8742
8764
|
if (!isMobileDevice()) {
|
|
@@ -8751,8 +8773,8 @@ const DragHandle = ({ onDragStart, isDragging }) => {
|
|
|
8751
8773
|
style: { cursor: isDragging ? 'grabbing' : 'move' }, dangerouslySetInnerHTML: { __html: DEFAULT_DRAG_ICON } }));
|
|
8752
8774
|
};
|
|
8753
8775
|
|
|
8754
|
-
const MapDrag = ({ map: _map, dragCallbacks, onBoundaryLabelsCollapse, onTransformChange, isDragMap = false, }) => {
|
|
8755
|
-
const { isDragging, handleDragStart, addGlobalListeners } = useDrag({
|
|
8776
|
+
const MapDrag = ({ map: _map, dragCallbacks, onBoundaryLabelsCollapse, onTransformChange, isDragMap = false, canRotateMap = false, }) => {
|
|
8777
|
+
const { isDragging, isRotating, handleDragStart, addGlobalListeners } = useDrag({
|
|
8756
8778
|
dragCallbacks,
|
|
8757
8779
|
onBoundaryLabelsCollapse,
|
|
8758
8780
|
onTransformChange,
|
|
@@ -8763,6 +8785,10 @@ const MapDrag = ({ map: _map, dragCallbacks, onBoundaryLabelsCollapse, onTransfo
|
|
|
8763
8785
|
const cleanup = addGlobalListeners();
|
|
8764
8786
|
return cleanup;
|
|
8765
8787
|
}, [addGlobalListeners]);
|
|
8788
|
+
// 处理旋转开始
|
|
8789
|
+
const handleRotateStart = (e) => {
|
|
8790
|
+
handleDragStart(e, 'rotate', containerRef?.current);
|
|
8791
|
+
};
|
|
8766
8792
|
// 处理拖拽开始
|
|
8767
8793
|
const handleDragStartEvent = (e) => {
|
|
8768
8794
|
handleDragStart(e, 'drag', containerRef?.current);
|
|
@@ -8770,7 +8796,7 @@ const MapDrag = ({ map: _map, dragCallbacks, onBoundaryLabelsCollapse, onTransfo
|
|
|
8770
8796
|
if (!isDragMap) {
|
|
8771
8797
|
return null;
|
|
8772
8798
|
}
|
|
8773
|
-
return (jsxs("div", { ref: containerRef, className: styles$6.edit, style: { cursor: isDragging ? 'grabbing' : 'move' }, children: [jsx("div", { className: styles$6.border }), jsx("div", { className: styles$6.drag, onMouseDown: handleDragStartEvent, onTouchStart: handleDragStartEvent }), jsx(DragHandle, { onDragStart: handleDragStartEvent, isDragging: isDragging })] }));
|
|
8799
|
+
return (jsxs("div", { ref: containerRef, className: styles$6.edit, style: { cursor: isDragging ? 'grabbing' : 'move' }, children: [jsx("div", { className: styles$6.border }), canRotateMap && jsx(RotateHandle, { onRotateStart: handleRotateStart, isRotating: isRotating }), jsx("div", { className: styles$6.drag, onMouseDown: handleDragStartEvent, onTouchStart: handleDragStartEvent }), jsx(DragHandle, { onDragStart: handleDragStartEvent, isDragging: isDragging })] }));
|
|
8774
8800
|
};
|
|
8775
8801
|
|
|
8776
8802
|
/**
|
|
@@ -8922,13 +8948,17 @@ class SvgMapView {
|
|
|
8922
8948
|
return;
|
|
8923
8949
|
}
|
|
8924
8950
|
// 获取容器的实际尺寸进行验证
|
|
8925
|
-
|
|
8926
|
-
const
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
|
|
8951
|
+
// 我想打印出这个container包含的所有元素,应该用什么函数
|
|
8952
|
+
// const elements = this.container.querySelectorAll('*');
|
|
8953
|
+
// console.error('fitToView-elements---->', elements);
|
|
8954
|
+
// const containerRect = this.container.getBoundingClientRect();
|
|
8955
|
+
// console.error('fitToView-containerRect---->', containerRect);
|
|
8956
|
+
// const containerWidth = containerRect.width;
|
|
8957
|
+
// const containerHeight = containerRect.height;
|
|
8958
|
+
// if (containerWidth <= 0 || containerHeight <= 0) {
|
|
8959
|
+
// console.warn('Invalid container size:', containerWidth, containerHeight);
|
|
8960
|
+
// return;
|
|
8961
|
+
// }
|
|
8932
8962
|
// // 计算内容和容器的宽高比
|
|
8933
8963
|
// const contentAspectRatio = boundWidth / boundHeight;
|
|
8934
8964
|
// const containerAspectRatio = containerWidth / containerHeight;
|
|
@@ -13299,6 +13329,85 @@ class AntennaLayer extends BaseLayer {
|
|
|
13299
13329
|
}
|
|
13300
13330
|
}
|
|
13301
13331
|
|
|
13332
|
+
/**
|
|
13333
|
+
* SVG元素图层
|
|
13334
|
+
* 专门处理SVG元素的渲染
|
|
13335
|
+
*/
|
|
13336
|
+
class MowGateLayer extends BaseLayer {
|
|
13337
|
+
constructor() {
|
|
13338
|
+
super();
|
|
13339
|
+
this.level = 6;
|
|
13340
|
+
this.scale = 1;
|
|
13341
|
+
this.type = LAYER_DEFAULT_TYPE.MOW_GATE;
|
|
13342
|
+
}
|
|
13343
|
+
/**
|
|
13344
|
+
* SVG渲染方法
|
|
13345
|
+
*/
|
|
13346
|
+
drawSVG(svgGroup) {
|
|
13347
|
+
if (!this.visible || this.elements.length === 0) {
|
|
13348
|
+
return;
|
|
13349
|
+
}
|
|
13350
|
+
// 只渲染SVG类型的元素
|
|
13351
|
+
for (const element of this.elements) {
|
|
13352
|
+
this.renderMowGateElement(svgGroup, element);
|
|
13353
|
+
}
|
|
13354
|
+
}
|
|
13355
|
+
/**
|
|
13356
|
+
* 渲染SVG元素
|
|
13357
|
+
*/
|
|
13358
|
+
renderMowGateElement(svgGroup, element) {
|
|
13359
|
+
const { coordinates, style, metadata } = element;
|
|
13360
|
+
console.log('mowgate', element);
|
|
13361
|
+
if (coordinates.length === 0)
|
|
13362
|
+
return;
|
|
13363
|
+
const center = coordinates[0];
|
|
13364
|
+
// Inline MowGate SVG markup
|
|
13365
|
+
const svgMarkup = `<svg width="22" height="22" viewBox="0 0 43 42" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
13366
|
+
<rect x="1.5" y="1.5" width="39" height="39" rx="19.5" fill="#EBEEF1" stroke="white" stroke-width="3"/>
|
|
13367
|
+
<path d="M28.6641 11.918C30.6523 11.918 32.2637 13.5304 32.2637 15.5186V29.002C32.2637 29.5984 31.7801 30.082 31.1836 30.082H10.8164C10.2201 30.0819 9.73633 29.5983 9.73633 29.002V15.5186C9.73633 13.5303 11.3487 11.918 13.3369 11.918H28.6641Z" fill="url(#paint0_linear_15603_15792)" stroke="#676E88" stroke-width="1.8"/>
|
|
13368
|
+
<rect x="20.4541" y="12.8184" width="1.09091" height="16.3636" fill="white" fill-opacity="0.3"/>
|
|
13369
|
+
<mask id="path-4-inside-1_15603_15792" fill="white">
|
|
13370
|
+
<rect x="16.0909" y="16.0918" width="9.81818" height="9.81818" rx="0.9"/>
|
|
13371
|
+
</mask>
|
|
13372
|
+
<rect x="16.0909" y="16.0918" width="9.81818" height="9.81818" rx="0.9" stroke="white" stroke-width="2.18182" stroke-dasharray="2.7 2.7" mask="url(#path-4-inside-1_15603_15792)"/>
|
|
13373
|
+
<defs>
|
|
13374
|
+
<linearGradient id="paint0_linear_15603_15792" x1="20.0292" y1="10.6652" x2="23.7032" y2="28.6292" gradientUnits="userSpaceOnUse">
|
|
13375
|
+
<stop stop-color="#8488A2"/>
|
|
13376
|
+
<stop offset="0.649539" stop-color="#585B71"/>
|
|
13377
|
+
<stop offset="0.885026" stop-color="#444959"/>
|
|
13378
|
+
</linearGradient>
|
|
13379
|
+
</defs>
|
|
13380
|
+
</svg>`;
|
|
13381
|
+
try {
|
|
13382
|
+
const parser = new DOMParser();
|
|
13383
|
+
const svgDoc = parser.parseFromString(svgMarkup, 'image/svg+xml');
|
|
13384
|
+
const svgEl = svgDoc.documentElement;
|
|
13385
|
+
if (!svgEl || svgEl.tagName.toLowerCase() !== 'svg')
|
|
13386
|
+
return;
|
|
13387
|
+
const originalWidth = parseFloat(svgEl.getAttribute('width') || '20');
|
|
13388
|
+
const originalHeight = parseFloat(svgEl.getAttribute('height') || '20');
|
|
13389
|
+
const userScale = metadata?.scale || 1;
|
|
13390
|
+
const direction = metadata?.direction || 0;
|
|
13391
|
+
const transformGroup = document.createElementNS('http://www.w3.org/2000/svg', 'g');
|
|
13392
|
+
const transform = [
|
|
13393
|
+
`translate(${center[0]}, ${center[1]})`,
|
|
13394
|
+
`rotate(${-(direction * 180) / Math.PI})`,
|
|
13395
|
+
`scale(${userScale})`,
|
|
13396
|
+
`translate(${-originalWidth / 2}, ${-originalHeight / 2})`,
|
|
13397
|
+
].join(' ');
|
|
13398
|
+
transformGroup.setAttribute('transform', transform);
|
|
13399
|
+
if (style?.opacity !== undefined) {
|
|
13400
|
+
transformGroup.setAttribute('opacity', String(style.opacity));
|
|
13401
|
+
}
|
|
13402
|
+
transformGroup.appendChild(svgEl);
|
|
13403
|
+
svgGroup.appendChild(transformGroup);
|
|
13404
|
+
}
|
|
13405
|
+
catch {
|
|
13406
|
+
// ignore parse errors
|
|
13407
|
+
}
|
|
13408
|
+
}
|
|
13409
|
+
}
|
|
13410
|
+
|
|
13302
13411
|
/**
|
|
13303
13412
|
* DrawLayer 绘制图层
|
|
13304
13413
|
* 负责管理和渲染各种类型的矢量图形元素
|
|
@@ -13328,6 +13437,8 @@ class DrawLayer extends BaseLayer {
|
|
|
13328
13437
|
this.svgElementLayer = new SvgElementLayer();
|
|
13329
13438
|
// 视觉盲区图层
|
|
13330
13439
|
this.visionOffLayer = new VisionOffLayer();
|
|
13440
|
+
// 狗洞图层
|
|
13441
|
+
this.mowgateLayer = new MowGateLayer();
|
|
13331
13442
|
}
|
|
13332
13443
|
// ==================== 元素管理 ====================
|
|
13333
13444
|
/**
|
|
@@ -13367,6 +13478,9 @@ class DrawLayer extends BaseLayer {
|
|
|
13367
13478
|
case 'vision_off_area':
|
|
13368
13479
|
this.visionOffLayer.addElement(element);
|
|
13369
13480
|
break;
|
|
13481
|
+
case 'mow_gate':
|
|
13482
|
+
this.mowgateLayer.addElement(element);
|
|
13483
|
+
break;
|
|
13370
13484
|
}
|
|
13371
13485
|
}
|
|
13372
13486
|
/**
|
|
@@ -13394,6 +13508,7 @@ class DrawLayer extends BaseLayer {
|
|
|
13394
13508
|
this.pointLayer.clearElements();
|
|
13395
13509
|
this.svgElementLayer.clearElements();
|
|
13396
13510
|
this.visionOffLayer.clearElements();
|
|
13511
|
+
this.mowgateLayer.clearElements();
|
|
13397
13512
|
}
|
|
13398
13513
|
// ==================== SVG渲染系统 ====================
|
|
13399
13514
|
/**
|
|
@@ -13414,6 +13529,7 @@ class DrawLayer extends BaseLayer {
|
|
|
13414
13529
|
this.pointLayer.drawSVG(svgGroup, scale);
|
|
13415
13530
|
this.svgElementLayer.drawSVG(svgGroup, scale);
|
|
13416
13531
|
this.visionOffLayer.drawSVG(svgGroup, scale);
|
|
13532
|
+
this.mowgateLayer.drawSVG(svgGroup, scale);
|
|
13417
13533
|
}
|
|
13418
13534
|
getLayers() {
|
|
13419
13535
|
return [
|
|
@@ -13427,6 +13543,7 @@ class DrawLayer extends BaseLayer {
|
|
|
13427
13543
|
this.pointLayer,
|
|
13428
13544
|
this.svgElementLayer,
|
|
13429
13545
|
this.visionOffLayer,
|
|
13546
|
+
this.mowgateLayer
|
|
13430
13547
|
]?.filter((layer) => layer.getElements().length > 0);
|
|
13431
13548
|
}
|
|
13432
13549
|
getPathLayers() {
|
|
@@ -13728,6 +13845,42 @@ class ChannelDataBuilder {
|
|
|
13728
13845
|
}
|
|
13729
13846
|
}
|
|
13730
13847
|
|
|
13848
|
+
/**
|
|
13849
|
+
* SVG元素数据构建器
|
|
13850
|
+
*/
|
|
13851
|
+
class MowGateDataBuilder {
|
|
13852
|
+
/**
|
|
13853
|
+
* 创建SVG元素数据
|
|
13854
|
+
*/
|
|
13855
|
+
static create(center, metadata, style) {
|
|
13856
|
+
return {
|
|
13857
|
+
type: 'mow_gate',
|
|
13858
|
+
coordinates: [center],
|
|
13859
|
+
style,
|
|
13860
|
+
metadata,
|
|
13861
|
+
};
|
|
13862
|
+
}
|
|
13863
|
+
/**
|
|
13864
|
+
* 从地图元素创建SVG数据(用于时间限制障碍物)
|
|
13865
|
+
*/
|
|
13866
|
+
static fromMapElement(element, style) {
|
|
13867
|
+
if (!element?.position) {
|
|
13868
|
+
return null;
|
|
13869
|
+
}
|
|
13870
|
+
const center = convertPositionFormat(element?.position);
|
|
13871
|
+
if (!center)
|
|
13872
|
+
return null;
|
|
13873
|
+
const drawElement = this.create([center.x, center.y], {
|
|
13874
|
+
area: element.area,
|
|
13875
|
+
direction: element.direction,
|
|
13876
|
+
width: element.width,
|
|
13877
|
+
length: element.length
|
|
13878
|
+
}, style);
|
|
13879
|
+
drawElement.originalData = element; // 保存完整的原始数据
|
|
13880
|
+
return drawElement;
|
|
13881
|
+
}
|
|
13882
|
+
}
|
|
13883
|
+
|
|
13731
13884
|
/**
|
|
13732
13885
|
* 地图数据处理器
|
|
13733
13886
|
* 负责将原始的地图数据转换为可渲染的图层元素
|
|
@@ -13765,6 +13918,11 @@ class MapDataProcessor {
|
|
|
13765
13918
|
if (mapData.vision_off_areas && mapData.vision_off_areas.length > 0) {
|
|
13766
13919
|
allElements.push(...mapData.vision_off_areas);
|
|
13767
13920
|
}
|
|
13921
|
+
// 处理狗洞
|
|
13922
|
+
if (mapData.mow_gates
|
|
13923
|
+
&& mapData.mow_gates.length > 0) {
|
|
13924
|
+
allElements.push(...mapData.mow_gates);
|
|
13925
|
+
}
|
|
13768
13926
|
// 按照元素类型分组并设置不同的层级
|
|
13769
13927
|
return this.createLayeredMapData(allElements);
|
|
13770
13928
|
}
|
|
@@ -13782,6 +13940,7 @@ class MapDataProcessor {
|
|
|
13782
13940
|
BOUNDARY: [],
|
|
13783
13941
|
TUNNEL: [],
|
|
13784
13942
|
TUNNEL_TO_CHARGING_PILE: [],
|
|
13943
|
+
MOW_GATE: []
|
|
13785
13944
|
};
|
|
13786
13945
|
// 分组所有元素
|
|
13787
13946
|
for (const element of elements) {
|
|
@@ -13798,6 +13957,7 @@ class MapDataProcessor {
|
|
|
13798
13957
|
CHARGING_PILE: 150, // 高层级
|
|
13799
13958
|
VISION_OFF_AREA: 150, // 高层级
|
|
13800
13959
|
TIME_LIMIT_OBSTACLE: 150, // 高层级(最高优先级)
|
|
13960
|
+
MOW_GATE: 200
|
|
13801
13961
|
};
|
|
13802
13962
|
// 创建合并的图层
|
|
13803
13963
|
const allDrawElements = [];
|
|
@@ -13984,6 +14144,20 @@ class MapDataProcessor {
|
|
|
13984
14144
|
}
|
|
13985
14145
|
break;
|
|
13986
14146
|
}
|
|
14147
|
+
case 'MOW_GATE': {
|
|
14148
|
+
try {
|
|
14149
|
+
const mapElement = element;
|
|
14150
|
+
const mowGateElement = MowGateDataBuilder.fromMapElement(mapElement, this.mapConfig.doodle);
|
|
14151
|
+
if (mowGateElement)
|
|
14152
|
+
result.push({
|
|
14153
|
+
...mowGateElement,
|
|
14154
|
+
});
|
|
14155
|
+
}
|
|
14156
|
+
catch (error) {
|
|
14157
|
+
console.warn(`Error processing MOW_GATE element:`, element, error);
|
|
14158
|
+
}
|
|
14159
|
+
break;
|
|
14160
|
+
}
|
|
13987
14161
|
default: {
|
|
13988
14162
|
console.warn(`Unknown element type: ${element.type}`, element);
|
|
13989
14163
|
break;
|
|
@@ -14772,7 +14946,7 @@ const useChargingPile = ({ mapData, mapConfig = {}, viewBox, rotation = 0, }) =>
|
|
|
14772
14946
|
}
|
|
14773
14947
|
}
|
|
14774
14948
|
return results;
|
|
14775
|
-
}, [mapData, mapConfig, viewBox?.x, viewBox?.y, rotation, sn]);
|
|
14949
|
+
}, [mapData, mapConfig, viewBox?.x, viewBox?.y, viewBox?.width, viewBox?.height, rotation, sn]);
|
|
14776
14950
|
return items;
|
|
14777
14951
|
};
|
|
14778
14952
|
|
|
@@ -14880,7 +15054,17 @@ const useBoundaryLabels = ({ mapData, pathData, unitType, viewBox, mowPartitionD
|
|
|
14880
15054
|
});
|
|
14881
15055
|
}
|
|
14882
15056
|
return results;
|
|
14883
|
-
}, [
|
|
15057
|
+
}, [
|
|
15058
|
+
mapData,
|
|
15059
|
+
pathData,
|
|
15060
|
+
unitType,
|
|
15061
|
+
viewBox?.x,
|
|
15062
|
+
viewBox?.y,
|
|
15063
|
+
viewBox?.width,
|
|
15064
|
+
viewBox?.height,
|
|
15065
|
+
mowPartitionData,
|
|
15066
|
+
boundaryData,
|
|
15067
|
+
]);
|
|
14884
15068
|
const containerZIndex = 900;
|
|
14885
15069
|
return { items, containerZIndex };
|
|
14886
15070
|
};
|
|
@@ -14977,8 +15161,8 @@ const useAntennaInfo = (data = [], options = {}) => {
|
|
|
14977
15161
|
const items = useMemo(() => {
|
|
14978
15162
|
if (!data || data.length === 0 || !viewBox)
|
|
14979
15163
|
return [];
|
|
14980
|
-
const antenna1 = data.find(a => a.type === 1);
|
|
14981
|
-
const antenna2 = data.find(a => a.type === 2);
|
|
15164
|
+
const antenna1 = data.find((a) => a.type === 1);
|
|
15165
|
+
const antenna2 = data.find((a) => a.type === 2);
|
|
14982
15166
|
const results = [];
|
|
14983
15167
|
// helper to pick image
|
|
14984
15168
|
const getImage = (type, online) => {
|
|
@@ -15052,7 +15236,7 @@ const useAntennaInfo = (data = [], options = {}) => {
|
|
|
15052
15236
|
});
|
|
15053
15237
|
}
|
|
15054
15238
|
return results;
|
|
15055
|
-
}, [data, viewBox?.x, viewBox?.y]);
|
|
15239
|
+
}, [data, viewBox?.x, viewBox?.y, viewBox?.width, viewBox?.height]);
|
|
15056
15240
|
// default stacking order (slightly higher than boundary labels' 900)
|
|
15057
15241
|
const containerZIndex = 950;
|
|
15058
15242
|
return { items, containerZIndex };
|
|
@@ -20470,7 +20654,7 @@ const defaultMapConfig = DEFAULT_STYLES;
|
|
|
20470
20654
|
// 地图渲染器组件
|
|
20471
20655
|
const MowerMapRenderer = forwardRef(({ sn, platform = PlatformType.WEB, edger = false, unitType = UnitsType.Imperial, language = 'en', onlyRead = false, mapConfig,
|
|
20472
20656
|
// pathConfig,
|
|
20473
|
-
modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, onPathLoad, onError, className, style, googleMapInstance: _googleMapInstance, dragMap = false, dragCallbacks, defaultTransform, debug: _debug = false, doodleList = [], editMap = false, unStructMapData, disabledObstacles = false, onHandleEnterRecord, onHandleCompleteRecord, onHandleStopRecord, onHandleDeleteElement, onSaveBoundaryData, onSaveMap, onEditInfoMapChange, onUpdateBoundary, heightOptions, globalHeight, onHandleEvent, onSelectElement, }, ref) => {
|
|
20657
|
+
modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, onPathLoad, onError, className, style, googleMapInstance: _googleMapInstance, dragMap = false, canRotateMap = false, dragCallbacks, defaultTransform, debug: _debug = false, doodleList = [], editMap = false, unStructMapData, disabledObstacles = false, onHandleEnterRecord, onHandleCompleteRecord, onHandleStopRecord, onHandleDeleteElement, onSaveBoundaryData, onSaveMap, onEditInfoMapChange, onUpdateBoundary, heightOptions, globalHeight, onHandleEvent, onSelectElement, }, ref) => {
|
|
20474
20658
|
const [currentError, setCurrentError] = useState(null);
|
|
20475
20659
|
const overlayRef = useRef(null);
|
|
20476
20660
|
// const mapRef = useMap();
|
|
@@ -20961,7 +21145,7 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
|
|
|
20961
21145
|
svgEditMapRef?.current?.adjustSvgSize?.(layout);
|
|
20962
21146
|
setOverlayLayout(layout);
|
|
20963
21147
|
}
|
|
20964
|
-
}, map: mapRef, mapPaneName: 'overlayMouseTarget', bounds: bounds, rotate: drag?.rotation, children: [jsx(MapDrag, { map: mapRef, dragCallbacks: dragCallbacks, onBoundaryLabelsCollapse: () => { }, onTransformChange: handleDragMove, isDragMap: dragMap }), jsx(SvgMapComponent, { editMap: editMap, ref: svgMapRef, rotate: drag.rotation, layout: overlayLayout, mapData: mapJson, pathData: pathJson, modelType: modelType, unitType: unitType, language: "en", mapConfig: mergedMapConfig, antennaConfig: antennaConfig, mowPartitionData: mowPartitionData, defaultTransform: { x: 0, y: 0, rotation: 0 }, onMapLoad: onMapLoad, onPathLoad: onPathLoad, hasEdger: false }), jsx(MowerPosition, { editMap: editMap, mowerPositionData: mowerPositionData, viewBox: svgViewBox || null, modelType: modelType, hasEdger: edger, mapData: mapJson, mapConfig: mergedMapConfig, realTimeData: realTimeData, onMowingPositionChange: onMowingPositionChange }), jsx(CharginPile, { mapData: mapJson, mapConfig: mergedMapConfig, viewBox: svgViewBox || null, rotation: drag?.rotation }), jsx(BoundaryLabels, { editMap: editMap, mapData: mapJson, onlyRead: onlyRead, pathData: pathJson, unitType: unitType, viewBox: svgViewBox || null, rotation: drag?.rotation, mowPartitionData: null, realTimeData: realTimeData }), jsx(Antennas, { editMap: editMap, antennaConfig: antennaConfig || [], layout: overlayLayout || undefined, viewBox: svgViewBox || null, rotation: drag?.rotation, onlyRead: onlyRead }), jsx(SvgEditMap, { editMap: editMap, ref: svgEditMapRef, mapJson: mapJson, layout: overlayLayout || undefined, mapConfig: mergedMapConfig, onEditInfoMapChange: onEditInfoMapChange })] })] }) }) }));
|
|
21148
|
+
}, map: mapRef, mapPaneName: 'overlayMouseTarget', bounds: bounds, rotate: drag?.rotation, children: [jsx(MapDrag, { map: mapRef, dragCallbacks: dragCallbacks, onBoundaryLabelsCollapse: () => { }, onTransformChange: handleDragMove, isDragMap: dragMap, canRotateMap: canRotateMap }), jsx(SvgMapComponent, { editMap: editMap, ref: svgMapRef, rotate: drag.rotation, layout: overlayLayout, mapData: mapJson, pathData: pathJson, modelType: modelType, unitType: unitType, language: "en", mapConfig: mergedMapConfig, antennaConfig: antennaConfig, mowPartitionData: mowPartitionData, defaultTransform: { x: 0, y: 0, rotation: 0 }, onMapLoad: onMapLoad, onPathLoad: onPathLoad, hasEdger: false }), jsx(MowerPosition, { editMap: editMap, mowerPositionData: mowerPositionData, viewBox: svgViewBox || null, modelType: modelType, hasEdger: edger, mapData: mapJson, mapConfig: mergedMapConfig, realTimeData: realTimeData, onMowingPositionChange: onMowingPositionChange }), jsx(CharginPile, { mapData: mapJson, mapConfig: mergedMapConfig, viewBox: svgViewBox || null, rotation: drag?.rotation }), jsx(BoundaryLabels, { editMap: editMap, mapData: mapJson, onlyRead: onlyRead, pathData: pathJson, unitType: unitType, viewBox: svgViewBox || null, rotation: drag?.rotation, mowPartitionData: null, realTimeData: realTimeData }), jsx(Antennas, { editMap: editMap, antennaConfig: antennaConfig || [], layout: overlayLayout || undefined, viewBox: svgViewBox || null, rotation: drag?.rotation, onlyRead: onlyRead }), jsx(SvgEditMap, { editMap: editMap, ref: svgEditMapRef, mapJson: mapJson, layout: overlayLayout || undefined, mapConfig: mergedMapConfig, onEditInfoMapChange: onEditInfoMapChange })] })] }) }) }));
|
|
20965
21149
|
});
|
|
20966
21150
|
MowerMapRenderer.displayName = 'MowerMapRenderer';
|
|
20967
21151
|
|