@ray-js/robot-map-sdk 0.0.14 → 0.0.15-beta.10

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.
Files changed (69) hide show
  1. package/bin/mcp-server.js +24 -24
  2. package/dist/constant/methods.js +1 -1
  3. package/dist/index.d.ts +101 -2
  4. package/dist/index.rjs.js +1 -1
  5. package/dist-app/assets/{index-BNBxfMSM.js → index-B0VlTAPn.js} +1 -1
  6. package/dist-app/index.html +1 -1
  7. package/dist-docs/404.html +2 -2
  8. package/dist-docs/agents/domain.html +39 -0
  9. package/dist-docs/agents/issue-tracker.html +25 -0
  10. package/dist-docs/agents/triage-labels.html +25 -0
  11. package/dist-docs/assets/agents_domain.md.CYB9yWEy.js +15 -0
  12. package/dist-docs/assets/agents_domain.md.CYB9yWEy.lean.js +1 -0
  13. package/dist-docs/assets/agents_issue-tracker.md.CrjzmXmc.js +1 -0
  14. package/dist-docs/assets/agents_issue-tracker.md.CrjzmXmc.lean.js +1 -0
  15. package/dist-docs/assets/agents_triage-labels.md.BqHb16T-.js +1 -0
  16. package/dist-docs/assets/agents_triage-labels.md.BqHb16T-.lean.js +1 -0
  17. package/dist-docs/assets/{app.DHRGs5Zc.js → app.DOQ_pgoy.js} +1 -1
  18. package/dist-docs/assets/chunks/@localSearchIndexroot.DhVzPFxZ.js +1 -0
  19. package/dist-docs/assets/chunks/{BitmapFont.CcysO3pT.js → BitmapFont.CFFMyW9N.js} +1 -1
  20. package/dist-docs/assets/chunks/{BufferResource.C_MJ8LV7.js → BufferResource.f-LAJCLi.js} +1 -1
  21. package/dist-docs/assets/chunks/{CanvasRenderer.AFx6MHtI.js → CanvasRenderer.BVGQOtO8.js} +1 -1
  22. package/dist-docs/assets/chunks/{RenderTargetSystem.DlyLBS5z.js → RenderTargetSystem.dhtc7aXt.js} +1 -1
  23. package/dist-docs/assets/chunks/{VPLocalSearchBox.DeambLpp.js → VPLocalSearchBox.BX_g8fS3.js} +1 -1
  24. package/dist-docs/assets/chunks/{WebGLRenderer.uIm0oBU6.js → WebGLRenderer.1zuAJlss.js} +1 -1
  25. package/dist-docs/assets/chunks/{WebGPURenderer.KCAyMTek.js → WebGPURenderer.CmwHKv_j.js} +1 -1
  26. package/dist-docs/assets/chunks/{browserAll.5RQbY4cm.js → browserAll.B8AIgImB.js} +1 -1
  27. package/dist-docs/assets/chunks/index.XqZt0iXF.js +744 -0
  28. package/dist-docs/assets/chunks/{theme.DZz2Y3xc.js → theme.BrQ0iun4.js} +3 -3
  29. package/dist-docs/assets/chunks/{webworkerAll.D3-je4ql.js → webworkerAll.BDE--V3_.js} +1 -1
  30. package/dist-docs/assets/{guide_advanced-usage.md.B0nlUHzZ.js → guide_advanced-usage.md.DNWCmYfB.js} +45 -6
  31. package/dist-docs/assets/{guide_advanced-usage.md.B0nlUHzZ.lean.js → guide_advanced-usage.md.DNWCmYfB.lean.js} +1 -1
  32. package/dist-docs/assets/{guide_getting-started.md.BxrBbc12.js → guide_getting-started.md.BuIxcYrc.js} +1 -1
  33. package/dist-docs/assets/{reference_config.md.D3LT2kWa.js → reference_config.md.BrQeM_br.js} +4 -4
  34. package/dist-docs/assets/reference_config.md.BrQeM_br.lean.js +1 -0
  35. package/dist-docs/assets/{reference_data.md.B_XpUFrn.js → reference_data.md.BjBUZrZo.js} +2 -1
  36. package/dist-docs/assets/{reference_data.md.B_XpUFrn.lean.js → reference_data.md.BjBUZrZo.lean.js} +1 -1
  37. package/dist-docs/assets/{reference_methods.md.BvtVJ2dG.js → reference_methods.md.CxMQMj53.js} +9 -3
  38. package/dist-docs/assets/reference_methods.md.CxMQMj53.lean.js +1 -0
  39. package/dist-docs/assets/{reference_types.md.CfnUIfkB.js → reference_types.md.BDKGwrGI.js} +3 -1
  40. package/dist-docs/assets/{reference_types.md.CfnUIfkB.lean.js → reference_types.md.BDKGwrGI.lean.js} +1 -1
  41. package/dist-docs/guide/advanced-usage.html +48 -9
  42. package/dist-docs/guide/concepts.html +3 -3
  43. package/dist-docs/guide/getting-started.html +5 -5
  44. package/dist-docs/guide/mcp.html +3 -3
  45. package/dist-docs/hashmap.json +1 -1
  46. package/dist-docs/index.html +3 -3
  47. package/dist-docs/plans/2026-03-04-detected-objects-visibility-design.html +3 -3
  48. package/dist-docs/plans/2026-03-04-show-detected-objects-implementation-plan.html +3 -3
  49. package/dist-docs/plans/2026-03-10-simulator-debug-design.html +3 -3
  50. package/dist-docs/plans/2026-03-10-simulator-events-console-design.html +3 -3
  51. package/dist-docs/plans/2026-03-10-simulator-events-console-implementation-plan.html +3 -3
  52. package/dist-docs/plans/2026-03-10-simulator-runtime-controls-design.html +3 -3
  53. package/dist-docs/plans/2026-03-10-simulator-runtime-controls-implementation-plan.html +3 -3
  54. package/dist-docs/plans/2026-03-10-testing-rollout-next-steps-plan.html +3 -3
  55. package/dist-docs/plans/2026-03-11-simulator-logger-dump-implementation-plan.html +3 -3
  56. package/dist-docs/reference/callbacks.html +3 -3
  57. package/dist-docs/reference/config.html +7 -7
  58. package/dist-docs/reference/data.html +6 -5
  59. package/dist-docs/reference/methods.html +12 -6
  60. package/dist-docs/reference/runtime.html +3 -3
  61. package/dist-docs/reference/types.html +7 -5
  62. package/dist-docs/reference/utils.html +3 -3
  63. package/dist-docs/simulator/index.html +3 -3
  64. package/package.json +1 -1
  65. package/dist-docs/assets/chunks/@localSearchIndexroot.RPRwAWt3.js +0 -1
  66. package/dist-docs/assets/chunks/index.BLj_eQCu.js +0 -744
  67. package/dist-docs/assets/reference_config.md.D3LT2kWa.lean.js +0 -1
  68. package/dist-docs/assets/reference_methods.md.BvtVJ2dG.lean.js +0 -1
  69. /package/dist-docs/assets/{guide_getting-started.md.BxrBbc12.lean.js → guide_getting-started.md.BuIxcYrc.lean.js} +0 -0
@@ -0,0 +1 @@
1
+ import{_ as e,c as i,o as a,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"配置","description":"","frontmatter":{},"headers":[],"relativePath":"reference/config.md","filePath":"reference/config.md","lastUpdated":1780303939000}'),s={name:"reference/config.md"};function l(n,o,r,c,d,h){return a(),i("div",null,[...o[0]||(o[0]=[t("",1375)])])}const k=e(s,[["render",l]]);export{g as __pageData,k as default};
@@ -1,4 +1,4 @@
1
- import{_ as i,c as a,o as n,aq as h}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"数据","description":"","frontmatter":{},"headers":[],"relativePath":"reference/data.md","filePath":"reference/data.md","lastUpdated":1773043511000}'),p={name:"reference/data.md"};function l(t,s,k,e,E,r){return n(),a("div",null,[...s[0]||(s[0]=[h(`<h1 id="数据" tabindex="-1">数据 <a class="header-anchor" href="#数据" aria-label="Permalink to &quot;数据&quot;">​</a></h1><p>了解 RobotMap 支持的各种数据类型和格式。</p><h2 id="map" tabindex="-1">map <a class="header-anchor" href="#map" aria-label="Permalink to &quot;map&quot;">​</a></h2><p>地图栅格数据,通常为编码后的字符串格式。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span></span>
1
+ import{_ as i,c as a,o as n,aq as h}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"数据","description":"","frontmatter":{},"headers":[],"relativePath":"reference/data.md","filePath":"reference/data.md","lastUpdated":1779971049000}'),p={name:"reference/data.md"};function l(t,s,k,e,E,r){return n(),a("div",null,[...s[0]||(s[0]=[h(`<h1 id="数据" tabindex="-1">数据 <a class="header-anchor" href="#数据" aria-label="Permalink to &quot;数据&quot;">​</a></h1><p>了解 RobotMap 支持的各种数据类型和格式。</p><h2 id="map" tabindex="-1">map <a class="header-anchor" href="#map" aria-label="Permalink to &quot;map&quot;">​</a></h2><p>地图栅格数据,通常为编码后的字符串格式。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span></span>
2
2
  <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> map</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&lt;原始地图数据字符串&gt;&quot;</span></span>
3
3
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ... 其他属性</span></span>
4
4
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/&gt;</span></span></code></pre></div><p><strong>类型</strong>: <code>string</code></p><p><strong>说明</strong>:</p><ul><li>包含地图尺寸、分辨率、原点等基础信息。</li><li>包含障碍物、房间、地毯等图形数据。</li><li>通常是来源于p2p通道获取的数据,无需做任何处理,直接传入即可。</li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>目前地图数据协议分为两种,一种是点阵协议,一种是结构化协议。</p><p><code>map</code> 已经兼容支持两种协议,你只需要传入原始数据字符串即可。</p></div><h2 id="path" tabindex="-1">path <a class="header-anchor" href="#path" aria-label="Permalink to &quot;path&quot;">​</a></h2><p>机器人路径数据,包含清扫轨迹和当前位置。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span></span>
@@ -95,6 +95,7 @@ import{_ as i,c as a,o as n,aq as h}from"./chunks/framework.CBLqO2Q1.js";const g
95
95
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> virtualWalls</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{virtualWalls} /&gt;</span></span></code></pre></div><p><strong>类型</strong>: <a href="/reference/types.html#virtualwallparam"><code>VirtualWallParam[]</code></a></p><h2 id="spots" tabindex="-1">spots <a class="header-anchor" href="#spots" aria-label="Permalink to &quot;spots&quot;">​</a></h2><p>定点清洁数据,定义需要定点清洁的位置。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> spots</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> SpotParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span></span>
96
96
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
97
97
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> id: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;spot1&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
98
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> name: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;主卧床边&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
98
99
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> point: { x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">120</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">80</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
99
100
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
100
101
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
@@ -1 +1 @@
1
- import{_ as i,c as a,o as n,aq as h}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"数据","description":"","frontmatter":{},"headers":[],"relativePath":"reference/data.md","filePath":"reference/data.md","lastUpdated":1773043511000}'),p={name:"reference/data.md"};function l(t,s,k,e,E,r){return n(),a("div",null,[...s[0]||(s[0]=[h("",69)])])}const y=i(p,[["render",l]]);export{g as __pageData,y as default};
1
+ import{_ as i,c as a,o as n,aq as h}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"数据","description":"","frontmatter":{},"headers":[],"relativePath":"reference/data.md","filePath":"reference/data.md","lastUpdated":1779971049000}'),p={name:"reference/data.md"};function l(t,s,k,e,E,r){return n(),a("div",null,[...s[0]||(s[0]=[h("",69)])])}const y=i(p,[["render",l]]);export{g as __pageData,y as default};
@@ -1,4 +1,4 @@
1
- import{_ as i,c as a,o as n,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"地图方法","description":"","frontmatter":{},"headers":[],"relativePath":"reference/methods.md","filePath":"reference/methods.md","lastUpdated":1773644264000}'),p={name:"reference/methods.md"};function e(h,s,l,k,r,d){return n(),a("div",null,[...s[0]||(s[0]=[t(`<h1 id="地图方法" tabindex="-1">地图方法 <a class="header-anchor" href="#地图方法" aria-label="Permalink to &quot;地图方法&quot;">​</a></h1><p>了解 RobotMap 提供的 API 方法。</p><h2 id="使用示例" tabindex="-1">使用示例 <a class="header-anchor" href="#使用示例" aria-label="Permalink to &quot;使用示例&quot;">​</a></h2><p>通过 <code>onMapReady</code> 回调获得 <code>MapApi</code> 实例,该实例包含所有可调用的地图方法。这些方法让你可以主动控制地图行为、查询数据和执行各种操作。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { MapApi } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;@ray-js/robot-map&#39;</span></span>
1
+ import{_ as i,c as a,o as n,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"地图方法","description":"","frontmatter":{},"headers":[],"relativePath":"reference/methods.md","filePath":"reference/methods.md","lastUpdated":1779070238000}'),e={name:"reference/methods.md"};function p(h,s,l,k,r,d){return n(),a("div",null,[...s[0]||(s[0]=[t(`<h1 id="地图方法" tabindex="-1">地图方法 <a class="header-anchor" href="#地图方法" aria-label="Permalink to &quot;地图方法&quot;">​</a></h1><p>了解 RobotMap 提供的 API 方法。</p><h2 id="使用示例" tabindex="-1">使用示例 <a class="header-anchor" href="#使用示例" aria-label="Permalink to &quot;使用示例&quot;">​</a></h2><p>通过 <code>onMapReady</code> 回调获得 <code>MapApi</code> 实例,该实例包含所有可调用的地图方法。这些方法让你可以主动控制地图行为、查询数据和执行各种操作。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { MapApi } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;@ray-js/robot-map&#39;</span></span>
2
2
  <span class="line"></span>
3
3
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MapPage</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
4
4
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> mapApi</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> useRef</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">MapApi</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
@@ -62,7 +62,12 @@ import{_ as i,c as a,o as n,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g
62
62
  <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> furnitureType</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
63
63
  <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetX</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
64
64
  <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetY</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
65
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">Point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]&gt;</span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>options</code> - 配置选项</li><li><code>options.furnitureType</code>: <code>number</code> - 家具类型编号,匹配 <code>config.furniture.assets</code> 中的 <code>type</code>。默认使用第一个素材的类型</li><li><code>options.offsetX</code>: <code>number</code> - X方向像素偏移,支持负数,默认为 0</li><li><code>options.offsetY</code>: <code>number</code> - Y方向像素偏移,支持负数,默认为 0</li></ul><p><strong>返回值</strong>: <a href="/reference/types.html#point"><code>Promise&lt;Point[]&gt;</code></a></p><h2 id="getfurnitures" tabindex="-1">getFurnitures() <a class="header-anchor" href="#getfurnitures" aria-label="Permalink to &quot;getFurnitures()&quot;">​</a></h2><p>获取当前地图上所有家具数据。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> getFurnitures</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">FurnitureParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]&gt;</span></span></code></pre></div><p><strong>返回值</strong>: <a href="/reference/types.html#furnitureparam"><code>Promise&lt;FurnitureParam[]&gt;</code></a></p><h2 id="getspotpointbyviewportcenter" tabindex="-1">getSpotPointByViewportCenter() <a class="header-anchor" href="#getspotpointbyviewportcenter" aria-label="Permalink to &quot;getSpotPointByViewportCenter()&quot;">​</a></h2><p>基于视口中心生成定点清扫的点坐标。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> getSpotPointByViewportCenter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
65
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">Point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]&gt;</span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>options</code> - 配置选项</li><li><code>options.furnitureType</code>: <code>number</code> - 家具类型编号,匹配 <code>config.furniture.assets</code> 中的 <code>type</code>。默认使用第一个素材的类型</li><li><code>options.offsetX</code>: <code>number</code> - X方向像素偏移,支持负数,默认为 0</li><li><code>options.offsetY</code>: <code>number</code> - Y方向像素偏移,支持负数,默认为 0</li></ul><p><strong>返回值</strong>: <a href="/reference/types.html#point"><code>Promise&lt;Point[]&gt;</code></a></p><h2 id="getcustomcarpetpointsbyviewportcenter" tabindex="-1">getCustomCarpetPointsByViewportCenter() <a class="header-anchor" href="#getcustomcarpetpointsbyviewportcenter" aria-label="Permalink to &quot;getCustomCarpetPointsByViewportCenter()&quot;">​</a></h2><p>基于视口中心生成自定义地毯可用的四个顶点坐标。返回的点集既可用于 <code>shape: &#39;rectangle&#39;</code>,也可用于 <code>shape: &#39;round&#39;</code>。默认宽高和尺寸约束 来自 <code>controls.carpet.minSize</code> / <code>controls.carpet.maxSize</code>。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> getCustomCarpetPointsByViewportCenter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
66
+ <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> width</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
67
+ <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> height</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
68
+ <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetX</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
69
+ <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetY</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
70
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]</span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>options</code> - 配置选项</li><li><code>options.width</code>: <code>number</code> - 地毯宽度,单位米。未传且只传了 <code>height</code> 时跟随 <code>height</code></li><li><code>options.height</code>: <code>number</code> - 地毯高度,单位米。未传且只传了 <code>width</code> 时跟随 <code>width</code></li><li><code>options.offsetX</code>: <code>number</code> - X方向像素偏移,支持负数,默认为 <code>0</code></li><li><code>options.offsetY</code>: <code>number</code> - Y方向像素偏移,支持负数,默认为 <code>0</code></li></ul><p><strong>返回值</strong>: <a href="/reference/types.html#point"><code>Point[]</code></a></p><h2 id="getfurnitures" tabindex="-1">getFurnitures() <a class="header-anchor" href="#getfurnitures" aria-label="Permalink to &quot;getFurnitures()&quot;">​</a></h2><p>获取当前地图上所有家具数据。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> getFurnitures</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">FurnitureParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]&gt;</span></span></code></pre></div><p><strong>返回值</strong>: <a href="/reference/types.html#furnitureparam"><code>Promise&lt;FurnitureParam[]&gt;</code></a></p><h2 id="getspotpointbyviewportcenter" tabindex="-1">getSpotPointByViewportCenter() <a class="header-anchor" href="#getspotpointbyviewportcenter" aria-label="Permalink to &quot;getSpotPointByViewportCenter()&quot;">​</a></h2><p>基于视口中心生成定点清扫的点坐标。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> getSpotPointByViewportCenter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
66
71
  <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetX</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
67
72
  <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetY</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
68
73
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">Point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>options</code> - 配置选项</li><li><code>options.size</code>: <code>number</code> - 区域大小,单位米,默认使用配置中的最小尺寸</li><li><code>options.offsetX</code>: <code>number</code> - X方向像素偏移,支持负数,默认为 0</li><li><code>options.offsetY</code>: <code>number</code> - Y方向像素偏移,支持负数,默认为 0</li></ul><p><strong>返回值</strong>: <a href="/reference/types.html#point"><code>Promise&lt;Point[]&gt;</code></a></p><h2 id="isnearchargerorrobot" tabindex="-1">isNearChargerOrRobot() <a class="header-anchor" href="#isnearchargerorrobot" aria-label="Permalink to &quot;isNearChargerOrRobot()&quot;">​</a></h2><p>判断一个点、墙体或区域是否与充电桩或机器人距离小于阈值。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> isNearChargerOrRobot</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span></span>
@@ -176,7 +181,8 @@ import{_ as i,c as a,o as n,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g
176
181
  <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> virtualWalls</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> VirtualWallParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]</span></span>
177
182
  <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> detectedObjects</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> DetectedObjectParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]</span></span>
178
183
  <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> furnitures</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> FurnitureParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]</span></span>
184
+ <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> carpets</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> CustomCarpetParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]</span></span>
179
185
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
180
186
  <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> runtime</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> DeepPartialRuntimeConfig</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
181
187
  <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">backgroundColor</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ColorSource</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
182
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>data</code> - 地图数据对象</li><li><code>data.map</code>: <code>string</code> - 地图字符串数据 (支持结构化协议和栅格协议)</li><li><code>data.path</code>: <code>string</code> - 可选的路径数据</li><li><code>data.roomProperties</code>: <code>RoomProperty[]</code> - 可选的房间属性数据</li><li><code>data.customElements</code>: <code>CustomElementParam[]</code> - 可选的自定义元素数据</li><li><code>data.forbiddenSweepZones</code>: <code>ZoneParam[]</code> - 可选的禁扫区域数据</li><li><code>data.forbiddenMopZones</code>: <code>ZoneParam[]</code> - 可选的禁拖区域数据</li><li><code>data.virtualWalls</code>: <code>VirtualWallParam[]</code> - 可选的虚拟墙数据</li><li><code>data.detectedObjects</code>: <code>DetectedObjectParam[]</code> - 可选的检测物体数据</li><li><code>data.furnitures</code>: <a href="/reference/types.html#furnitureparam"><code>FurnitureParam[]</code></a> - 可选的家具数据</li><li><code>runtime</code> - 可选的运行时配置 (DeepPartialRuntimeConfig)</li><li><code>options</code> - 截图配置选项</li><li><code>options.backgroundColor</code>: <code>ColorSource</code> - 指定生成截图时的背景颜色。若不指定,将默认使用 <code>config.global.backgroundColor</code>。</li></ul><p><strong>返回值</strong>: <a href="/reference/types.html#string"><code>Promise&lt;string&gt;</code></a> - Base64 格式的图片数据 (Data URL)。</p><h2 id="forceendgesture" tabindex="-1">forceEndGesture() <a class="header-anchor" href="#forceendgesture" aria-label="Permalink to &quot;forceEndGesture()&quot;">​</a></h2><p>强制结束当前正在进行的手势交互。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> forceEndGesture</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">void</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span></code></pre></div><p><strong>返回值</strong>: <code>Promise&lt;void&gt;</code></p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>该方法主要用于解决小程序异层渲染导致的 <code>touchend</code> 事件丢失问题。如果小程序侧通过原生手势监听到松手,但 SDK 由于层级劫持未收到事件,可调用此方法手动终止 SDK 内部的手势状态。这会触发当前的控制元素(如禁区)执行最终的位置更新并抛出 <code>onUpdateXxx</code> 回调。</p></div>`,214)])])}const E=i(p,[["render",e]]);export{g as __pageData,E as default};
188
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>data</code> - 地图数据对象</li><li><code>data.map</code>: <code>string</code> - 地图字符串数据 (支持结构化协议和栅格协议)</li><li><code>data.path</code>: <code>string</code> - 可选的路径数据</li><li><code>data.roomProperties</code>: <code>RoomProperty[]</code> - 可选的房间属性数据</li><li><code>data.customElements</code>: <code>CustomElementParam[]</code> - 可选的自定义元素数据</li><li><code>data.forbiddenSweepZones</code>: <code>ZoneParam[]</code> - 可选的禁扫区域数据</li><li><code>data.forbiddenMopZones</code>: <code>ZoneParam[]</code> - 可选的禁拖区域数据</li><li><code>data.virtualWalls</code>: <code>VirtualWallParam[]</code> - 可选的虚拟墙数据</li><li><code>data.detectedObjects</code>: <code>DetectedObjectParam[]</code> - 可选的检测物体数据</li><li><code>data.furnitures</code>: <a href="/reference/types.html#furnitureparam"><code>FurnitureParam[]</code></a> - 可选的家具数据</li><li><code>data.carpets</code>: <a href="/reference/types.html#customcarpetparam"><code>CustomCarpetParam[]</code></a> - 可选的自定义地毯数据</li><li><code>runtime</code> - 可选的运行时配置 (DeepPartialRuntimeConfig)</li><li><code>options</code> - 截图配置选项</li><li><code>options.backgroundColor</code>: <code>ColorSource</code> - 指定生成截图时的背景颜色。若不指定,将默认使用 <code>config.global.backgroundColor</code>。</li></ul><p><strong>返回值</strong>: <a href="/reference/types.html#string"><code>Promise&lt;string&gt;</code></a> - Base64 格式的图片数据 (Data URL)。</p><h2 id="forceendgesture" tabindex="-1">forceEndGesture() <a class="header-anchor" href="#forceendgesture" aria-label="Permalink to &quot;forceEndGesture()&quot;">​</a></h2><p>强制结束当前正在进行的手势交互。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> forceEndGesture</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">void</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span></code></pre></div><p><strong>返回值</strong>: <code>Promise&lt;void&gt;</code></p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>该方法主要用于解决小程序异层渲染导致的 <code>touchend</code> 事件丢失问题。如果小程序侧通过原生手势监听到松手,但 SDK 由于层级劫持未收到事件,可调用此方法手动终止 SDK 内部的手势状态。这会触发当前的控制元素(如禁区)执行最终的位置更新并抛出 <code>onUpdateXxx</code> 回调。</p></div>`,221)])])}const E=i(e,[["render",p]]);export{g as __pageData,E as default};
@@ -0,0 +1 @@
1
+ import{_ as i,c as a,o as n,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"地图方法","description":"","frontmatter":{},"headers":[],"relativePath":"reference/methods.md","filePath":"reference/methods.md","lastUpdated":1779070238000}'),e={name:"reference/methods.md"};function p(h,s,l,k,r,d){return n(),a("div",null,[...s[0]||(s[0]=[t("",221)])])}const E=i(e,[["render",p]]);export{g as __pageData,E as default};
@@ -1,4 +1,4 @@
1
- import{_ as i,c as a,o as n,aq as p}from"./chunks/framework.CBLqO2Q1.js";const y=JSON.parse('{"title":"类型定义","description":"","frontmatter":{},"headers":[],"relativePath":"reference/types.md","filePath":"reference/types.md","lastUpdated":1777535786000}'),h={name:"reference/types.md"};function l(t,s,k,e,r,d){return n(),a("div",null,[...s[0]||(s[0]=[p(`<h1 id="类型定义" tabindex="-1">类型定义 <a class="header-anchor" href="#类型定义" aria-label="Permalink to &quot;类型定义&quot;">​</a></h1><p>了解 RobotMap 支持的各种数据类型和格式。</p><h2 id="point" tabindex="-1">Point <a class="header-anchor" href="#point" aria-label="Permalink to &quot;Point {#point}&quot;">​</a></h2><p>坐标点类型。</p><div class="language-typescript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Point</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
1
+ import{_ as i,c as a,o as n,aq as p}from"./chunks/framework.CBLqO2Q1.js";const y=JSON.parse('{"title":"类型定义","description":"","frontmatter":{},"headers":[],"relativePath":"reference/types.md","filePath":"reference/types.md","lastUpdated":1779971049000}'),h={name:"reference/types.md"};function l(t,s,k,e,r,d){return n(),a("div",null,[...s[0]||(s[0]=[p(`<h1 id="类型定义" tabindex="-1">类型定义 <a class="header-anchor" href="#类型定义" aria-label="Permalink to &quot;类型定义&quot;">​</a></h1><p>了解 RobotMap 支持的各种数据类型和格式。</p><h2 id="point" tabindex="-1">Point <a class="header-anchor" href="#point" aria-label="Permalink to &quot;Point {#point}&quot;">​</a></h2><p>坐标点类型。</p><div class="language-typescript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Point</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
2
2
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** X坐标 */</span></span>
3
3
  <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> x</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
4
4
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** Y坐标 */</span></span>
@@ -91,6 +91,8 @@ import{_ as i,c as a,o as n,aq as p}from"./chunks/framework.CBLqO2Q1.js";const y
91
91
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="spotparam" tabindex="-1">SpotParam <a class="header-anchor" href="#spotparam" aria-label="Permalink to &quot;SpotParam {#spotparam}&quot;">​</a></h2><p>定点清扫参数类型。</p><div class="language-typescript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> SpotParam</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
92
92
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 定点清洁ID */</span></span>
93
93
  <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> id</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> string</span></span>
94
+ <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 定点清洁名称;name?.trim() 非空时可通过 controls.spot.nameLabel 显示,展示文本为 trim 后的值 */</span></span>
95
+ <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> name</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> string</span></span>
94
96
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 点坐标 */</span></span>
95
97
  <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> point</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Point</span></span>
96
98
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="waypointparam" tabindex="-1">WayPointParam <a class="header-anchor" href="#waypointparam" aria-label="Permalink to &quot;WayPointParam {#waypointparam}&quot;">​</a></h2><p>途径点参数类型。</p><div class="language-typescript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> WayPointParam</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
@@ -1 +1 @@
1
- import{_ as i,c as a,o as n,aq as p}from"./chunks/framework.CBLqO2Q1.js";const y=JSON.parse('{"title":"类型定义","description":"","frontmatter":{},"headers":[],"relativePath":"reference/types.md","filePath":"reference/types.md","lastUpdated":1777535786000}'),h={name:"reference/types.md"};function l(t,s,k,e,r,d){return n(),a("div",null,[...s[0]||(s[0]=[p("",65)])])}const F=i(h,[["render",l]]);export{y as __pageData,F as default};
1
+ import{_ as i,c as a,o as n,aq as p}from"./chunks/framework.CBLqO2Q1.js";const y=JSON.parse('{"title":"类型定义","description":"","frontmatter":{},"headers":[],"relativePath":"reference/types.md","filePath":"reference/types.md","lastUpdated":1779971049000}'),h={name:"reference/types.md"};function l(t,s,k,e,r,d){return n(),a("div",null,[...s[0]||(s[0]=[p("",65)])])}const F=i(h,[["render",l]]);export{y as __pageData,F as default};
@@ -9,11 +9,11 @@
9
9
  <link rel="preload stylesheet" href="/assets/style.hiWmcVfN.css" as="style">
10
10
  <link rel="preload stylesheet" href="/vp-icons.css" as="style">
11
11
 
12
- <script type="module" src="/assets/app.DHRGs5Zc.js"></script>
12
+ <script type="module" src="/assets/app.DOQ_pgoy.js"></script>
13
13
  <link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
14
- <link rel="modulepreload" href="/assets/chunks/theme.DZz2Y3xc.js">
14
+ <link rel="modulepreload" href="/assets/chunks/theme.BrQ0iun4.js">
15
15
  <link rel="modulepreload" href="/assets/chunks/framework.CBLqO2Q1.js">
16
- <link rel="modulepreload" href="/assets/guide_advanced-usage.md.B0nlUHzZ.lean.js">
16
+ <link rel="modulepreload" href="/assets/guide_advanced-usage.md.DNWCmYfB.lean.js">
17
17
  <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
18
18
  <script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
19
19
  </head>
@@ -438,13 +438,14 @@
438
438
  <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onRemoveCustomZone</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{handleRemoveCustomZone}</span></span>
439
439
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /&gt;</span></span>
440
440
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
441
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title">和内置区域的关系</p><p>自定义类型的样式字段和 <code>controls.forbiddenSweepZone</code> 等内置区域一致(<code>strokeColor</code> / <code>fillColor</code> / <code>minSize</code> / <code>maxSize</code> / <code>editing</code> / <code>normal</code> 等),未声明的字段会回退到 SDK 默认值。</p></div><h3 id="定点框" tabindex="-1">定点框 <a class="header-anchor" href="#定点框" aria-label="Permalink to &quot;定点框&quot;">​</a></h3><p>定点框是由一个中心点坐标和固定尺寸参数构成的矩形区域。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> React </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;react&#39;</span></span>
441
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title">和内置区域的关系</p><p>自定义类型的样式字段和 <code>controls.forbiddenSweepZone</code> 等内置区域一致(<code>strokeColor</code> / <code>fillColor</code> / <code>minSize</code> / <code>maxSize</code> / <code>editing</code> / <code>normal</code> 等),未声明的字段会回退到 SDK 默认值。</p></div><h3 id="定点框" tabindex="-1">定点框 <a class="header-anchor" href="#定点框" aria-label="Permalink to &quot;定点框&quot;">​</a></h3><p>定点框是由一个中心点坐标和固定尺寸参数构成的矩形区域。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> React, { useState } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;react&#39;</span></span>
442
442
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { RobotMap, SpotParam } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;@ray-js/robot-map&#39;</span></span>
443
443
  <span class="line"></span>
444
444
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MapPage</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> () </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=&gt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
445
445
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">spots</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">setSpots</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> useState</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">SpotParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]&gt;([</span></span>
446
446
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
447
447
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> id: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;spot&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
448
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> name: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;主卧床边&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
448
449
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> point: { x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
449
450
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
450
451
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ])</span></span>
@@ -471,6 +472,16 @@
471
472
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> strokeColor: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;#5d68fe&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
472
473
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> strokeWidth: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
473
474
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> fillColor: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;rgba(93, 104, 254, 0.1)&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
475
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> nameLabel: {</span></span>
476
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> fontSize: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">12</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
477
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> fontFamily: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;Arial&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
478
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> fontWeight: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;500&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
479
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> color: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;#5d68fe&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
480
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> position: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;top&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
481
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> offset: </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">8</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
482
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> editing: { visible: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
483
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> normal: { visible: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
484
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
474
485
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
475
486
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
476
487
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }}</span></span>
@@ -544,7 +555,19 @@
544
555
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">Button</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onClick</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{handleAddVirtualWall}&gt;新增虚拟墙&lt;/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">Button</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
545
556
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">View</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
546
557
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
547
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="房间信息" tabindex="-1">房间信息 <a class="header-anchor" href="#房间信息" aria-label="Permalink to &quot;房间信息&quot;">​</a></h2><h3 id="数据处理" tabindex="-1">数据处理 <a class="header-anchor" href="#数据处理" aria-label="Permalink to &quot;数据处理&quot;">​</a></h3><p>房间信息的展示完全受控于你传入的 <code>roomProperties</code> 数据。</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 房间属性类型</span></span>
558
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h3 id="基于任意中心点生成矩形顶点" tabindex="-1">基于任意中心点生成矩形顶点 <a class="header-anchor" href="#基于任意中心点生成矩形顶点" aria-label="Permalink to &quot;基于任意中心点生成矩形顶点&quot;">​</a></h3><p>除了 <code>*ByViewportCenter</code> 家族默认使用视口中心外,SDK 还提供通用方法 <code>getRectPointsByCenter</code>:调用方显式传入中心点,返回矩形的四个顶点坐标。适用于围绕机器人当前位置、已保存的锚点、或回放数据中的坐标来生成禁扫区域、清扫划区、自定义区域等。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> robot</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> mapApi.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">snapshot</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">().robot</span></span>
559
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> points</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> mapApi.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">getRectPointsByCenter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
560
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> center: { x: robot.x, y: robot.y }, </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 机器人位置,地图坐标系</span></span>
561
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> width: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 米</span></span>
562
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> height: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1.5</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 米</span></span>
563
+ <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // applyMapRotation 默认 true,矩形在屏幕上视觉保持正放;</span></span>
564
+ <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 如果你只需要地图坐标系下的轴对齐矩形,传 false。</span></span>
565
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span>
566
+ <span class="line"></span>
567
+ <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">setCustomZones</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">([</span></span>
568
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">customZones,</span></span>
569
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { id: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;newZone&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, type: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;custom&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, points },</span></span>
570
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">])</span></span></code></pre></div><h2 id="房间信息" tabindex="-1">房间信息 <a class="header-anchor" href="#房间信息" aria-label="Permalink to &quot;房间信息&quot;">​</a></h2><h3 id="数据处理" tabindex="-1">数据处理 <a class="header-anchor" href="#数据处理" aria-label="Permalink to &quot;数据处理&quot;">​</a></h3><p>房间信息的展示完全受控于你传入的 <code>roomProperties</code> 数据。</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 房间属性类型</span></span>
548
571
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> RoomProperty</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
549
572
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 房间唯一标识符 */</span></span>
550
573
  <span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> id</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
@@ -941,7 +964,23 @@
941
964
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ... 其他属性</span></span>
942
965
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /&gt;</span></span>
943
966
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
944
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h3 id="编辑地毯" tabindex="-1">编辑地毯 <a class="header-anchor" href="#编辑地毯" aria-label="Permalink to &quot;编辑地毯&quot;">​</a></h3><p>通过 <code>runtime.editingCarpetIds</code> 控制哪些地毯处于编辑状态。编辑模式下,地毯会显示删除、旋转和缩放控制按钮,用户可以通过手势进行拖拽移动。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MapPage</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> () </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=&gt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
967
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h3 id="在视口中心创建地毯" tabindex="-1">在视口中心创建地毯 <a class="header-anchor" href="#在视口中心创建地毯" aria-label="Permalink to &quot;在视口中心创建地毯&quot;">​</a></h3><p>你可以通过 <code>getCustomCarpetPointsByViewportCenter()</code> 生成一组四点坐标, 再由业务层自己补 <code>id</code>、<code>type</code> 和 <code>shape</code>。同一组 <code>points</code> 既可以用于 矩形地毯,也可以用于圆形或椭圆形地毯。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> handleAddCarpet</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">shape</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;rectangle&#39;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;round&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=&gt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
968
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> points</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> mapApi.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">getCustomCarpetPointsByViewportCenter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
969
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> width: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
970
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> height: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1.2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
971
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> offsetX: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">20</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
972
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
973
+ <span class="line"></span>
974
+ <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> setCustomCarpets</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">((</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">prev</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=&gt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span></span>
975
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">prev,</span></span>
976
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
977
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> id: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">`carpet-${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">prev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">length</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> +</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}`</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
978
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> type: selectedMaterialType,</span></span>
979
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> shape,</span></span>
980
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> points,</span></span>
981
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
982
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ])</span></span>
983
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p><code>shape: &#39;custom&#39;</code> 仍然需要业务层自行提供多边形顶点,这个 helper 不会 生成自定义轮廓。</p><h3 id="编辑地毯" tabindex="-1">编辑地毯 <a class="header-anchor" href="#编辑地毯" aria-label="Permalink to &quot;编辑地毯&quot;">​</a></h3><p>通过 <code>runtime.editingCarpetIds</code> 控制哪些地毯处于编辑状态。编辑模式下,地毯会显示删除、旋转和缩放控制按钮,用户可以通过手势进行拖拽移动。<code>controls.carpet.rotateMode</code> 用于切换点击旋转 90 度和按住拖动连续旋转;<code>controls.carpet.scaleMode</code> 用于切换自由缩放和等比缩放。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MapPage</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> () </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=&gt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
945
984
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">customCarpets</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">setCustomCarpets</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> useState</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">CustomCarpetParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]&gt;([</span></span>
946
985
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ...</span></span>
947
986
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ])</span></span>
@@ -992,7 +1031,7 @@
992
1031
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { id: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;c1&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, type: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, shape: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;rectangle&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, points: [</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">] },</span></span>
993
1032
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { id: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;c2&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, type: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, shape: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;round&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, points: [</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">] },</span></span>
994
1033
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ]}</span></span>
995
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/&gt;</span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li><code>rectangle</code> 和 <code>round</code> 形状支持旋转和缩放;<code>custom</code>(自定义多边形)仅支持拖拽移动。</li><li>地毯尺寸由 <a href="/reference/config.html#controls-carpet-minsize"><code>controls.carpet.minSize</code></a>(默认 1 米)和可选的 <a href="/reference/config.html#controls-carpet-maxsize"><code>controls.carpet.maxSize</code></a>(默认不限制)控制。</li><li>编辑模式需要同时设置 <code>config.carpet.enableEdit: true</code> 和 <code>runtime.editingCarpetIds</code>。</li></ul></div><h3 id="相关配置" tabindex="-1">相关配置 <a class="header-anchor" href="#相关配置" aria-label="Permalink to &quot;相关配置&quot;">​</a></h3><table tabindex="0"><thead><tr><th>配置</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td><a href="/reference/config.html#carpet-src"><code>carpet.src</code></a></td><td>内置资源</td><td>默认地毯贴图</td></tr><tr><td><a href="/reference/config.html#carpet-opacity"><code>carpet.opacity</code></a></td><td><code>0.5</code></td><td>贴图透明度</td></tr><tr><td><a href="/reference/config.html#carpet-scale"><code>carpet.scale</code></a></td><td><code>0.2</code></td><td>贴图缩放比例</td></tr><tr><td><a href="/reference/config.html#carpet-material"><code>carpet.material</code></a></td><td>-</td><td>按类型配置不同贴图素材</td></tr><tr><td><a href="/reference/config.html#carpet-enableedit"><code>carpet.enableEdit</code></a></td><td><code>false</code></td><td>是否启用编辑功能</td></tr><tr><td><a href="/reference/config.html#controls-carpet-minsize"><code>controls.carpet.minSize</code></a></td><td><code>1</code></td><td>最小尺寸(米)</td></tr><tr><td><a href="/reference/config.html#controls-carpet-maxsize"><code>controls.carpet.maxSize</code></a></td><td><code>undefined</code></td><td>最大尺寸(米,可选)</td></tr><tr><td><a href="/reference/config.html#controls-carpet-fillcolor"><code>controls.carpet.fillColor</code></a></td><td><code>rgba(93,104,254,0.1)</code></td><td>编辑区域填充色</td></tr><tr><td><a href="/reference/config.html#controls-carpet-strokecolor"><code>controls.carpet.strokeColor</code></a></td><td><code>#5d68fe</code></td><td>编辑区域边框色</td></tr></tbody></table><h2 id="自定义元素" tabindex="-1">自定义元素 <a class="header-anchor" href="#自定义元素" aria-label="Permalink to &quot;自定义元素&quot;">​</a></h2><p>你可以在地图上显示自定义的元素,它们完全受控于 <code>customElements</code> 中的数据。</p><p>目前支持自定义的元素有:</p><ul><li>图片</li><li>GIF</li><li>HTML</li></ul><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> React </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;react&#39;</span></span>
1034
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/&gt;</span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li><code>rectangle</code> 和 <code>round</code> 形状支持旋转和缩放;<code>custom</code>(自定义多边形)仅显示删除按钮,旋转、缩放、移动和辅助缩放按钮都会隐藏。</li><li>地毯尺寸由 <a href="/reference/config.html#controls-carpet-minsize"><code>controls.carpet.minSize</code></a>(默认 1 米)和可选的 <a href="/reference/config.html#controls-carpet-maxsize"><code>controls.carpet.maxSize</code></a>(默认不限制)控制。</li><li>编辑模式需要同时设置 <code>config.carpet.enableEdit: true</code> 和 <code>runtime.editingCarpetIds</code>。</li><li><a href="/reference/config.html#controls-carpet-rotatemode"><code>controls.carpet.rotateMode</code></a> 默认为 <code>step</code>;设置为 <code>free</code> 后,旋转按钮改为按住拖动连续旋转。</li><li><a href="/reference/config.html#controls-carpet-scalemode"><code>controls.carpet.scaleMode</code></a> 默认为 <code>ratioLocked</code>;设置为 <code>free</code> 后,右下角按钮改为自由缩放,并隐藏横向、纵向辅助缩放按钮。</li></ul></div><h3 id="相关配置" tabindex="-1">相关配置 <a class="header-anchor" href="#相关配置" aria-label="Permalink to &quot;相关配置&quot;">​</a></h3><table tabindex="0"><thead><tr><th>配置</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td><a href="/reference/config.html#carpet-src"><code>carpet.src</code></a></td><td>内置资源</td><td>默认地毯贴图</td></tr><tr><td><a href="/reference/config.html#carpet-opacity"><code>carpet.opacity</code></a></td><td><code>0.5</code></td><td>贴图透明度</td></tr><tr><td><a href="/reference/config.html#carpet-scale"><code>carpet.scale</code></a></td><td><code>0.2</code></td><td>贴图缩放比例</td></tr><tr><td><a href="/reference/config.html#carpet-material"><code>carpet.material</code></a></td><td>-</td><td>按类型配置不同贴图素材</td></tr><tr><td><a href="/reference/config.html#carpet-enableedit"><code>carpet.enableEdit</code></a></td><td><code>false</code></td><td>是否启用编辑功能</td></tr><tr><td><a href="/reference/config.html#controls-carpet-minsize"><code>controls.carpet.minSize</code></a></td><td><code>1</code></td><td>最小尺寸(米)</td></tr><tr><td><a href="/reference/config.html#controls-carpet-maxsize"><code>controls.carpet.maxSize</code></a></td><td><code>undefined</code></td><td>最大尺寸(米,可选)</td></tr><tr><td><a href="/reference/config.html#controls-carpet-iconwrapperfillcolor"><code>controls.carpet.iconWrapperFillColor</code></a></td><td><code>&#39;#5d68fe&#39;</code></td><td>非删除按钮背景色</td></tr><tr><td><a href="/reference/config.html#controls-carpet-deleteiconwrapperfillcolor"><code>controls.carpet.deleteIconWrapperFillColor</code></a></td><td><code>&#39;#ff4444&#39;</code></td><td>删除按钮背景色</td></tr><tr><td><a href="/reference/config.html#controls-carpet-rotatemode"><code>controls.carpet.rotateMode</code></a></td><td><code>&#39;step&#39;</code></td><td>旋转按钮交互模式</td></tr><tr><td><a href="/reference/config.html#controls-carpet-scalemode"><code>controls.carpet.scaleMode</code></a></td><td><code>&#39;ratioLocked&#39;</code></td><td>右下角缩放按钮交互模式</td></tr><tr><td><a href="/reference/config.html#controls-carpet-fillcolor"><code>controls.carpet.fillColor</code></a></td><td><code>rgba(93,104,254,0.1)</code></td><td>编辑区域填充色</td></tr></tbody></table><h2 id="自定义元素" tabindex="-1">自定义元素 <a class="header-anchor" href="#自定义元素" aria-label="Permalink to &quot;自定义元素&quot;">​</a></h2><p>你可以在地图上显示自定义的元素,它们完全受控于 <code>customElements</code> 中的数据。</p><p>目前支持自定义的元素有:</p><ul><li>图片</li><li>GIF</li><li>HTML</li></ul><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> React </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;react&#39;</span></span>
996
1035
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { RobotMap } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;@ray-js/robot-map&#39;</span></span>
997
1036
  <span class="line"></span>
998
1037
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MapPage</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> () </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=&gt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
@@ -1143,8 +1182,8 @@
1143
1182
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (mapApi) {</span></span>
1144
1183
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> mapApi.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">forceEndGesture</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span></span>
1145
1184
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
1146
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title">提示</p><p>地图 SDK 内部已针对双指缩放时的快速松手做了防抖缓冲处理,搭配上述方案可获得最佳手势体验。</p></div></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><!----><div class="last-updated" data-v-e257564d><p class="VPLastUpdated" data-v-e257564d data-v-e98dd255>最后更新于: <time datetime="2026-04-30T07:56:26.000Z" data-v-e98dd255></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><a class="VPLink link pager-link prev" href="/guide/getting-started.html" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>Previous page</span><span class="title" data-v-e257564d>快速开始</span><!--]--></a></div><div class="pager" data-v-e257564d><!----></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
1147
- <script>window.__VP_HASH_MAP__=JSON.parse("{\"guide_advanced-usage.md\":\"B0nlUHzZ\",\"guide_concepts.md\":\"CJ87tk-r\",\"guide_getting-started.md\":\"BxrBbc12\",\"guide_mcp.md\":\"CabCiX8Z\",\"index.md\":\"wTsFvv0N\",\"plans_2026-03-04-detected-objects-visibility-design.md\":\"Dqboot5W\",\"plans_2026-03-04-show-detected-objects-implementation-plan.md\":\"CDWwQtWj\",\"plans_2026-03-10-simulator-debug-design.md\":\"BZibn7uw\",\"plans_2026-03-10-simulator-events-console-design.md\":\"BVmEzCbR\",\"plans_2026-03-10-simulator-events-console-implementation-plan.md\":\"S2f1zs9-\",\"plans_2026-03-10-simulator-runtime-controls-design.md\":\"mqeNaYgg\",\"plans_2026-03-10-simulator-runtime-controls-implementation-plan.md\":\"BXG1UWFt\",\"plans_2026-03-10-testing-rollout-next-steps-plan.md\":\"CGR6uZic\",\"plans_2026-03-11-simulator-logger-dump-implementation-plan.md\":\"Ck5BGdoX\",\"reference_callbacks.md\":\"FoJwSjMy\",\"reference_config.md\":\"D3LT2kWa\",\"reference_data.md\":\"B_XpUFrn\",\"reference_methods.md\":\"BvtVJ2dG\",\"reference_runtime.md\":\"BBP2J_yR\",\"reference_types.md\":\"CfnUIfkB\",\"reference_utils.md\":\"Dy6XKVWh\",\"simulator_index.md\":\"CF95Y_c9\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Tuya Robot Map\",\"description\":\"涂鸦扫地机地图组件\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"siteTitle\":\"Tuya Robot Map\",\"outline\":{\"level\":[2,6],\"label\":\"页面导航\"},\"nav\":[{\"text\":\"首页\",\"link\":\"/\"},{\"text\":\"指南\",\"link\":\"/guide/concepts\",\"activeMatch\":\"^/guide/\"},{\"text\":\"参考\",\"link\":\"/reference/data\",\"activeMatch\":\"^/reference/\"},{\"text\":\"模拟调试\",\"link\":\"/simulator/\",\"activeMatch\":\"^/simulator/\"}],\"sidebar\":{\"/guide/\":[{\"text\":\"指南\",\"items\":[{\"text\":\"基本概念\",\"link\":\"/guide/concepts\"},{\"text\":\"快速开始\",\"link\":\"/guide/getting-started\"},{\"text\":\"进阶使用\",\"link\":\"/guide/advanced-usage\"}]}],\"/reference/\":[{\"text\":\"组件Props\",\"items\":[{\"text\":\"数据\",\"link\":\"/reference/data\"},{\"text\":\"配置\",\"link\":\"/reference/config\"},{\"text\":\"运行时\",\"link\":\"/reference/runtime\"},{\"text\":\"地图事件回调\",\"link\":\"/reference/callbacks\"}]},{\"text\":\"方法\",\"items\":[{\"text\":\"地图方法\",\"link\":\"/reference/methods\"},{\"text\":\"工具方法\",\"link\":\"/reference/utils\"}]},{\"text\":\"类型定义\",\"items\":[{\"text\":\"类型定义\",\"link\":\"/reference/types\"}]}],\"/simulator/\":[{\"text\":\"模拟调试\",\"items\":[{\"text\":\"实时模拟调试\",\"link\":\"/simulator/\"}]}]},\"search\":{\"provider\":\"local\"},\"lastUpdated\":{\"text\":\"最后更新于\",\"formatOptions\":{\"dateStyle\":\"short\",\"timeStyle\":\"short\"}}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
1185
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title">提示</p><p>地图 SDK 内部已针对双指缩放时的快速松手做了防抖缓冲处理,搭配上述方案可获得最佳手势体验。</p></div></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><!----><div class="last-updated" data-v-e257564d><p class="VPLastUpdated" data-v-e257564d data-v-e98dd255>最后更新于: <time datetime="2026-05-29T02:17:54.000Z" data-v-e98dd255></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><a class="VPLink link pager-link prev" href="/guide/getting-started.html" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>Previous page</span><span class="title" data-v-e257564d>快速开始</span><!--]--></a></div><div class="pager" data-v-e257564d><!----></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
1186
+ <script>window.__VP_HASH_MAP__=JSON.parse("{\"agents_domain.md\":\"CYB9yWEy\",\"agents_issue-tracker.md\":\"CrjzmXmc\",\"agents_triage-labels.md\":\"BqHb16T-\",\"guide_advanced-usage.md\":\"DNWCmYfB\",\"guide_concepts.md\":\"CJ87tk-r\",\"guide_getting-started.md\":\"BuIxcYrc\",\"guide_mcp.md\":\"CabCiX8Z\",\"index.md\":\"wTsFvv0N\",\"plans_2026-03-04-detected-objects-visibility-design.md\":\"Dqboot5W\",\"plans_2026-03-04-show-detected-objects-implementation-plan.md\":\"CDWwQtWj\",\"plans_2026-03-10-simulator-debug-design.md\":\"BZibn7uw\",\"plans_2026-03-10-simulator-events-console-design.md\":\"BVmEzCbR\",\"plans_2026-03-10-simulator-events-console-implementation-plan.md\":\"S2f1zs9-\",\"plans_2026-03-10-simulator-runtime-controls-design.md\":\"mqeNaYgg\",\"plans_2026-03-10-simulator-runtime-controls-implementation-plan.md\":\"BXG1UWFt\",\"plans_2026-03-10-testing-rollout-next-steps-plan.md\":\"CGR6uZic\",\"plans_2026-03-11-simulator-logger-dump-implementation-plan.md\":\"Ck5BGdoX\",\"reference_callbacks.md\":\"FoJwSjMy\",\"reference_config.md\":\"BrQeM_br\",\"reference_data.md\":\"BjBUZrZo\",\"reference_methods.md\":\"CxMQMj53\",\"reference_runtime.md\":\"BBP2J_yR\",\"reference_types.md\":\"BDKGwrGI\",\"reference_utils.md\":\"Dy6XKVWh\",\"simulator_index.md\":\"CF95Y_c9\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Tuya Robot Map\",\"description\":\"涂鸦扫地机地图组件\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"siteTitle\":\"Tuya Robot Map\",\"outline\":{\"level\":[2,6],\"label\":\"页面导航\"},\"nav\":[{\"text\":\"首页\",\"link\":\"/\"},{\"text\":\"指南\",\"link\":\"/guide/concepts\",\"activeMatch\":\"^/guide/\"},{\"text\":\"参考\",\"link\":\"/reference/data\",\"activeMatch\":\"^/reference/\"},{\"text\":\"模拟调试\",\"link\":\"/simulator/\",\"activeMatch\":\"^/simulator/\"}],\"sidebar\":{\"/guide/\":[{\"text\":\"指南\",\"items\":[{\"text\":\"基本概念\",\"link\":\"/guide/concepts\"},{\"text\":\"快速开始\",\"link\":\"/guide/getting-started\"},{\"text\":\"进阶使用\",\"link\":\"/guide/advanced-usage\"}]}],\"/reference/\":[{\"text\":\"组件Props\",\"items\":[{\"text\":\"数据\",\"link\":\"/reference/data\"},{\"text\":\"配置\",\"link\":\"/reference/config\"},{\"text\":\"运行时\",\"link\":\"/reference/runtime\"},{\"text\":\"地图事件回调\",\"link\":\"/reference/callbacks\"}]},{\"text\":\"方法\",\"items\":[{\"text\":\"地图方法\",\"link\":\"/reference/methods\"},{\"text\":\"工具方法\",\"link\":\"/reference/utils\"}]},{\"text\":\"类型定义\",\"items\":[{\"text\":\"类型定义\",\"link\":\"/reference/types\"}]}],\"/simulator/\":[{\"text\":\"模拟调试\",\"items\":[{\"text\":\"实时模拟调试\",\"link\":\"/simulator/\"}]}]},\"search\":{\"provider\":\"local\"},\"lastUpdated\":{\"text\":\"最后更新于\",\"formatOptions\":{\"dateStyle\":\"short\",\"timeStyle\":\"short\"}}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
1148
1187
 
1149
1188
  </body>
1150
1189
  </html>
@@ -9,9 +9,9 @@
9
9
  <link rel="preload stylesheet" href="/assets/style.hiWmcVfN.css" as="style">
10
10
  <link rel="preload stylesheet" href="/vp-icons.css" as="style">
11
11
 
12
- <script type="module" src="/assets/app.DHRGs5Zc.js"></script>
12
+ <script type="module" src="/assets/app.DOQ_pgoy.js"></script>
13
13
  <link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
14
- <link rel="modulepreload" href="/assets/chunks/theme.DZz2Y3xc.js">
14
+ <link rel="modulepreload" href="/assets/chunks/theme.BrQ0iun4.js">
15
15
  <link rel="modulepreload" href="/assets/chunks/framework.CBLqO2Q1.js">
16
16
  <link rel="modulepreload" href="/assets/guide_concepts.md.CJ87tk-r.lean.js">
17
17
  <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
@@ -21,7 +21,7 @@
21
21
  <div id="app"><div class="Layout" data-v-5d98c3a5><!--[--><!--]--><!--[--><span tabindex="-1" data-v-0b0ada53></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-0b0ada53>Skip to content</a><!--]--><!----><header class="VPNav" data-v-5d98c3a5 data-v-ae24b3ad><div class="VPNavBar" data-v-ae24b3ad data-v-6aa21345><div class="wrapper" data-v-6aa21345><div class="container" data-v-6aa21345><div class="title" data-v-6aa21345><div class="VPNavBarTitle has-sidebar" data-v-6aa21345 data-v-1168a8e4><a class="title" href="/" data-v-1168a8e4><!--[--><!--]--><!----><span data-v-1168a8e4>Tuya Robot Map</span><!--[--><!--]--></a></div></div><div class="content" data-v-6aa21345><div class="content-body" data-v-6aa21345><!--[--><!--]--><div class="VPNavBarSearch search" data-v-6aa21345><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><span class="vp-icon DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-6aa21345 data-v-dc692963><span id="main-nav-aria-label" class="visually-hidden" data-v-dc692963> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>首页</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink active" href="/guide/concepts.html" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>指南</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/reference/data.html" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>参考</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/simulator/" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>模拟调试</span><!--]--></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-6aa21345 data-v-6c893767><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-6c893767 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div><!----><div class="VPFlyout VPNavBarExtra extra" data-v-6aa21345 data-v-bb2aa2f0 data-v-cf11d7a2><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-cf11d7a2><span class="vpi-more-horizontal icon" data-v-cf11d7a2></span></button><div class="menu" data-v-cf11d7a2><div class="VPMenu" data-v-cf11d7a2 data-v-b98bc113><!----><!--[--><!--[--><!----><div class="group" data-v-bb2aa2f0><div class="item appearance" data-v-bb2aa2f0><p class="label" data-v-bb2aa2f0>Appearance</p><div class="appearance-action" data-v-bb2aa2f0><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-bb2aa2f0 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div></div></div><!----><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-6aa21345 data-v-e5dd9c1c><span class="container" data-v-e5dd9c1c><span class="top" data-v-e5dd9c1c></span><span class="middle" data-v-e5dd9c1c></span><span class="bottom" data-v-e5dd9c1c></span></span></button></div></div></div></div><div class="divider" data-v-6aa21345><div class="divider-line" data-v-6aa21345></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-5d98c3a5 data-v-a6f0e41e><div class="container" data-v-a6f0e41e><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-a6f0e41e><span class="vpi-align-left menu-icon" data-v-a6f0e41e></span><span class="menu-text" data-v-a6f0e41e>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-a6f0e41e data-v-8a42e2b4><button data-v-8a42e2b4>Return to top</button><!----></div></div></div><aside class="VPSidebar" data-v-5d98c3a5 data-v-319d5ca6><div class="curtain" data-v-319d5ca6></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-319d5ca6><span class="visually-hidden" id="sidebar-aria-label" data-v-319d5ca6> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 has-active" data-v-c40bc020 data-v-b3fd67f8><div class="item" role="button" tabindex="0" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><h2 class="text" data-v-b3fd67f8>指南</h2><!----></div><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/guide/concepts.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>基本概念</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/guide/getting-started.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>快速开始</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/guide/advanced-usage.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>进阶使用</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-5d98c3a5 data-v-1428d186><div class="VPDoc has-sidebar has-aside" data-v-1428d186 data-v-39a288b8><!--[--><!--]--><div class="container" data-v-39a288b8><div class="aside" data-v-39a288b8><div class="aside-curtain" data-v-39a288b8></div><div class="aside-container" data-v-39a288b8><div class="aside-content" data-v-39a288b8><div class="VPDocAside" data-v-39a288b8 data-v-3f215769><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-3f215769 data-v-a5bbad30><div class="content" data-v-a5bbad30><div class="outline-marker" data-v-a5bbad30></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-a5bbad30>页面导航</div><ul class="VPDocOutlineItem root" data-v-a5bbad30 data-v-b933a997><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-3f215769></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-39a288b8><div class="content-container" data-v-39a288b8><!--[--><!--]--><main class="main" data-v-39a288b8><div style="position:relative;" class="vp-doc _guide_concepts" data-v-39a288b8><div><h1 id="基本概念" tabindex="-1">基本概念 <a class="header-anchor" href="#基本概念" aria-label="Permalink to &quot;基本概念&quot;">​</a></h1><p>了解 Tuya Robot Map 的核心概念。</p><h2 id="核心组件" tabindex="-1">核心组件 <a class="header-anchor" href="#核心组件" aria-label="Permalink to &quot;核心组件&quot;">​</a></h2><p>后续文档中,我们会使用 <code>RobotMap</code> 组件作为示例,你可以根据实际需求选择使用 <code>RobotMap</code> 或 <code>RjsRobotMap</code> 组件。</p><h3 id="robotmap-组件" tabindex="-1">RobotMap 组件 <a class="header-anchor" href="#robotmap-组件" aria-label="Permalink to &quot;RobotMap 组件&quot;">​</a></h3><p>React 地图组件,提供完整的地图渲染和交互功能:</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /&gt;</span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li><p><code>RobotMap</code> 组件是基于 <a href="https://developer.tuya.com/cn/miniapp/develop/ray/component/open/web-view" target="_blank" rel="noreferrer">WebView</a> 开发的,开发前请详细阅读<a href="https://developer.tuya.com/cn/miniapp/develop/miniapp/component/native-component/native-component" target="_blank" rel="noreferrer">原生组件说明</a>。</p></li><li><p><code>RobotMap</code> 默认铺满全屏,适用于<strong>首页实时地图</strong>等场景,一个页面只能有一个 <code>RobotMap</code> 组件。</p></li><li><p>需要在小程序<code>global.config.ts</code>中配置<code>webviewRoot</code>让小程序能够正确加载<code>RobotMap</code>的资源。</p></li></ul><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
22
22
  <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;webviewRoot&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;node_modules/@ray-js/robot-map-sdk/dist-app&quot;</span></span>
23
23
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div></div><h3 id="rjsrobotmap-组件" tabindex="-1">RjsRobotMap 组件 <a class="header-anchor" href="#rjsrobotmap-组件" aria-label="Permalink to &quot;RjsRobotMap 组件&quot;">​</a></h3><p>基于Rjs开发的地图组件,它拥有和 <code>RobotMap</code> 组件相同的Props。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RjsRobotMap</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /&gt;</span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title">TIP</p><p><code>RjsRobotMap</code> 基于 <a href="https://developer.tuya.com/cn/miniapp/develop/ray/framework/render" target="_blank" rel="noreferrer">Rjs</a> 开发,它没有原生组件的限制,一个页面可以有多个 <code>RjsRobotMap</code> 组件。适用于<strong>多地图</strong>、<strong>弹窗里的地图</strong> 等场景。</p></div><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>引入 <code>RjsRobotMap</code> 对页面加载速度有一定影响。如无必要场景,我们建议始终使用 <code>RobotMap</code> 组件。</p></div><h2 id="坐标系统" tabindex="-1">坐标系统 <a class="header-anchor" href="#坐标系统" aria-label="Permalink to &quot;坐标系统&quot;">​</a></h2><h3 id="地图原点坐标" tabindex="-1">地图原点坐标 <a class="header-anchor" href="#地图原点坐标" aria-label="Permalink to &quot;地图原点坐标&quot;">​</a></h3><p>地图原点是扫地机器人运行过程中确定的参考点,地图上的元素都是基于这个原点计算的相对位置。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>地图原点本身是相对于地图左上角来定位的。例如在一张100 x 100(宽 x 高)的 地图中,如果原点坐标是(20, 80),表示原点位于相对于地图左上角(20, 80)的位置。</p></div><h3 id="地图坐标系" tabindex="-1">地图坐标系 <a class="header-anchor" href="#地图坐标系" aria-label="Permalink to &quot;地图坐标系&quot;">​</a></h3><p>地图坐标系是本 SDK 实际使用的坐标系,用于在地图上渲染和显示各种元素。地图坐标系以地图原点为中心(0, 0):</p><ul><li>X轴:向右为正方向</li><li>Y轴:向下为正方向</li></ul><h4 id="与机器坐标系的不同" tabindex="-1">与机器坐标系的不同 <a class="header-anchor" href="#与机器坐标系的不同" aria-label="Permalink to &quot;与机器坐标系的不同&quot;">​</a></h4><p>需要注意的是,本 SDK 使用的地图坐标系与扫地机器人设备本身使用的机器坐标系在 Y 轴方向上相反:</p><ul><li><p><strong>机器坐标系</strong>(设备使用的坐标系):</p><ul><li>X轴:向右为正方向</li><li>Y轴:向上为正方向</li></ul></li><li><p><strong>地图坐标系</strong>(本 SDK 使用的坐标系):</p><ul><li>X轴:向右为正方向(与机器坐标系一致)</li><li>Y轴:向下为正方向(与机器坐标系相反)</li></ul></li></ul><p>SDK 采用标准的屏幕坐标系(Screen Coordinate System)进行渲染,因此 Y 轴方向与机器坐标系相反。在 SDK 中,如果原点在(0, 0),坐标为(1, 1)的点会渲染在原点的右下方。</p><p>例如,以下元素的坐标均使用地图坐标系:</p><ul><li>充电桩</li><li>清扫路径 (含机器人位置)</li><li>虚拟墙</li><li>禁区</li><li>清扫区域</li><li>分割线</li><li>其他自定义元素</li><li>...</li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>本文档中,如果未特别说明,涉及到的坐标均指地图坐标系(X向右,Y向下)。</p></div></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><!----><div class="last-updated" data-v-e257564d><p class="VPLastUpdated" data-v-e257564d data-v-e98dd255>最后更新于: <time datetime="2025-12-30T11:04:05.000Z" data-v-e98dd255></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><!----></div><div class="pager" data-v-e257564d><a class="VPLink link pager-link next" href="/guide/getting-started.html" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>Next page</span><span class="title" data-v-e257564d>快速开始</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
24
- <script>window.__VP_HASH_MAP__=JSON.parse("{\"guide_advanced-usage.md\":\"B0nlUHzZ\",\"guide_concepts.md\":\"CJ87tk-r\",\"guide_getting-started.md\":\"BxrBbc12\",\"guide_mcp.md\":\"CabCiX8Z\",\"index.md\":\"wTsFvv0N\",\"plans_2026-03-04-detected-objects-visibility-design.md\":\"Dqboot5W\",\"plans_2026-03-04-show-detected-objects-implementation-plan.md\":\"CDWwQtWj\",\"plans_2026-03-10-simulator-debug-design.md\":\"BZibn7uw\",\"plans_2026-03-10-simulator-events-console-design.md\":\"BVmEzCbR\",\"plans_2026-03-10-simulator-events-console-implementation-plan.md\":\"S2f1zs9-\",\"plans_2026-03-10-simulator-runtime-controls-design.md\":\"mqeNaYgg\",\"plans_2026-03-10-simulator-runtime-controls-implementation-plan.md\":\"BXG1UWFt\",\"plans_2026-03-10-testing-rollout-next-steps-plan.md\":\"CGR6uZic\",\"plans_2026-03-11-simulator-logger-dump-implementation-plan.md\":\"Ck5BGdoX\",\"reference_callbacks.md\":\"FoJwSjMy\",\"reference_config.md\":\"D3LT2kWa\",\"reference_data.md\":\"B_XpUFrn\",\"reference_methods.md\":\"BvtVJ2dG\",\"reference_runtime.md\":\"BBP2J_yR\",\"reference_types.md\":\"CfnUIfkB\",\"reference_utils.md\":\"Dy6XKVWh\",\"simulator_index.md\":\"CF95Y_c9\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Tuya Robot Map\",\"description\":\"涂鸦扫地机地图组件\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"siteTitle\":\"Tuya Robot Map\",\"outline\":{\"level\":[2,6],\"label\":\"页面导航\"},\"nav\":[{\"text\":\"首页\",\"link\":\"/\"},{\"text\":\"指南\",\"link\":\"/guide/concepts\",\"activeMatch\":\"^/guide/\"},{\"text\":\"参考\",\"link\":\"/reference/data\",\"activeMatch\":\"^/reference/\"},{\"text\":\"模拟调试\",\"link\":\"/simulator/\",\"activeMatch\":\"^/simulator/\"}],\"sidebar\":{\"/guide/\":[{\"text\":\"指南\",\"items\":[{\"text\":\"基本概念\",\"link\":\"/guide/concepts\"},{\"text\":\"快速开始\",\"link\":\"/guide/getting-started\"},{\"text\":\"进阶使用\",\"link\":\"/guide/advanced-usage\"}]}],\"/reference/\":[{\"text\":\"组件Props\",\"items\":[{\"text\":\"数据\",\"link\":\"/reference/data\"},{\"text\":\"配置\",\"link\":\"/reference/config\"},{\"text\":\"运行时\",\"link\":\"/reference/runtime\"},{\"text\":\"地图事件回调\",\"link\":\"/reference/callbacks\"}]},{\"text\":\"方法\",\"items\":[{\"text\":\"地图方法\",\"link\":\"/reference/methods\"},{\"text\":\"工具方法\",\"link\":\"/reference/utils\"}]},{\"text\":\"类型定义\",\"items\":[{\"text\":\"类型定义\",\"link\":\"/reference/types\"}]}],\"/simulator/\":[{\"text\":\"模拟调试\",\"items\":[{\"text\":\"实时模拟调试\",\"link\":\"/simulator/\"}]}]},\"search\":{\"provider\":\"local\"},\"lastUpdated\":{\"text\":\"最后更新于\",\"formatOptions\":{\"dateStyle\":\"short\",\"timeStyle\":\"short\"}}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
24
+ <script>window.__VP_HASH_MAP__=JSON.parse("{\"agents_domain.md\":\"CYB9yWEy\",\"agents_issue-tracker.md\":\"CrjzmXmc\",\"agents_triage-labels.md\":\"BqHb16T-\",\"guide_advanced-usage.md\":\"DNWCmYfB\",\"guide_concepts.md\":\"CJ87tk-r\",\"guide_getting-started.md\":\"BuIxcYrc\",\"guide_mcp.md\":\"CabCiX8Z\",\"index.md\":\"wTsFvv0N\",\"plans_2026-03-04-detected-objects-visibility-design.md\":\"Dqboot5W\",\"plans_2026-03-04-show-detected-objects-implementation-plan.md\":\"CDWwQtWj\",\"plans_2026-03-10-simulator-debug-design.md\":\"BZibn7uw\",\"plans_2026-03-10-simulator-events-console-design.md\":\"BVmEzCbR\",\"plans_2026-03-10-simulator-events-console-implementation-plan.md\":\"S2f1zs9-\",\"plans_2026-03-10-simulator-runtime-controls-design.md\":\"mqeNaYgg\",\"plans_2026-03-10-simulator-runtime-controls-implementation-plan.md\":\"BXG1UWFt\",\"plans_2026-03-10-testing-rollout-next-steps-plan.md\":\"CGR6uZic\",\"plans_2026-03-11-simulator-logger-dump-implementation-plan.md\":\"Ck5BGdoX\",\"reference_callbacks.md\":\"FoJwSjMy\",\"reference_config.md\":\"BrQeM_br\",\"reference_data.md\":\"BjBUZrZo\",\"reference_methods.md\":\"CxMQMj53\",\"reference_runtime.md\":\"BBP2J_yR\",\"reference_types.md\":\"BDKGwrGI\",\"reference_utils.md\":\"Dy6XKVWh\",\"simulator_index.md\":\"CF95Y_c9\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Tuya Robot Map\",\"description\":\"涂鸦扫地机地图组件\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"siteTitle\":\"Tuya Robot Map\",\"outline\":{\"level\":[2,6],\"label\":\"页面导航\"},\"nav\":[{\"text\":\"首页\",\"link\":\"/\"},{\"text\":\"指南\",\"link\":\"/guide/concepts\",\"activeMatch\":\"^/guide/\"},{\"text\":\"参考\",\"link\":\"/reference/data\",\"activeMatch\":\"^/reference/\"},{\"text\":\"模拟调试\",\"link\":\"/simulator/\",\"activeMatch\":\"^/simulator/\"}],\"sidebar\":{\"/guide/\":[{\"text\":\"指南\",\"items\":[{\"text\":\"基本概念\",\"link\":\"/guide/concepts\"},{\"text\":\"快速开始\",\"link\":\"/guide/getting-started\"},{\"text\":\"进阶使用\",\"link\":\"/guide/advanced-usage\"}]}],\"/reference/\":[{\"text\":\"组件Props\",\"items\":[{\"text\":\"数据\",\"link\":\"/reference/data\"},{\"text\":\"配置\",\"link\":\"/reference/config\"},{\"text\":\"运行时\",\"link\":\"/reference/runtime\"},{\"text\":\"地图事件回调\",\"link\":\"/reference/callbacks\"}]},{\"text\":\"方法\",\"items\":[{\"text\":\"地图方法\",\"link\":\"/reference/methods\"},{\"text\":\"工具方法\",\"link\":\"/reference/utils\"}]},{\"text\":\"类型定义\",\"items\":[{\"text\":\"类型定义\",\"link\":\"/reference/types\"}]}],\"/simulator/\":[{\"text\":\"模拟调试\",\"items\":[{\"text\":\"实时模拟调试\",\"link\":\"/simulator/\"}]}]},\"search\":{\"provider\":\"local\"},\"lastUpdated\":{\"text\":\"最后更新于\",\"formatOptions\":{\"dateStyle\":\"short\",\"timeStyle\":\"short\"}}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
25
25
 
26
26
  </body>
27
27
  </html>