@ray-js/robot-map-sdk 0.0.15-beta.1 → 0.0.15-beta.3

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 (52) hide show
  1. package/bin/mcp-server.js +24 -24
  2. package/dist/constant/methods.js +1 -1
  3. package/dist/index.d.ts +41 -1
  4. package/dist/index.rjs.js +1 -1
  5. package/dist-app/assets/{index-BNBxfMSM.js → index-BeiPDWUx.js} +1 -1
  6. package/dist-app/index.html +1 -1
  7. package/dist-docs/404.html +2 -2
  8. package/dist-docs/assets/{app.DrVvoJqD.js → app.BxnZmRJz.js} +1 -1
  9. package/dist-docs/assets/chunks/@localSearchIndexroot.Dh4oiMq8.js +1 -0
  10. package/dist-docs/assets/chunks/{BitmapFont.BEQi-SuJ.js → BitmapFont.CWow1Z4d.js} +1 -1
  11. package/dist-docs/assets/chunks/{BufferResource.BcXsqdtp.js → BufferResource.D7mg1YPa.js} +1 -1
  12. package/dist-docs/assets/chunks/{CanvasRenderer.D4lorIYk.js → CanvasRenderer.CIhNDvyh.js} +1 -1
  13. package/dist-docs/assets/chunks/{RenderTargetSystem.Bje_ofsU.js → RenderTargetSystem.C3jRWjhS.js} +1 -1
  14. package/dist-docs/assets/chunks/{VPLocalSearchBox.C6RPYXCP.js → VPLocalSearchBox.BCocgYNw.js} +1 -1
  15. package/dist-docs/assets/chunks/{WebGLRenderer.DBz0cz4m.js → WebGLRenderer.DGgjkcO6.js} +1 -1
  16. package/dist-docs/assets/chunks/{WebGPURenderer.DeayS-qR.js → WebGPURenderer.JZilOIh9.js} +1 -1
  17. package/dist-docs/assets/chunks/{browserAll.DTj5xrRK.js → browserAll.Bs2t6Fbp.js} +1 -1
  18. package/dist-docs/assets/chunks/index.BYSGWvBH.js +744 -0
  19. package/dist-docs/assets/chunks/{theme.C_XzLiDc.js → theme.BluH8Q7i.js} +3 -3
  20. package/dist-docs/assets/chunks/{webworkerAll.CtODZtwG.js → webworkerAll.BNr16NOT.js} +1 -1
  21. package/dist-docs/assets/{guide_advanced-usage.md.B0nlUHzZ.js → guide_advanced-usage.md.BboplJc2.js} +15 -3
  22. package/dist-docs/assets/{guide_advanced-usage.md.B0nlUHzZ.lean.js → guide_advanced-usage.md.BboplJc2.lean.js} +1 -1
  23. package/dist-docs/assets/{guide_getting-started.md.GeenewB7.js → guide_getting-started.md.DOh8beTe.js} +1 -1
  24. package/dist-docs/assets/{reference_config.md.D3LT2kWa.js → reference_config.md.BW7btOQc.js} +3 -3
  25. package/dist-docs/assets/{reference_config.md.D3LT2kWa.lean.js → reference_config.md.BW7btOQc.lean.js} +1 -1
  26. package/dist-docs/guide/advanced-usage.html +18 -6
  27. package/dist-docs/guide/concepts.html +3 -3
  28. package/dist-docs/guide/getting-started.html +5 -5
  29. package/dist-docs/guide/mcp.html +3 -3
  30. package/dist-docs/hashmap.json +1 -1
  31. package/dist-docs/index.html +3 -3
  32. package/dist-docs/plans/2026-03-04-detected-objects-visibility-design.html +3 -3
  33. package/dist-docs/plans/2026-03-04-show-detected-objects-implementation-plan.html +3 -3
  34. package/dist-docs/plans/2026-03-10-simulator-debug-design.html +3 -3
  35. package/dist-docs/plans/2026-03-10-simulator-events-console-design.html +3 -3
  36. package/dist-docs/plans/2026-03-10-simulator-events-console-implementation-plan.html +3 -3
  37. package/dist-docs/plans/2026-03-10-simulator-runtime-controls-design.html +3 -3
  38. package/dist-docs/plans/2026-03-10-simulator-runtime-controls-implementation-plan.html +3 -3
  39. package/dist-docs/plans/2026-03-10-testing-rollout-next-steps-plan.html +3 -3
  40. package/dist-docs/plans/2026-03-11-simulator-logger-dump-implementation-plan.html +3 -3
  41. package/dist-docs/reference/callbacks.html +3 -3
  42. package/dist-docs/reference/config.html +6 -6
  43. package/dist-docs/reference/data.html +3 -3
  44. package/dist-docs/reference/methods.html +3 -3
  45. package/dist-docs/reference/runtime.html +3 -3
  46. package/dist-docs/reference/types.html +3 -3
  47. package/dist-docs/reference/utils.html +3 -3
  48. package/dist-docs/simulator/index.html +3 -3
  49. package/package.json +1 -1
  50. package/dist-docs/assets/chunks/@localSearchIndexroot.DgCT_aeF.js +0 -1
  51. package/dist-docs/assets/chunks/index.B6zCXCHX.js +0 -744
  52. /package/dist-docs/assets/{guide_getting-started.md.GeenewB7.lean.js → guide_getting-started.md.DOh8beTe.lean.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{ac as S,ae as I,af as B,aI as O,p as F,M as w,a4 as A,a0 as E,ak as m,T as y,aA as U,X as C,w as M,aj as Y,x as P}from"./index.B6zCXCHX.js";import"./framework.CBLqO2Q1.js";import"./mapValues.D2X8cRgC.js";import"./theme.C_XzLiDc.js";var X=`in vec2 vTextureCoord;
1
+ import{ac as S,ae as I,af as B,aI as O,p as F,M as w,a4 as A,a0 as E,ak as m,T as y,aA as U,X as C,w as M,aj as Y,x as P}from"./index.BYSGWvBH.js";import"./framework.CBLqO2Q1.js";import"./mapValues.D2X8cRgC.js";import"./theme.BluH8Q7i.js";var X=`in vec2 vTextureCoord;
2
2
  out vec4 finalColor;
3
3
  uniform sampler2D uTexture;
4
4
  void main() {
@@ -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":"guide/advanced-usage.md","filePath":"guide/advanced-usage.md","lastUpdated":1777535786000}'),l={name:"guide/advanced-usage.md"};function p(k,s,t,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>Tuya Robot Map 的进阶使用,包含了我们认为的最佳实践。</p><h2 id="自适应缩放" tabindex="-1">自适应缩放 <a class="header-anchor" href="#自适应缩放" aria-label="Permalink to &quot;自适应缩放&quot;">​</a></h2><p>自适应缩放是地图 SDK 的核心功能之一,它会自动调整地图的缩放比例和位置,确保地图能够以合适的大小居中显示在视口中。</p><h3 id="什么是-scale" tabindex="-1">什么是 scale? <a class="header-anchor" href="#什么是-scale" aria-label="Permalink to &quot;什么是 scale?&quot;">​</a></h3><p><code>scale</code> 表示地图的缩放比例。<strong><code>scale = 1</code> 表示地图按照真实像素尺寸显示</strong>。</p><p>例如,如果你的地图数据是 300×300 的尺寸:</p><ul><li><code>scale = 1</code> 时,地图会用 300×300 像素显示</li><li><code>scale = 2</code> 时,地图会放大到 600×600 像素</li><li><code>scale = 0.5</code> 时,地图会缩小到 150×150 像素</li></ul><h3 id="自适应缩放的触发时机" tabindex="-1">自适应缩放的触发时机 <a class="header-anchor" href="#自适应缩放的触发时机" aria-label="Permalink to &quot;自适应缩放的触发时机&quot;">​</a></h3><p>自适应缩放会在以下情况自动触发:</p><ol><li><strong>地图首次绘制</strong>:当地图第一次加载时</li><li><strong>地图 ID 变化</strong>:切换到不同的地图时</li><li><strong>地图状态变化</strong>:地图的 <code>status</code> 字段变化时(例如从建图中变为建图完成)</li><li><strong>地图原点变化</strong>:地图的 <code>origin</code> 坐标变化超过阈值时</li><li><strong>地图尺寸变化</strong>:地图的 <code>size</code> (宽度或高度) 变化超过阈值时</li><li><strong>地图旋转</strong>:通过 <code>runtime.mapRotation</code> 旋转地图后</li></ol><h3 id="自适应缩放的计算逻辑" tabindex="-1">自适应缩放的计算逻辑 <a class="header-anchor" href="#自适应缩放的计算逻辑" aria-label="Permalink to &quot;自适应缩放的计算逻辑&quot;">​</a></h3><p>当触发自适应缩放时,SDK 会按照以下步骤计算最终的缩放比例:</p><h4 id="_1-计算初始缩放比例" tabindex="-1">1. 计算初始缩放比例 <a class="header-anchor" href="#_1-计算初始缩放比例" aria-label="Permalink to &quot;1. 计算初始缩放比例&quot;">​</a></h4><p>SDK 会根据 <a href="/reference/config.html#map-autopaddinghorizontalpercent"><code>map.autoPaddingHorizontalPercent</code></a> 和 <a href="/reference/config.html#map-autopaddingverticalpercent"><code>map.autoPaddingVerticalPercent</code></a> 计算出一个初始的缩放比例,确保地图能够完整显示并保留指定的边距。</p><p>例如,如果视口宽度是 375px,<code>autoPaddingHorizontalPercent</code> 是 0.05(默认值),那么:</p><ul><li>水平方向的可用空间 = 375 × (1 - 0.05 × 2) = 337.5px</li><li>如果地图实际宽度是 300px,则计算出的 scale = 337.5 / 300 ≈ 1.125</li><li>如果地图实际宽度是 600px,则计算出的 scale = 337.5 / 600 ≈ 0.5625</li></ul><h4 id="_2-应用缩放比例限制" tabindex="-1">2. 应用缩放比例限制 <a class="header-anchor" href="#_2-应用缩放比例限制" aria-label="Permalink to &quot;2. 应用缩放比例限制&quot;">​</a></h4><p>计算出的初始缩放比例会受到 <a href="/reference/config.html#interaction-fitminscale"><code>interaction.fitMinScale</code></a> 和 <a href="/reference/config.html#interaction-fitmaxscale"><code>interaction.fitMaxScale</code></a> 的限制:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>最终 scale = Math.max(fitMinScale, Math.min(初始 scale, fitMaxScale))</span></span></code></pre></div><h3 id="常见问题与解决方案" tabindex="-1">常见问题与解决方案 <a class="header-anchor" href="#常见问题与解决方案" aria-label="Permalink to &quot;常见问题与解决方案&quot;">​</a></h3><h4 id="问题-1-超大地图显示不全" tabindex="-1">问题 1:超大地图显示不全 <a class="header-anchor" href="#问题-1-超大地图显示不全" aria-label="Permalink to &quot;问题 1:超大地图显示不全&quot;">​</a></h4><p><strong>现象</strong>:地图很大,但只能看到部分内容,无法看到完整地图。</p><p><strong>原因</strong>:当地图尺寸超过视口时,SDK 计算出的缩放比例可能小于 1(需要缩小地图)。但是 <code>fitMinScale</code> 的默认值是 1,会限制地图不能缩小到小于原始尺寸,导致地图无法完整显示。</p><p><strong>解决方案</strong>:将 <code>fitMinScale</code> 设置为小于 1 的值,允许地图缩小。</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":"guide/advanced-usage.md","filePath":"guide/advanced-usage.md","lastUpdated":1777542387000}'),l={name:"guide/advanced-usage.md"};function p(k,s,t,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>Tuya Robot Map 的进阶使用,包含了我们认为的最佳实践。</p><h2 id="自适应缩放" tabindex="-1">自适应缩放 <a class="header-anchor" href="#自适应缩放" aria-label="Permalink to &quot;自适应缩放&quot;">​</a></h2><p>自适应缩放是地图 SDK 的核心功能之一,它会自动调整地图的缩放比例和位置,确保地图能够以合适的大小居中显示在视口中。</p><h3 id="什么是-scale" tabindex="-1">什么是 scale? <a class="header-anchor" href="#什么是-scale" aria-label="Permalink to &quot;什么是 scale?&quot;">​</a></h3><p><code>scale</code> 表示地图的缩放比例。<strong><code>scale = 1</code> 表示地图按照真实像素尺寸显示</strong>。</p><p>例如,如果你的地图数据是 300×300 的尺寸:</p><ul><li><code>scale = 1</code> 时,地图会用 300×300 像素显示</li><li><code>scale = 2</code> 时,地图会放大到 600×600 像素</li><li><code>scale = 0.5</code> 时,地图会缩小到 150×150 像素</li></ul><h3 id="自适应缩放的触发时机" tabindex="-1">自适应缩放的触发时机 <a class="header-anchor" href="#自适应缩放的触发时机" aria-label="Permalink to &quot;自适应缩放的触发时机&quot;">​</a></h3><p>自适应缩放会在以下情况自动触发:</p><ol><li><strong>地图首次绘制</strong>:当地图第一次加载时</li><li><strong>地图 ID 变化</strong>:切换到不同的地图时</li><li><strong>地图状态变化</strong>:地图的 <code>status</code> 字段变化时(例如从建图中变为建图完成)</li><li><strong>地图原点变化</strong>:地图的 <code>origin</code> 坐标变化超过阈值时</li><li><strong>地图尺寸变化</strong>:地图的 <code>size</code> (宽度或高度) 变化超过阈值时</li><li><strong>地图旋转</strong>:通过 <code>runtime.mapRotation</code> 旋转地图后</li></ol><h3 id="自适应缩放的计算逻辑" tabindex="-1">自适应缩放的计算逻辑 <a class="header-anchor" href="#自适应缩放的计算逻辑" aria-label="Permalink to &quot;自适应缩放的计算逻辑&quot;">​</a></h3><p>当触发自适应缩放时,SDK 会按照以下步骤计算最终的缩放比例:</p><h4 id="_1-计算初始缩放比例" tabindex="-1">1. 计算初始缩放比例 <a class="header-anchor" href="#_1-计算初始缩放比例" aria-label="Permalink to &quot;1. 计算初始缩放比例&quot;">​</a></h4><p>SDK 会根据 <a href="/reference/config.html#map-autopaddinghorizontalpercent"><code>map.autoPaddingHorizontalPercent</code></a> 和 <a href="/reference/config.html#map-autopaddingverticalpercent"><code>map.autoPaddingVerticalPercent</code></a> 计算出一个初始的缩放比例,确保地图能够完整显示并保留指定的边距。</p><p>例如,如果视口宽度是 375px,<code>autoPaddingHorizontalPercent</code> 是 0.05(默认值),那么:</p><ul><li>水平方向的可用空间 = 375 × (1 - 0.05 × 2) = 337.5px</li><li>如果地图实际宽度是 300px,则计算出的 scale = 337.5 / 300 ≈ 1.125</li><li>如果地图实际宽度是 600px,则计算出的 scale = 337.5 / 600 ≈ 0.5625</li></ul><h4 id="_2-应用缩放比例限制" tabindex="-1">2. 应用缩放比例限制 <a class="header-anchor" href="#_2-应用缩放比例限制" aria-label="Permalink to &quot;2. 应用缩放比例限制&quot;">​</a></h4><p>计算出的初始缩放比例会受到 <a href="/reference/config.html#interaction-fitminscale"><code>interaction.fitMinScale</code></a> 和 <a href="/reference/config.html#interaction-fitmaxscale"><code>interaction.fitMaxScale</code></a> 的限制:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>最终 scale = Math.max(fitMinScale, Math.min(初始 scale, fitMaxScale))</span></span></code></pre></div><h3 id="常见问题与解决方案" tabindex="-1">常见问题与解决方案 <a class="header-anchor" href="#常见问题与解决方案" aria-label="Permalink to &quot;常见问题与解决方案&quot;">​</a></h3><h4 id="问题-1-超大地图显示不全" tabindex="-1">问题 1:超大地图显示不全 <a class="header-anchor" href="#问题-1-超大地图显示不全" aria-label="Permalink to &quot;问题 1:超大地图显示不全&quot;">​</a></h4><p><strong>现象</strong>:地图很大,但只能看到部分内容,无法看到完整地图。</p><p><strong>原因</strong>:当地图尺寸超过视口时,SDK 计算出的缩放比例可能小于 1(需要缩小地图)。但是 <code>fitMinScale</code> 的默认值是 1,会限制地图不能缩小到小于原始尺寸,导致地图无法完整显示。</p><p><strong>解决方案</strong>:将 <code>fitMinScale</code> 设置为小于 1 的值,允许地图缩小。</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;"> config</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{{</span></span>
3
3
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> interaction: {</span></span>
4
4
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 允许地图缩小到原始尺寸的 50%</span></span>
@@ -524,7 +524,19 @@ import{_ as i,c as a,o as n,aq as h}from"./chunks/framework.CBLqO2Q1.js";const g
524
524
  <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>
525
525
  <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>
526
526
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
527
- <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>
527
+ <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>
528
+ <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>
529
+ <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>
530
+ <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>
531
+ <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>
532
+ <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // applyMapRotation 默认 true,矩形在屏幕上视觉保持正放;</span></span>
533
+ <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 如果你只需要地图坐标系下的轴对齐矩形,传 false。</span></span>
534
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span>
535
+ <span class="line"></span>
536
+ <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">setCustomZones</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">([</span></span>
537
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">customZones,</span></span>
538
+ <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>
539
+ <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>
528
540
  <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>
529
541
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 房间唯一标识符 */</span></span>
530
542
  <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>
@@ -1123,4 +1135,4 @@ import{_ as i,c as a,o as n,aq as h}from"./chunks/framework.CBLqO2Q1.js";const g
1123
1135
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (mapApi) {</span></span>
1124
1136
  <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>
1125
1137
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
1126
- <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>`,235)])])}const y=i(l,[["render",p]]);export{g as __pageData,y as default};
1138
+ <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>`,238)])])}const y=i(l,[["render",p]]);export{g as __pageData,y as default};
@@ -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":"guide/advanced-usage.md","filePath":"guide/advanced-usage.md","lastUpdated":1777535786000}'),l={name:"guide/advanced-usage.md"};function p(k,s,t,e,E,r){return n(),a("div",null,[...s[0]||(s[0]=[h("",235)])])}const y=i(l,[["render",p]]);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":"guide/advanced-usage.md","filePath":"guide/advanced-usage.md","lastUpdated":1777542387000}'),l={name:"guide/advanced-usage.md"};function p(k,s,t,e,E,r){return n(),a("div",null,[...s[0]||(s[0]=[h("",238)])])}const y=i(l,[["render",p]]);export{g as __pageData,y 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 g=JSON.parse('{"title":"快速开始","description":"","frontmatter":{},"headers":[],"relativePath":"guide/getting-started.md","filePath":"guide/getting-started.md","lastUpdated":1770804529000}'),h={name:"guide/getting-started.md"};function l(k,s,t,e,E,r){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>Tuya Robot Map 提供了开箱即用的 React 组件,专为扫地机器人应用设计。</p><h2 id="安装" tabindex="-1">安装 <a class="header-anchor" href="#安装" aria-label="Permalink to &quot;安装&quot;">​</a></h2><div class="vp-code-group vp-adaptive-theme"><div class="tabs"><input type="radio" name="group-k1QdV" id="tab-BCAZrCx" checked><label data-title="yarn" for="tab-BCAZrCx">yarn</label><input type="radio" name="group-k1QdV" id="tab-vYoMvja"><label data-title="npm" for="tab-vYoMvja">npm</label></div><div class="blocks"><div class="language-bash vp-adaptive-theme active"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">yarn</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> add</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> @ray-js/robot-map</span></span></code></pre></div><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">npm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> @ray-js/robot-map</span></span></code></pre></div></div></div><h2 id="数据传入" tabindex="-1">数据传入 <a class="header-anchor" href="#数据传入" aria-label="Permalink to &quot;数据传入&quot;">​</a></h2><p>仅需传入几个基本的数据props,即可完成地图的呈现。</p><div class="vp-code-group vp-adaptive-theme"><div class="tabs"><input type="radio" name="group-qktQR" id="tab-I10jn8E" checked><label data-title="点阵协议地图数据" for="tab-I10jn8E">点阵协议地图数据</label><input type="radio" name="group-qktQR" id="tab-PFQ8kZb"><label data-title="结构化协议地图数据" for="tab-PFQ8kZb">结构化协议地图数据</label></div><div class="blocks"><div class="language-tsx vp-adaptive-theme active"><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, { useMemo } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;react&#39;</span></span>
1
+ import{_ as i,c as a,o as n,aq as p}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"快速开始","description":"","frontmatter":{},"headers":[],"relativePath":"guide/getting-started.md","filePath":"guide/getting-started.md","lastUpdated":1770804529000}'),h={name:"guide/getting-started.md"};function l(k,s,t,e,E,r){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>Tuya Robot Map 提供了开箱即用的 React 组件,专为扫地机器人应用设计。</p><h2 id="安装" tabindex="-1">安装 <a class="header-anchor" href="#安装" aria-label="Permalink to &quot;安装&quot;">​</a></h2><div class="vp-code-group vp-adaptive-theme"><div class="tabs"><input type="radio" name="group-gP7mS" id="tab-V2azDai" checked><label data-title="yarn" for="tab-V2azDai">yarn</label><input type="radio" name="group-gP7mS" id="tab-pzqL_uT"><label data-title="npm" for="tab-pzqL_uT">npm</label></div><div class="blocks"><div class="language-bash vp-adaptive-theme active"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">yarn</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> add</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> @ray-js/robot-map</span></span></code></pre></div><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">npm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> @ray-js/robot-map</span></span></code></pre></div></div></div><h2 id="数据传入" tabindex="-1">数据传入 <a class="header-anchor" href="#数据传入" aria-label="Permalink to &quot;数据传入&quot;">​</a></h2><p>仅需传入几个基本的数据props,即可完成地图的呈现。</p><div class="vp-code-group vp-adaptive-theme"><div class="tabs"><input type="radio" name="group-BvC7y" id="tab-oYujEiH" checked><label data-title="点阵协议地图数据" for="tab-oYujEiH">点阵协议地图数据</label><input type="radio" name="group-BvC7y" id="tab-H1aszVJ"><label data-title="结构化协议地图数据" for="tab-H1aszVJ">结构化协议地图数据</label></div><div class="blocks"><div class="language-tsx vp-adaptive-theme active"><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, { useMemo } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;react&#39;</span></span>
2
2
  <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>
3
3
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { decodeRoomProperties } </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>
4
4
  <span class="line"></span>
@@ -1,4 +1,4 @@
1
- import{_ as i,c as e,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":1777535786000}'),s={name:"reference/config.md"};function n(l,o,r,c,d,h){return a(),e("div",null,[...o[0]||(o[0]=[t(`<h1 id="配置" tabindex="-1">配置 <a class="header-anchor" href="#配置" aria-label="Permalink to &quot;配置&quot;">​</a></h1><p>了解 RobotMap 的配置选项,用于定制地图的视觉样式、素材资源、交互行为等。</p><div class="tip custom-block"><p class="custom-block-title">响应式配置</p><p>配置是<strong>响应式</strong>的,当你修改传入的 <code>config</code> prop 时,地图会自动更新视觉效果,无需重新初始化。这使得主题切换、颜色调整等功能的实现变得简单直接。</p></div><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li>本文档部分配置项的单位与<strong>米</strong>相关,该配置的值会根据地图数据里的分辨率转换为像素单位。</li></ul></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>config</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;"> 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>
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":1778207150000}'),s={name:"reference/config.md"};function n(l,o,r,c,d,h){return a(),i("div",null,[...o[0]||(o[0]=[t(`<h1 id="配置" tabindex="-1">配置 <a class="header-anchor" href="#配置" aria-label="Permalink to &quot;配置&quot;">​</a></h1><p>了解 RobotMap 的配置选项,用于定制地图的视觉样式、素材资源、交互行为等。</p><div class="tip custom-block"><p class="custom-block-title">响应式配置</p><p>配置是<strong>响应式</strong>的,当你修改传入的 <code>config</code> prop 时,地图会自动更新视觉效果,无需重新初始化。这使得主题切换、颜色调整等功能的实现变得简单直接。</p></div><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li>本文档部分配置项的单位与<strong>米</strong>相关,该配置的值会根据地图数据里的分辨率转换为像素单位。</li></ul></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>config</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;"> 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>
2
2
  <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>
3
3
  <span class="line"></span>
4
4
  <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>
@@ -166,7 +166,7 @@ import{_ as i,c as e,o as a,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g
166
166
  <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> repeat</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 是否平铺(暂未实现)</span></span>
167
167
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
168
168
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
169
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p><strong>fit 模式说明:</strong></p><ul><li><code>fill</code>:拉伸填充整个视口</li><li><code>contain</code>:完整显示图片,保持宽高比,可能有留白</li><li><code>cover</code>(默认):覆盖整个视口,保持宽高比,可能裁剪</li><li><code>none</code>:原始尺寸显示</li></ul><h3 id="global-backgroundalpha" tabindex="-1">global.backgroundAlpha <a class="header-anchor" href="#global-backgroundalpha" aria-label="Permalink to &quot;global.backgroundAlpha&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>1</code></li></ul><p>地图容器背景透明度。</p><div class="warning custom-block"><p class="custom-block-title">注意</p><p>该配置仅对<strong>纯色背景</strong> (<code>backgroundColor</code>) 和<strong>图片背景</strong> (<code>backgroundImage</code>) 生效。</p><p>对于<strong>渐变背景</strong> (<code>backgroundGradient</code>),请直接在 <code>colorStops</code> 中使用 <code>rgba</code> 颜色值(如 <code>&#39;rgba(255, 255, 255, 0.5)&#39;</code>)来控制透明度。</p></div><h3 id="global-performancemode" tabindex="-1">global.performanceMode <a class="header-anchor" href="#global-performancemode" aria-label="Permalink to &quot;global.performanceMode&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否开启高性能模式。开启后,SDK 会优化渲染性能(如强制关闭抗锯齿、共享时钟等),建议在多地图展示等对性能要求较高的场景下开启。</p><h3 id="global-resolution" tabindex="-1">global.resolution <a class="header-anchor" href="#global-resolution" aria-label="Permalink to &quot;global.resolution&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>window.devicePixelRatio</code></li></ul><p>渲染分辨率倍率。通常不需要手动设置,SDK 会自动获取设备的像素密度。在性能极度受限的场景下,可以手动将其设为 <code>1</code> 或 <code>1.5</code> 来降低 GPU 渲染压力。</p><h3 id="global-enablelogger" tabindex="-1">global.enableLogger <a class="header-anchor" href="#global-enablelogger" aria-label="Permalink to &quot;global.enableLogger&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>import.meta.env.DEV</code></li></ul><p>是否启用日志输出。当设置为 <code>true</code> 时,SDK 会输出内部日志(<code>Logger.log</code>、<code>Logger.warn</code>、<code>Logger.error</code>、<code>Logger.debug</code>、<code>Logger.success</code>);当设置为 <code>false</code> 时,所有日志都不会输出。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>默认值会跟随构建环境:开发环境通常为 <code>true</code>,生产环境通常为 <code>false</code>。 建议仅在排查问题时开启此选项。</p></div><h3 id="global-rendererpreference" tabindex="-1">global.rendererPreference <a class="header-anchor" href="#global-rendererpreference" aria-label="Permalink to &quot;global.rendererPreference&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>&#39;webgpu&#39; | &#39;webgl&#39;</code></li><li><strong>默认值</strong>: <code>&#39;webgpu&#39;</code></li></ul><p>渲染器偏好,设置 PIXI.js 优先使用的渲染后端。</p><h2 id="interaction" tabindex="-1">interaction <a class="header-anchor" href="#interaction" aria-label="Permalink to &quot;interaction&quot;">​</a></h2><p>交互配置,控制地图的缩放和手势操作。</p><h3 id="interaction-zoomrange" tabindex="-1">interaction.zoomRange <a class="header-anchor" href="#interaction-zoomrange" aria-label="Permalink to &quot;interaction.zoomRange&quot;">​</a></h3><p>缩放范围配置。</p><h4 id="interaction-zoomrange-min" tabindex="-1">interaction.zoomRange.min <a class="header-anchor" href="#interaction-zoomrange-min" aria-label="Permalink to &quot;interaction.zoomRange.min&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>0.5</code></li></ul><p>地图初始化后,支持的最小缩放倍数</p><h4 id="interaction-zoomrange-max" tabindex="-1">interaction.zoomRange.max <a class="header-anchor" href="#interaction-zoomrange-max" aria-label="Permalink to &quot;interaction.zoomRange.max&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>8</code></li></ul><p>地图初始化后,支持的最大缩放倍数</p><h3 id="interaction-fitminscale" tabindex="-1">interaction.fitMinScale <a class="header-anchor" href="#interaction-fitminscale" aria-label="Permalink to &quot;interaction.fitMinScale&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>1</code></li></ul><p>自适应缩放时的最小比例。限制地图缩小的最小程度。</p><h3 id="interaction-fitmaxscale" tabindex="-1">interaction.fitMaxScale <a class="header-anchor" href="#interaction-fitmaxscale" aria-label="Permalink to &quot;interaction.fitMaxScale&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>4</code></li></ul><p>自适应缩放时的最大比例。限制地图放大的最大程度。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>关于自适应缩放的完整说明,包括触发时机、计算逻辑和常见问题,请参阅 <a href="/guide/advanced-usage.html#自适应缩放">自适应缩放</a>。</p></div><h3 id="interaction-enable" tabindex="-1">interaction.enable <a class="header-anchor" href="#interaction-enable" aria-label="Permalink to &quot;interaction.enable&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否开启地图交互总控。设置为 <code>false</code> 时,将完全从底层禁用地图的缩放、平移和点击等交互事件监听,极大减少交互带来的性能开销。</p><h3 id="interaction-enabledoubletapzoom" tabindex="-1">interaction.enableDoubleTapZoom <a class="header-anchor" href="#interaction-enabledoubletapzoom" aria-label="Permalink to &quot;interaction.enableDoubleTapZoom&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否启用双击缩放功能</p><h3 id="interaction-enablerobotclick" tabindex="-1">interaction.enableRobotClick <a class="header-anchor" href="#interaction-enablerobotclick" aria-label="Permalink to &quot;interaction.enableRobotClick&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否启用扫地机器人的点击交互功能。</p><h3 id="interaction-enablechargingstationclick" tabindex="-1">interaction.enableChargingStationClick <a class="header-anchor" href="#interaction-enablechargingstationclick" aria-label="Permalink to &quot;interaction.enableChargingStationClick&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否启用充电桩的点击交互功能。</p><h2 id="map" tabindex="-1">map <a class="header-anchor" href="#map" aria-label="Permalink to &quot;map&quot;">​</a></h2><p>地图配置。</p><h3 id="map-autopaddinghorizontalpercent" tabindex="-1">map.autoPaddingHorizontalPercent <a class="header-anchor" href="#map-autopaddinghorizontalpercent" aria-label="Permalink to &quot;map.autoPaddingHorizontalPercent&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>0.05</code></li></ul><p>地图自适应时水平方向保留的最小边距比例(相对于视口宽度)。地图完成自适应后,左右边距不小于该比例值。</p><h3 id="map-autopaddingverticalpercent" tabindex="-1">map.autoPaddingVerticalPercent <a class="header-anchor" href="#map-autopaddingverticalpercent" aria-label="Permalink to &quot;map.autoPaddingVerticalPercent&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>0.05</code></li></ul><p>地图自适应时垂直方向保留的最小边距比例(相对于视口高度)。地图完成自适应后,上下边距不小于该比例值。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>这两个配置用于计算自适应缩放时的初始缩放比例。关于自适应缩放的完整说明,请参阅 <a href="/guide/advanced-usage.html#自适应缩放">自适应缩放</a>。</p></div><h3 id="map-obstaclecolor" tabindex="-1">map.obstacleColor <a class="header-anchor" href="#map-obstaclecolor" aria-label="Permalink to &quot;map.obstacleColor&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>ColorSource</code></li><li><strong>默认值</strong>: <code>&#39;#999999&#39;</code></li></ul><p>障碍点显示颜色。</p><h3 id="map-freecolor" tabindex="-1">map.freeColor <a class="header-anchor" href="#map-freecolor" aria-label="Permalink to &quot;map.freeColor&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>ColorSource</code></li><li><strong>默认值</strong>: <code>&#39;#ebebeb&#39;</code></li></ul><p>自由区域点显示颜色。(仅结构化地图可用)</p><h3 id="map-autofitoffset" tabindex="-1">map.autoFitOffset <a class="header-anchor" href="#map-autofitoffset" aria-label="Permalink to &quot;map.autoFitOffset&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>{ x: number; y: number }</code></li><li><strong>默认值</strong>: <code>{ x: 0, y: 0 }</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>地图自适应时的偏移量。</p><p>用于在地图自适应居中显示时,手动指定一个偏移值(例如为了避开底部的 Footer 组件或顶部的 Header 组件),使地图在视觉上保持在显示区域的中心。</p><h3 id="map-adjacencythreshold" tabindex="-1">map.adjacencyThreshold <a class="header-anchor" href="#map-adjacencythreshold" aria-label="Permalink to &quot;map.adjacencyThreshold&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>3</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>房间相邻判定阈值。</p><p>用于判断两个房间是否相邻的算法。两个房间的边界点距离小于等于此阈值时,认为它们相邻。</p><h3 id="map-originchangeautofitthreshold" tabindex="-1">map.originChangeAutoFitThreshold <a class="header-anchor" href="#map-originchangeautofitthreshold" aria-label="Permalink to &quot;map.originChangeAutoFitThreshold&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>2</code></li></ul><p>地图原点变化自适应阈值。当地图 origin 的 x 或 y 变化超过此值时,将触发自适应缩放。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>这是触发自适应缩放的条件之一。关于自适应缩放的完整说明,请参阅 <a href="/guide/advanced-usage.html#自适应缩放">自适应缩放</a>。</p></div><h3 id="map-sizechangeautofitthreshold" tabindex="-1">map.sizeChangeAutoFitThreshold <a class="header-anchor" href="#map-sizechangeautofitthreshold" aria-label="Permalink to &quot;map.sizeChangeAutoFitThreshold&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>10</code></li></ul><p>地图尺寸变化自适应阈值。当地图宽度或高度变化超过此值时,将触发自适应缩放。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>这是触发自适应缩放的条件之一。关于自适应缩放的完整说明,请参阅 <a href="/guide/advanced-usage.html#自适应缩放">自适应缩放</a>。</p></div><h2 id="heatmap" tabindex="-1">heatmap <a class="header-anchor" href="#heatmap" aria-label="Permalink to &quot;heatmap&quot;">​</a></h2><p>热力图配置,控制信号强度热力图的渲染效果。</p><h3 id="heatmap-cellsize" tabindex="-1">heatmap.cellSize <a class="header-anchor" href="#heatmap-cellsize" aria-label="Permalink to &quot;heatmap.cellSize&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>2</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>热力图单元格大小。</p><h3 id="heatmap-maxdistance" tabindex="-1">heatmap.maxDistance <a class="header-anchor" href="#heatmap-maxdistance" aria-label="Permalink to &quot;heatmap.maxDistance&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>14</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>热力图影响的最大距离。</p><h3 id="heatmap-smoothiterations" tabindex="-1">heatmap.smoothIterations <a class="header-anchor" href="#heatmap-smoothiterations" aria-label="Permalink to &quot;heatmap.smoothIterations&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>10</code></li></ul><p>热力图平滑迭代次数。</p><h3 id="heatmap-heatmapalpha" tabindex="-1">heatmap.heatmapAlpha <a class="header-anchor" href="#heatmap-heatmapalpha" aria-label="Permalink to &quot;heatmap.heatmapAlpha&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>0.8</code></li></ul><p>热力图透明度 (0-1)。</p><h3 id="heatmap-usegradient" tabindex="-1">heatmap.useGradient <a class="header-anchor" href="#heatmap-usegradient" aria-label="Permalink to &quot;heatmap.useGradient&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否启用颜色渐变。关闭后会使用统一色阶渲染。</p><h3 id="heatmap-colorgradients" tabindex="-1">heatmap.colorGradients <a class="header-anchor" href="#heatmap-colorgradients" aria-label="Permalink to &quot;heatmap.colorGradients&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>[ColorSource, ColorSource, ColorSource, ColorSource, ColorSource, ColorSource, ColorSource, ColorSource]</code></li><li><strong>默认值</strong>: <code>[&#39;#FF3B30&#39;, &#39;#FF7A00&#39;, &#39;#FFA100&#39;, &#39;#FFD700&#39;, &#39;#99DD70&#39;, &#39;#2EC070&#39;, &#39;#40E0D0&#39;, &#39;#88D0E9&#39;]</code></li></ul><p>热力图颜色渐变配置,从高强度到低强度。</p><h2 id="room" tabindex="-1">room <a class="header-anchor" href="#room" aria-label="Permalink to &quot;room&quot;">​</a></h2><p>房间配置,控制房间的颜色、名称、属性显示等。</p><h3 id="room-colors" tabindex="-1">room.colors <a class="header-anchor" href="#room-colors" aria-label="Permalink to &quot;room.colors&quot;">​</a></h3><p>房间颜色配置对象。</p><div class="tip custom-block"><p class="custom-block-title">智能配色</p><p>SDK 使用<strong>智能配色算法</strong>,自动确保相邻房间颜色不同。</p><ul><li><strong>建议至少提供 4 种颜色</strong>(基于<a href="https://zh.wikipedia.org/wiki/%E5%9B%9B%E8%89%B2%E5%AE%9A%E7%90%86" target="_blank" rel="noreferrer">四色定理</a>,4种颜色足以满足平面地图需求)</li><li>所有数组类型的颜色配置(<code>active</code>、<code>inactive</code>、<code>name</code>、<code>propertyTheme</code> 等)<strong>建议长度一致</strong></li><li>如果有复杂的相邻房间情况,可以尝试增加更多的颜色,以确保相邻房间颜色不同</li></ul><p>关于智能配色算法的完整说明、配色策略和实际案例,请参阅 <a href="/guide/advanced-usage.html#房间智能配色">房间智能配色</a>。</p></div><h3 id="room-colors-sortby" tabindex="-1">room.colors.sortBy <a class="header-anchor" href="#room-colors-sortby" aria-label="Permalink to &quot;room.colors.sortBy&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>&#39;index&#39; | &#39;area&#39;</code></li><li><strong>默认值</strong>: <code>&#39;index&#39;</code></li></ul><p>房间颜色排序方式。</p><ul><li><code>index</code>:按房间ID排序,保持颜色分配稳定。</li><li><code>area</code>:按房间面积排序,大房间将优先分配索引靠前的颜色。</li></ul><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>使用 <code>area</code> 可能会导致机器导航过程中颜色的突然变化(房间大小变化引起),建议谨慎使用。</p></div><h3 id="room-colors-strategy" tabindex="-1">room.colors.strategy <a class="header-anchor" href="#room-colors-strategy" aria-label="Permalink to &quot;room.colors.strategy&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>&#39;priority&#39; | &#39;balanced&#39;</code></li><li><strong>默认值</strong>: <code>&#39;priority&#39;</code></li></ul><p>房间颜色分配策略。</p><ul><li><code>priority</code>:靠前优先,索引靠前的颜色将被优先使用。</li><li><code>balanced</code>:均匀分配,颜色将被尽可能均匀地使用。</li></ul><h4 id="room-colors-active" tabindex="-1">room.colors.active <a class="header-anchor" href="#room-colors-active" aria-label="Permalink to &quot;room.colors.active&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[&#39;#a8c8f5&#39;, &#39;#9de5c7&#39;, &#39;#d4b9f7&#39;, &#39;#ffd399&#39;]</code></li></ul><p>房间激活状态的颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li><strong>当 <code>enableRoomSelection: true</code> 时</strong>:代表“被选中”房间的填充色。</li><li><strong>当 <code>enableRoomSelection: false</code> 时</strong>:若未定义 <code>room.colors.normal</code>,默认使用此配置。</li></ul></div><h4 id="room-colors-inactive" tabindex="-1">room.colors.inactive <a class="header-anchor" href="#room-colors-inactive" aria-label="Permalink to &quot;room.colors.inactive&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[&#39;#d6e7fc&#39;, &#39;#d1f4e5&#39;, &#39;#ece0fb&#39;, &#39;#fff0d9&#39;]</code></li></ul><p>房间非激活状态的颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>仅在 <code>enableRoomSelection: true</code> 且房间“未被选中”时生效。</p></div><p>颜色索引与 <code>active</code> 对应,建议长度保持一致。</p><h4 id="room-colors-normal" tabindex="-1">room.colors.normal <a class="header-anchor" href="#room-colors-normal" aria-label="Permalink to &quot;room.colors.normal&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>undefined</code></li></ul><p>房间在普通展示模式下的填充颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>仅在 <code>enableRoomSelection: false</code> 时生效。若未定义,默认使用 <code>room.colors.active</code> 的配置。</p></div><h4 id="room-colors-name" tabindex="-1">room.colors.name <a class="header-anchor" href="#room-colors-name" aria-label="Permalink to &quot;room.colors.name&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[&#39;#2563b8&#39;, &#39;#26966b&#39;, &#39;#7c3fb8&#39;, &#39;#d97706&#39;]</code></li></ul><p>房间名称标签的颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li><strong>当 <code>enableRoomSelection: true</code> 时</strong>:代表“被选中”房间的文字颜色。</li><li><strong>当 <code>enableRoomSelection: false</code> 时</strong>:若未定义 <code>room.colors.nameNormal</code>,默认使用此配置。</li></ul></div><p>颜色索引与 <code>active</code> 对应,建议长度保持一致。</p><h4 id="room-colors-nameinactive" tabindex="-1">room.colors.nameInactive <a class="header-anchor" href="#room-colors-nameinactive" aria-label="Permalink to &quot;room.colors.nameInactive&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>undefined</code></li></ul><p>房间名称标签在非激活状态下的颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>仅在 <code>enableRoomSelection: true</code> 且房间“未被选中”时生效。</p></div><p>如果不配置,则默认使用 <code>room.colors.name</code>。</p><h4 id="room-colors-namenormal" tabindex="-1">room.colors.nameNormal <a class="header-anchor" href="#room-colors-namenormal" aria-label="Permalink to &quot;room.colors.nameNormal&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>undefined</code></li></ul><p>房间名称标签在普通展示模式下的颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>仅在 <code>enableRoomSelection: false</code> 时生效。若未定义,默认使用 <code>room.colors.name</code> 的配置。</p></div><h4 id="room-colors-propertytheme" tabindex="-1">room.colors.propertyTheme <a class="header-anchor" href="#room-colors-propertytheme" aria-label="Permalink to &quot;room.colors.propertyTheme&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[&#39;#2563b8&#39;, &#39;#26966b&#39;, &#39;#7c3fb8&#39;, &#39;#d97706&#39;]</code></li></ul><p>房间属性图标主题颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li><strong>当 <code>enableRoomSelection: true</code> 时</strong>:代表“被选中”房间的图标颜色。</li><li><strong>当 <code>enableRoomSelection: false</code> 时</strong>:若未定义 <code>room.colors.propertyThemeNormal</code>,默认使用此配置。</li></ul></div><p>颜色索引与 <code>active</code> 对应,建议长度保持一致。</p><h4 id="room-colors-propertythemeinactive" tabindex="-1">room.colors.propertyThemeInactive <a class="header-anchor" href="#room-colors-propertythemeinactive" aria-label="Permalink to &quot;room.colors.propertyThemeInactive&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>undefined</code></li></ul><p>房间属性图标在非激活状态下的颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>仅在 <code>enableRoomSelection: true</code> 且房间“未被选中”时生效。</p></div><p>如果不配置,则默认使用 <code>room.colors.propertyTheme</code>。</p><h4 id="room-colors-propertythemenormal" tabindex="-1">room.colors.propertyThemeNormal <a class="header-anchor" href="#room-colors-propertythemenormal" aria-label="Permalink to &quot;room.colors.propertyThemeNormal&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>undefined</code></li></ul><p>房间属性图标在普通展示模式下的主题颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>仅在 <code>enableRoomSelection: false</code> 时生效。若未定义,默认使用 <code>room.colors.propertyTheme</code> 的配置。</p></div><h4 id="room-colors-selectionindicatorbackground" tabindex="-1">room.colors.selectionIndicatorBackground <a class="header-anchor" href="#room-colors-selectionindicatorbackground" aria-label="Permalink to &quot;room.colors.selectionIndicatorBackground&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[&#39;#2563b8&#39;, &#39;#26966b&#39;, &#39;#7c3fb8&#39;, &#39;#d97706&#39;]</code></li></ul><p>选择指示器背景颜色数组。</p><p>颜色索引与 <code>active</code> 对应,建议长度保持一致。</p><h4 id="room-colors-selectionindicatoricon" tabindex="-1">room.colors.selectionIndicatorIcon <a class="header-anchor" href="#room-colors-selectionindicatoricon" aria-label="Permalink to &quot;room.colors.selectionIndicatorIcon&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[&#39;#ffffff&#39;, &#39;#ffffff&#39;, &#39;#ffffff&#39;, &#39;#ffffff&#39;]</code></li></ul><p>选择指示器图标颜色数组。</p><p>颜色索引与 <code>active</code> 对应,建议长度保持一致。</p><h4 id="room-colors-no-room-data" tabindex="-1">room.colors.NO_ROOM_DATA <a class="header-anchor" href="#room-colors-no-room-data" aria-label="Permalink to &quot;room.colors.NO_ROOM_DATA&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>&#39;#ebebeb&#39;</code></li></ul><p>无房间数据区域的颜色 (点阵协议专用)。</p><h4 id="room-colors-room-gap" tabindex="-1">room.colors.ROOM_GAP <a class="header-anchor" href="#room-colors-room-gap" aria-label="Permalink to &quot;room.colors.ROOM_GAP&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>&#39;#ebebeb&#39;</code></li></ul><p>房间间隙的颜色 (点阵协议专用)。</p><h4 id="room-colors-obstacle-room" tabindex="-1">room.colors.OBSTACLE_ROOM <a class="header-anchor" href="#room-colors-obstacle-room" aria-label="Permalink to &quot;room.colors.OBSTACLE_ROOM&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>&#39;#ebebeb&#39;</code></li></ul><p>障碍物房间的颜色 (点阵协议专用)。</p><h4 id="room-colors-unknown-room" tabindex="-1">room.colors.UNKNOWN_ROOM <a class="header-anchor" href="#room-colors-unknown-room" aria-label="Permalink to &quot;room.colors.UNKNOWN_ROOM&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>&#39;#ebebeb&#39;</code></li></ul><p>未知房间的颜色。对于结构化协议代表 <code>roomId &gt;= 255</code> 的房间颜色。</p><h4 id="room-colors-version0-room" tabindex="-1">room.colors.VERSION0_ROOM <a class="header-anchor" href="#room-colors-version0-room" aria-label="Permalink to &quot;room.colors.VERSION0_ROOM&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>&#39;&#39;</code></li></ul><p>点阵地图协议版本0的房间颜色 (点阵协议专用)。</p><div class="tip custom-block"><p class="custom-block-title">版本兼容说明</p><p>此配置项用于控制地图协议版本0(未支持分区的协议版本)中房间的颜色。在之前的版本中,版本0的房间和无房间数据区域都使用 <code>NO_ROOM_DATA</code> 颜色。现已将版本0的房间单独拆分为 <code>VERSION0_ROOM</code>。</p><p>默认值为空字符串,此时将自动使用 <code>NO_ROOM_DATA</code> 的颜色,以保持向后兼容。如需区分显示,可配置为不同的颜色值。</p></div><h3 id="room-namelabel" tabindex="-1">room.nameLabel <a class="header-anchor" href="#room-namelabel" aria-label="Permalink to &quot;room.nameLabel&quot;">​</a></h3><p>房间名称标签配置。</p><h4 id="room-namelabel-fontsize" tabindex="-1">room.nameLabel.fontSize <a class="header-anchor" href="#room-namelabel-fontsize" aria-label="Permalink to &quot;room.nameLabel.fontSize&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>12</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>房间名称字体大小。</p><h4 id="room-namelabel-fontfamily" tabindex="-1">room.nameLabel.fontFamily <a class="header-anchor" href="#room-namelabel-fontfamily" aria-label="Permalink to &quot;room.nameLabel.fontFamily&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>&#39;system-ui, -apple-system, sans-serif&#39;</code></li></ul><p>房间名称字体名称。</p><h4 id="room-namelabel-fontweight" tabindex="-1">room.nameLabel.fontWeight <a class="header-anchor" href="#room-namelabel-fontweight" aria-label="Permalink to &quot;room.nameLabel.fontWeight&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>TextStyleFontWeight</code></li><li><strong>默认值</strong>: <code>&#39;500&#39;</code></li></ul><p>房间名称字体粗细。</p><h3 id="room-type" tabindex="-1">room.type <a class="header-anchor" href="#room-type" aria-label="Permalink to &quot;room.type&quot;">​</a></h3><p>房间类型图标配置。</p><h4 id="room-type-assets" tabindex="-1">room.type.assets <a class="header-anchor" href="#room-type-assets" aria-label="Permalink to &quot;room.type.assets&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[内置资源, ...]</code></li></ul><p>房间类型图标资源数组。</p><p>数组索引对应 <code>RoomProperty.type</code> 值,即 <code>assets[type]</code> 显示该索引对应的图标。</p><p><strong>内置默认资源映射表:</strong></p><p>以下是内置默认图标与 <code>type</code> 值的对应关系:</p><table tabindex="0"><thead><tr><th style="text-align:left;">ID (索引)</th><th style="text-align:left;">房间类型</th></tr></thead><tbody><tr><td style="text-align:left;">0</td><td style="text-align:left;">通用/房间</td></tr><tr><td style="text-align:left;">1</td><td style="text-align:left;">客厅</td></tr><tr><td style="text-align:left;">2</td><td style="text-align:left;">餐厅</td></tr><tr><td style="text-align:left;">3</td><td style="text-align:left;">主卧</td></tr><tr><td style="text-align:left;">4</td><td style="text-align:left;">次卧/卧室</td></tr><tr><td style="text-align:left;">5</td><td style="text-align:left;">书房</td></tr><tr><td style="text-align:left;">6</td><td style="text-align:left;">厨房</td></tr><tr><td style="text-align:left;">7</td><td style="text-align:left;">卫生间</td></tr><tr><td style="text-align:left;">8</td><td style="text-align:left;">洗衣房</td></tr><tr><td style="text-align:left;">9</td><td style="text-align:left;">休息室</td></tr><tr><td style="text-align:left;">10</td><td style="text-align:left;">储物间</td></tr><tr><td style="text-align:left;">11</td><td style="text-align:left;">儿童房</td></tr><tr><td style="text-align:left;">12</td><td style="text-align:left;">阳光房</td></tr><tr><td style="text-align:left;">13</td><td style="text-align:left;">走廊</td></tr><tr><td style="text-align:left;">14</td><td style="text-align:left;">阳台</td></tr><tr><td style="text-align:left;">15</td><td style="text-align:left;">健身房</td></tr><tr><td style="text-align:left;">16</td><td style="text-align:left;">玄关</td></tr></tbody></table><p>当使用内置默认资源时,索引与房间类型的对应关系详见<a href="/guide/advanced-usage.html#房间类型图标">房间类型图标</a>。如果开发者通过此配置项自定义了数组,则映射关系完全取决于自定义数组的顺序。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>如果某个索引对应的资源为空字符串(<code>&#39;&#39;</code>),则该类型的房间将不会显示任何图标。例如,通过设置 <code>assets[0] = &#39;&#39;</code> 可以隐藏 type 为 0 的房间图标。</p></div><h4 id="room-type-iconsize" tabindex="-1">room.type.iconSize <a class="header-anchor" href="#room-type-iconsize" aria-label="Permalink to &quot;room.type.iconSize&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>12</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>房间类型图标大小。</p><h4 id="room-type-gap" tabindex="-1">room.type.gap <a class="header-anchor" href="#room-type-gap" aria-label="Permalink to &quot;room.type.gap&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>4</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>图标与房间名称文字之间的间距。</p><h4 id="room-type-position" tabindex="-1">room.type.position <a class="header-anchor" href="#room-type-position" aria-label="Permalink to &quot;room.type.position&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>&#39;left&#39; | &#39;right&#39;</code></li><li><strong>默认值</strong>: <code>&#39;left&#39;</code></li></ul><p>图标相对于房间名称文字的显示位置。</p><h4 id="room-type-container" tabindex="-1">room.type.container <a class="header-anchor" href="#room-type-container" aria-label="Permalink to &quot;room.type.container&quot;">​</a></h4><p>房间类型图标背景容器配置。</p><h5 id="room-type-container-visible" tabindex="-1">room.type.container.visible <a class="header-anchor" href="#room-type-container-visible" aria-label="Permalink to &quot;room.type.container.visible&quot;">​</a></h5><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示背景容器。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li><strong>颜色逻辑</strong>: <ul><li>当开启背景容器(<code>container.visible: true</code>)时,背景将填充为房间名称颜色(<code>room.colors.name</code>),图标将自动设置为白色(<code>tint: #ffffff</code>)。</li><li>当禁用背景容器(<code>container.visible: false</code>)时,图标将直接使用房间名称颜色(<code>room.colors.name</code>)。</li></ul></li><li><strong>最佳实践</strong>:为了实现自动换色效果,建议使用单色(通常为黑色或白色)的 SVG 资源。如果使用彩色 PNG 资源,建议将 <code>container.visible</code> 设为 <code>false</code> 以保持原色。</li></ul></div><h5 id="room-type-container-size" tabindex="-1">room.type.container.size <a class="header-anchor" href="#room-type-container-size" aria-label="Permalink to &quot;room.type.container.size&quot;">​</a></h5><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>16</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>背景容器大小。</p><h5 id="room-type-container-borderradius" tabindex="-1">room.type.container.borderRadius <a class="header-anchor" href="#room-type-container-borderradius" aria-label="Permalink to &quot;room.type.container.borderRadius&quot;">​</a></h5><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>16</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>背景容器圆角大小。</p><h3 id="room-property" tabindex="-1">room.property <a class="header-anchor" href="#room-property" aria-label="Permalink to &quot;room.property&quot;">​</a></h3><p>房间属性配置。</p><h4 id="room-property-displayorders" tabindex="-1">room.property.displayOrders <a class="header-anchor" href="#room-property-displayorders" aria-label="Permalink to &quot;room.property.displayOrders&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>(&#39;cleanMode&#39; | &#39;suction&#39; | &#39;cistern&#39; | &#39;cleanTimes&#39; | string)[]</code></li><li><strong>默认值</strong>: <code>[&#39;cleanMode&#39;, &#39;suction&#39;, &#39;cistern&#39;, &#39;cleanTimes&#39;]</code></li></ul><p>房间属性显示顺序。</p><p>你也可以传入自定义的字段名,比如 <code>[&#39;cleanMode&#39;, &#39;suction&#39;, &#39;cistern&#39;, &#39;cleanTimes&#39;, &#39;customProperty1&#39;]</code>。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>如果要隐藏某个房间属性,比如 <code>cleanTimes</code>,那么清扫次数图标将不会显示。</p></div><h4 id="room-property-customassets" tabindex="-1">room.property.customAssets <a class="header-anchor" href="#room-property-customassets" aria-label="Permalink to &quot;room.property.customAssets&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>Record&lt;string, string[]&gt;</code></li><li><strong>默认值</strong>: <code>undefined</code></li></ul><p>自定义属性图标资源配置,</p><p>你可以传入自定义的字段名和对应的图标资源数组,比如:</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:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
169
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p><strong>fit 模式说明:</strong></p><ul><li><code>fill</code>:拉伸填充整个视口</li><li><code>contain</code>:完整显示图片,保持宽高比,可能有留白</li><li><code>cover</code>(默认):覆盖整个视口,保持宽高比,可能裁剪</li><li><code>none</code>:原始尺寸显示</li></ul><h3 id="global-backgroundalpha" tabindex="-1">global.backgroundAlpha <a class="header-anchor" href="#global-backgroundalpha" aria-label="Permalink to &quot;global.backgroundAlpha&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>1</code></li></ul><p>地图容器背景透明度。</p><div class="warning custom-block"><p class="custom-block-title">注意</p><p>该配置仅对<strong>纯色背景</strong> (<code>backgroundColor</code>) 和<strong>图片背景</strong> (<code>backgroundImage</code>) 生效。</p><p>对于<strong>渐变背景</strong> (<code>backgroundGradient</code>),请直接在 <code>colorStops</code> 中使用 <code>rgba</code> 颜色值(如 <code>&#39;rgba(255, 255, 255, 0.5)&#39;</code>)来控制透明度。</p></div><h3 id="global-performancemode" tabindex="-1">global.performanceMode <a class="header-anchor" href="#global-performancemode" aria-label="Permalink to &quot;global.performanceMode&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否开启高性能模式。开启后,SDK 会优化渲染性能(如强制关闭抗锯齿、共享时钟等),建议在多地图展示等对性能要求较高的场景下开启。</p><h3 id="global-resolution" tabindex="-1">global.resolution <a class="header-anchor" href="#global-resolution" aria-label="Permalink to &quot;global.resolution&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>window.devicePixelRatio</code></li></ul><p>渲染分辨率倍率。通常不需要手动设置,SDK 会自动获取设备的像素密度。在性能极度受限的场景下,可以手动将其设为 <code>1</code> 或 <code>1.5</code> 来降低 GPU 渲染压力。</p><h3 id="global-enablelogger" tabindex="-1">global.enableLogger <a class="header-anchor" href="#global-enablelogger" aria-label="Permalink to &quot;global.enableLogger&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>import.meta.env.DEV</code></li></ul><p>是否启用日志输出的旧配置项。当设置为 <code>true</code> 时,SDK 会输出内部日志(<code>Logger.log</code>、<code>Logger.warn</code>、<code>Logger.error</code>、<code>Logger.debug</code>、<code>Logger.success</code>);当设置为 <code>false</code> 时,所有日志都不会输出。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>默认值会跟随构建环境:开发环境通常为 <code>true</code>,生产环境通常为 <code>false</code>。 建议仅在排查问题时开启此选项。</p><p>对于新接入,优先使用 <code>logger.enabled</code>。<code>global.enableLogger</code> 仅作为控制控制台日志的兼容兜底,不再负责 App 日志转发。</p></div><h3 id="global-rendererpreference" tabindex="-1">global.rendererPreference <a class="header-anchor" href="#global-rendererpreference" aria-label="Permalink to &quot;global.rendererPreference&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>&#39;webgpu&#39; | &#39;webgl&#39;</code></li><li><strong>默认值</strong>: <code>&#39;webgpu&#39;</code></li></ul><p>渲染器偏好,设置 PIXI.js 优先使用的渲染后端。</p><h2 id="logger" tabindex="-1">logger <a class="header-anchor" href="#logger" aria-label="Permalink to &quot;logger&quot;">​</a></h2><p><code>logger</code> 配置用于控制 SDK 的控制台日志和可选的宿主日志转发。这一组配置不会强依赖任何业务日志库;只有当宿主层实现了 <code>onLogger</code> 回调时,日志才会被转发到 App 层。</p><h3 id="logger-enabled" tabindex="-1">logger.enabled <a class="header-anchor" href="#logger-enabled" aria-label="Permalink to &quot;logger.enabled&quot;">​</a></h3><p><code>logger.enabled</code> 控制 SDK 在 webview 控制台中的日志输出。</p><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>import.meta.env.DEV</code></li></ul><p>当设置为 <code>true</code> 时,SDK 会输出内部日志到控制台;当设置为 <code>false</code> 时,控制台日志关闭。这个字段优先级高于 <code>global.enableLogger</code>。</p><h3 id="logger-hostsinkenabled" tabindex="-1">logger.hostSinkEnabled <a class="header-anchor" href="#logger-hostsinkenabled" aria-label="Permalink to &quot;logger.hostSinkEnabled&quot;">​</a></h3><p><code>logger.hostSinkEnabled</code> 控制是否尝试把结构化日志转发给宿主层。</p><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>当设置为 <code>true</code> 时,SDK 会在满足 <code>hostLevels</code> 过滤条件后,把日志 payload 转发给宿主层的 <code>onLogger</code> 回调。如果宿主层没有实现 <code>onLogger</code>,SDK 会静默跳过,不会报错。</p><h3 id="logger-hostlevels" tabindex="-1">logger.hostLevels <a class="header-anchor" href="#logger-hostlevels" aria-label="Permalink to &quot;logger.hostLevels&quot;">​</a></h3><p><code>logger.hostLevels</code> 控制哪些日志级别会被转发到宿主层。</p><ul><li><strong>类型</strong>: <code>Array&lt;&#39;warn&#39; | &#39;error&#39; | &#39;info&#39; | &#39;debug&#39;&gt;</code></li><li><strong>默认值</strong>: <code>[&#39;warn&#39;, &#39;error&#39;]</code></li></ul><p>默认只转发 <code>warn</code> 和 <code>error</code>。如果你需要在诊断阶段同时采集 <code>info</code> 或 <code>debug</code>,可以显式把这些级别加入数组中。</p><h3 id="logger-tag" tabindex="-1">logger.tag <a class="header-anchor" href="#logger-tag" aria-label="Permalink to &quot;logger.tag&quot;">​</a></h3><p><code>logger.tag</code> 用于标识日志来源,方便宿主层在 App 日志里检索和过滤。</p><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>&#39;ray-robot-map-sdk&#39;</code></li></ul><p>业务侧可以直接使用这个字段作为日志前缀,也可以组合自己的 App tag 一起输出。</p><h2 id="interaction" tabindex="-1">interaction <a class="header-anchor" href="#interaction" aria-label="Permalink to &quot;interaction&quot;">​</a></h2><p>交互配置,控制地图的缩放和手势操作。</p><h3 id="interaction-zoomrange" tabindex="-1">interaction.zoomRange <a class="header-anchor" href="#interaction-zoomrange" aria-label="Permalink to &quot;interaction.zoomRange&quot;">​</a></h3><p>缩放范围配置。</p><h4 id="interaction-zoomrange-min" tabindex="-1">interaction.zoomRange.min <a class="header-anchor" href="#interaction-zoomrange-min" aria-label="Permalink to &quot;interaction.zoomRange.min&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>0.5</code></li></ul><p>地图初始化后,支持的最小缩放倍数</p><h4 id="interaction-zoomrange-max" tabindex="-1">interaction.zoomRange.max <a class="header-anchor" href="#interaction-zoomrange-max" aria-label="Permalink to &quot;interaction.zoomRange.max&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>8</code></li></ul><p>地图初始化后,支持的最大缩放倍数</p><h3 id="interaction-fitminscale" tabindex="-1">interaction.fitMinScale <a class="header-anchor" href="#interaction-fitminscale" aria-label="Permalink to &quot;interaction.fitMinScale&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>1</code></li></ul><p>自适应缩放时的最小比例。限制地图缩小的最小程度。</p><h3 id="interaction-fitmaxscale" tabindex="-1">interaction.fitMaxScale <a class="header-anchor" href="#interaction-fitmaxscale" aria-label="Permalink to &quot;interaction.fitMaxScale&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>4</code></li></ul><p>自适应缩放时的最大比例。限制地图放大的最大程度。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>关于自适应缩放的完整说明,包括触发时机、计算逻辑和常见问题,请参阅 <a href="/guide/advanced-usage.html#自适应缩放">自适应缩放</a>。</p></div><h3 id="interaction-enable" tabindex="-1">interaction.enable <a class="header-anchor" href="#interaction-enable" aria-label="Permalink to &quot;interaction.enable&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否开启地图交互总控。设置为 <code>false</code> 时,将完全从底层禁用地图的缩放、平移和点击等交互事件监听,极大减少交互带来的性能开销。</p><h3 id="interaction-enabledoubletapzoom" tabindex="-1">interaction.enableDoubleTapZoom <a class="header-anchor" href="#interaction-enabledoubletapzoom" aria-label="Permalink to &quot;interaction.enableDoubleTapZoom&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否启用双击缩放功能</p><h3 id="interaction-enablerobotclick" tabindex="-1">interaction.enableRobotClick <a class="header-anchor" href="#interaction-enablerobotclick" aria-label="Permalink to &quot;interaction.enableRobotClick&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否启用扫地机器人的点击交互功能。</p><h3 id="interaction-enablechargingstationclick" tabindex="-1">interaction.enableChargingStationClick <a class="header-anchor" href="#interaction-enablechargingstationclick" aria-label="Permalink to &quot;interaction.enableChargingStationClick&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否启用充电桩的点击交互功能。</p><h2 id="map" tabindex="-1">map <a class="header-anchor" href="#map" aria-label="Permalink to &quot;map&quot;">​</a></h2><p>地图配置。</p><h3 id="map-autopaddinghorizontalpercent" tabindex="-1">map.autoPaddingHorizontalPercent <a class="header-anchor" href="#map-autopaddinghorizontalpercent" aria-label="Permalink to &quot;map.autoPaddingHorizontalPercent&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>0.05</code></li></ul><p>地图自适应时水平方向保留的最小边距比例(相对于视口宽度)。地图完成自适应后,左右边距不小于该比例值。</p><h3 id="map-autopaddingverticalpercent" tabindex="-1">map.autoPaddingVerticalPercent <a class="header-anchor" href="#map-autopaddingverticalpercent" aria-label="Permalink to &quot;map.autoPaddingVerticalPercent&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>0.05</code></li></ul><p>地图自适应时垂直方向保留的最小边距比例(相对于视口高度)。地图完成自适应后,上下边距不小于该比例值。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>这两个配置用于计算自适应缩放时的初始缩放比例。关于自适应缩放的完整说明,请参阅 <a href="/guide/advanced-usage.html#自适应缩放">自适应缩放</a>。</p></div><h3 id="map-obstaclecolor" tabindex="-1">map.obstacleColor <a class="header-anchor" href="#map-obstaclecolor" aria-label="Permalink to &quot;map.obstacleColor&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>ColorSource</code></li><li><strong>默认值</strong>: <code>&#39;#999999&#39;</code></li></ul><p>障碍点显示颜色。</p><h3 id="map-freecolor" tabindex="-1">map.freeColor <a class="header-anchor" href="#map-freecolor" aria-label="Permalink to &quot;map.freeColor&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>ColorSource</code></li><li><strong>默认值</strong>: <code>&#39;#ebebeb&#39;</code></li></ul><p>自由区域点显示颜色。(仅结构化地图可用)</p><h3 id="map-autofitoffset" tabindex="-1">map.autoFitOffset <a class="header-anchor" href="#map-autofitoffset" aria-label="Permalink to &quot;map.autoFitOffset&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>{ x: number; y: number }</code></li><li><strong>默认值</strong>: <code>{ x: 0, y: 0 }</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>地图自适应时的偏移量。</p><p>用于在地图自适应居中显示时,手动指定一个偏移值(例如为了避开底部的 Footer 组件或顶部的 Header 组件),使地图在视觉上保持在显示区域的中心。</p><h3 id="map-adjacencythreshold" tabindex="-1">map.adjacencyThreshold <a class="header-anchor" href="#map-adjacencythreshold" aria-label="Permalink to &quot;map.adjacencyThreshold&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>3</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>房间相邻判定阈值。</p><p>用于判断两个房间是否相邻的算法。两个房间的边界点距离小于等于此阈值时,认为它们相邻。</p><h3 id="map-originchangeautofitthreshold" tabindex="-1">map.originChangeAutoFitThreshold <a class="header-anchor" href="#map-originchangeautofitthreshold" aria-label="Permalink to &quot;map.originChangeAutoFitThreshold&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>2</code></li></ul><p>地图原点变化自适应阈值。当地图 origin 的 x 或 y 变化超过此值时,将触发自适应缩放。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>这是触发自适应缩放的条件之一。关于自适应缩放的完整说明,请参阅 <a href="/guide/advanced-usage.html#自适应缩放">自适应缩放</a>。</p></div><h3 id="map-sizechangeautofitthreshold" tabindex="-1">map.sizeChangeAutoFitThreshold <a class="header-anchor" href="#map-sizechangeautofitthreshold" aria-label="Permalink to &quot;map.sizeChangeAutoFitThreshold&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>10</code></li></ul><p>地图尺寸变化自适应阈值。当地图宽度或高度变化超过此值时,将触发自适应缩放。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>这是触发自适应缩放的条件之一。关于自适应缩放的完整说明,请参阅 <a href="/guide/advanced-usage.html#自适应缩放">自适应缩放</a>。</p></div><h2 id="heatmap" tabindex="-1">heatmap <a class="header-anchor" href="#heatmap" aria-label="Permalink to &quot;heatmap&quot;">​</a></h2><p>热力图配置,控制信号强度热力图的渲染效果。</p><h3 id="heatmap-cellsize" tabindex="-1">heatmap.cellSize <a class="header-anchor" href="#heatmap-cellsize" aria-label="Permalink to &quot;heatmap.cellSize&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>2</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>热力图单元格大小。</p><h3 id="heatmap-maxdistance" tabindex="-1">heatmap.maxDistance <a class="header-anchor" href="#heatmap-maxdistance" aria-label="Permalink to &quot;heatmap.maxDistance&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>14</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>热力图影响的最大距离。</p><h3 id="heatmap-smoothiterations" tabindex="-1">heatmap.smoothIterations <a class="header-anchor" href="#heatmap-smoothiterations" aria-label="Permalink to &quot;heatmap.smoothIterations&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>10</code></li></ul><p>热力图平滑迭代次数。</p><h3 id="heatmap-heatmapalpha" tabindex="-1">heatmap.heatmapAlpha <a class="header-anchor" href="#heatmap-heatmapalpha" aria-label="Permalink to &quot;heatmap.heatmapAlpha&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>0.8</code></li></ul><p>热力图透明度 (0-1)。</p><h3 id="heatmap-usegradient" tabindex="-1">heatmap.useGradient <a class="header-anchor" href="#heatmap-usegradient" aria-label="Permalink to &quot;heatmap.useGradient&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否启用颜色渐变。关闭后会使用统一色阶渲染。</p><h3 id="heatmap-colorgradients" tabindex="-1">heatmap.colorGradients <a class="header-anchor" href="#heatmap-colorgradients" aria-label="Permalink to &quot;heatmap.colorGradients&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>[ColorSource, ColorSource, ColorSource, ColorSource, ColorSource, ColorSource, ColorSource, ColorSource]</code></li><li><strong>默认值</strong>: <code>[&#39;#FF3B30&#39;, &#39;#FF7A00&#39;, &#39;#FFA100&#39;, &#39;#FFD700&#39;, &#39;#99DD70&#39;, &#39;#2EC070&#39;, &#39;#40E0D0&#39;, &#39;#88D0E9&#39;]</code></li></ul><p>热力图颜色渐变配置,从高强度到低强度。</p><h2 id="room" tabindex="-1">room <a class="header-anchor" href="#room" aria-label="Permalink to &quot;room&quot;">​</a></h2><p>房间配置,控制房间的颜色、名称、属性显示等。</p><h3 id="room-colors" tabindex="-1">room.colors <a class="header-anchor" href="#room-colors" aria-label="Permalink to &quot;room.colors&quot;">​</a></h3><p>房间颜色配置对象。</p><div class="tip custom-block"><p class="custom-block-title">智能配色</p><p>SDK 使用<strong>智能配色算法</strong>,自动确保相邻房间颜色不同。</p><ul><li><strong>建议至少提供 4 种颜色</strong>(基于<a href="https://zh.wikipedia.org/wiki/%E5%9B%9B%E8%89%B2%E5%AE%9A%E7%90%86" target="_blank" rel="noreferrer">四色定理</a>,4种颜色足以满足平面地图需求)</li><li>所有数组类型的颜色配置(<code>active</code>、<code>inactive</code>、<code>name</code>、<code>propertyTheme</code> 等)<strong>建议长度一致</strong></li><li>如果有复杂的相邻房间情况,可以尝试增加更多的颜色,以确保相邻房间颜色不同</li></ul><p>关于智能配色算法的完整说明、配色策略和实际案例,请参阅 <a href="/guide/advanced-usage.html#房间智能配色">房间智能配色</a>。</p></div><h3 id="room-colors-sortby" tabindex="-1">room.colors.sortBy <a class="header-anchor" href="#room-colors-sortby" aria-label="Permalink to &quot;room.colors.sortBy&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>&#39;index&#39; | &#39;area&#39;</code></li><li><strong>默认值</strong>: <code>&#39;index&#39;</code></li></ul><p>房间颜色排序方式。</p><ul><li><code>index</code>:按房间ID排序,保持颜色分配稳定。</li><li><code>area</code>:按房间面积排序,大房间将优先分配索引靠前的颜色。</li></ul><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>使用 <code>area</code> 可能会导致机器导航过程中颜色的突然变化(房间大小变化引起),建议谨慎使用。</p></div><h3 id="room-colors-strategy" tabindex="-1">room.colors.strategy <a class="header-anchor" href="#room-colors-strategy" aria-label="Permalink to &quot;room.colors.strategy&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>&#39;priority&#39; | &#39;balanced&#39;</code></li><li><strong>默认值</strong>: <code>&#39;priority&#39;</code></li></ul><p>房间颜色分配策略。</p><ul><li><code>priority</code>:靠前优先,索引靠前的颜色将被优先使用。</li><li><code>balanced</code>:均匀分配,颜色将被尽可能均匀地使用。</li></ul><h4 id="room-colors-active" tabindex="-1">room.colors.active <a class="header-anchor" href="#room-colors-active" aria-label="Permalink to &quot;room.colors.active&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[&#39;#a8c8f5&#39;, &#39;#9de5c7&#39;, &#39;#d4b9f7&#39;, &#39;#ffd399&#39;]</code></li></ul><p>房间激活状态的颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li><strong>当 <code>enableRoomSelection: true</code> 时</strong>:代表“被选中”房间的填充色。</li><li><strong>当 <code>enableRoomSelection: false</code> 时</strong>:若未定义 <code>room.colors.normal</code>,默认使用此配置。</li></ul></div><h4 id="room-colors-inactive" tabindex="-1">room.colors.inactive <a class="header-anchor" href="#room-colors-inactive" aria-label="Permalink to &quot;room.colors.inactive&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[&#39;#d6e7fc&#39;, &#39;#d1f4e5&#39;, &#39;#ece0fb&#39;, &#39;#fff0d9&#39;]</code></li></ul><p>房间非激活状态的颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>仅在 <code>enableRoomSelection: true</code> 且房间“未被选中”时生效。</p></div><p>颜色索引与 <code>active</code> 对应,建议长度保持一致。</p><h4 id="room-colors-normal" tabindex="-1">room.colors.normal <a class="header-anchor" href="#room-colors-normal" aria-label="Permalink to &quot;room.colors.normal&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>undefined</code></li></ul><p>房间在普通展示模式下的填充颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>仅在 <code>enableRoomSelection: false</code> 时生效。若未定义,默认使用 <code>room.colors.active</code> 的配置。</p></div><h4 id="room-colors-name" tabindex="-1">room.colors.name <a class="header-anchor" href="#room-colors-name" aria-label="Permalink to &quot;room.colors.name&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[&#39;#2563b8&#39;, &#39;#26966b&#39;, &#39;#7c3fb8&#39;, &#39;#d97706&#39;]</code></li></ul><p>房间名称标签的颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li><strong>当 <code>enableRoomSelection: true</code> 时</strong>:代表“被选中”房间的文字颜色。</li><li><strong>当 <code>enableRoomSelection: false</code> 时</strong>:若未定义 <code>room.colors.nameNormal</code>,默认使用此配置。</li></ul></div><p>颜色索引与 <code>active</code> 对应,建议长度保持一致。</p><h4 id="room-colors-nameinactive" tabindex="-1">room.colors.nameInactive <a class="header-anchor" href="#room-colors-nameinactive" aria-label="Permalink to &quot;room.colors.nameInactive&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>undefined</code></li></ul><p>房间名称标签在非激活状态下的颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>仅在 <code>enableRoomSelection: true</code> 且房间“未被选中”时生效。</p></div><p>如果不配置,则默认使用 <code>room.colors.name</code>。</p><h4 id="room-colors-namenormal" tabindex="-1">room.colors.nameNormal <a class="header-anchor" href="#room-colors-namenormal" aria-label="Permalink to &quot;room.colors.nameNormal&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>undefined</code></li></ul><p>房间名称标签在普通展示模式下的颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>仅在 <code>enableRoomSelection: false</code> 时生效。若未定义,默认使用 <code>room.colors.name</code> 的配置。</p></div><h4 id="room-colors-propertytheme" tabindex="-1">room.colors.propertyTheme <a class="header-anchor" href="#room-colors-propertytheme" aria-label="Permalink to &quot;room.colors.propertyTheme&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[&#39;#2563b8&#39;, &#39;#26966b&#39;, &#39;#7c3fb8&#39;, &#39;#d97706&#39;]</code></li></ul><p>房间属性图标主题颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li><strong>当 <code>enableRoomSelection: true</code> 时</strong>:代表“被选中”房间的图标颜色。</li><li><strong>当 <code>enableRoomSelection: false</code> 时</strong>:若未定义 <code>room.colors.propertyThemeNormal</code>,默认使用此配置。</li></ul></div><p>颜色索引与 <code>active</code> 对应,建议长度保持一致。</p><h4 id="room-colors-propertythemeinactive" tabindex="-1">room.colors.propertyThemeInactive <a class="header-anchor" href="#room-colors-propertythemeinactive" aria-label="Permalink to &quot;room.colors.propertyThemeInactive&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>undefined</code></li></ul><p>房间属性图标在非激活状态下的颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>仅在 <code>enableRoomSelection: true</code> 且房间“未被选中”时生效。</p></div><p>如果不配置,则默认使用 <code>room.colors.propertyTheme</code>。</p><h4 id="room-colors-propertythemenormal" tabindex="-1">room.colors.propertyThemeNormal <a class="header-anchor" href="#room-colors-propertythemenormal" aria-label="Permalink to &quot;room.colors.propertyThemeNormal&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>undefined</code></li></ul><p>房间属性图标在普通展示模式下的主题颜色数组。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>仅在 <code>enableRoomSelection: false</code> 时生效。若未定义,默认使用 <code>room.colors.propertyTheme</code> 的配置。</p></div><h4 id="room-colors-selectionindicatorbackground" tabindex="-1">room.colors.selectionIndicatorBackground <a class="header-anchor" href="#room-colors-selectionindicatorbackground" aria-label="Permalink to &quot;room.colors.selectionIndicatorBackground&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[&#39;#2563b8&#39;, &#39;#26966b&#39;, &#39;#7c3fb8&#39;, &#39;#d97706&#39;]</code></li></ul><p>选择指示器背景颜色数组。</p><p>颜色索引与 <code>active</code> 对应,建议长度保持一致。</p><h4 id="room-colors-selectionindicatoricon" tabindex="-1">room.colors.selectionIndicatorIcon <a class="header-anchor" href="#room-colors-selectionindicatoricon" aria-label="Permalink to &quot;room.colors.selectionIndicatorIcon&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[&#39;#ffffff&#39;, &#39;#ffffff&#39;, &#39;#ffffff&#39;, &#39;#ffffff&#39;]</code></li></ul><p>选择指示器图标颜色数组。</p><p>颜色索引与 <code>active</code> 对应,建议长度保持一致。</p><h4 id="room-colors-no-room-data" tabindex="-1">room.colors.NO_ROOM_DATA <a class="header-anchor" href="#room-colors-no-room-data" aria-label="Permalink to &quot;room.colors.NO_ROOM_DATA&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>&#39;#ebebeb&#39;</code></li></ul><p>无房间数据区域的颜色 (点阵协议专用)。</p><h4 id="room-colors-room-gap" tabindex="-1">room.colors.ROOM_GAP <a class="header-anchor" href="#room-colors-room-gap" aria-label="Permalink to &quot;room.colors.ROOM_GAP&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>&#39;#ebebeb&#39;</code></li></ul><p>房间间隙的颜色 (点阵协议专用)。</p><h4 id="room-colors-obstacle-room" tabindex="-1">room.colors.OBSTACLE_ROOM <a class="header-anchor" href="#room-colors-obstacle-room" aria-label="Permalink to &quot;room.colors.OBSTACLE_ROOM&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>&#39;#ebebeb&#39;</code></li></ul><p>障碍物房间的颜色 (点阵协议专用)。</p><h4 id="room-colors-unknown-room" tabindex="-1">room.colors.UNKNOWN_ROOM <a class="header-anchor" href="#room-colors-unknown-room" aria-label="Permalink to &quot;room.colors.UNKNOWN_ROOM&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>&#39;#ebebeb&#39;</code></li></ul><p>未知房间的颜色。对于结构化协议代表 <code>roomId &gt;= 255</code> 的房间颜色。</p><h4 id="room-colors-version0-room" tabindex="-1">room.colors.VERSION0_ROOM <a class="header-anchor" href="#room-colors-version0-room" aria-label="Permalink to &quot;room.colors.VERSION0_ROOM&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>&#39;&#39;</code></li></ul><p>点阵地图协议版本0的房间颜色 (点阵协议专用)。</p><div class="tip custom-block"><p class="custom-block-title">版本兼容说明</p><p>此配置项用于控制地图协议版本0(未支持分区的协议版本)中房间的颜色。在之前的版本中,版本0的房间和无房间数据区域都使用 <code>NO_ROOM_DATA</code> 颜色。现已将版本0的房间单独拆分为 <code>VERSION0_ROOM</code>。</p><p>默认值为空字符串,此时将自动使用 <code>NO_ROOM_DATA</code> 的颜色,以保持向后兼容。如需区分显示,可配置为不同的颜色值。</p></div><h3 id="room-namelabel" tabindex="-1">room.nameLabel <a class="header-anchor" href="#room-namelabel" aria-label="Permalink to &quot;room.nameLabel&quot;">​</a></h3><p>房间名称标签配置。</p><h4 id="room-namelabel-fontsize" tabindex="-1">room.nameLabel.fontSize <a class="header-anchor" href="#room-namelabel-fontsize" aria-label="Permalink to &quot;room.nameLabel.fontSize&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>12</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>房间名称字体大小。</p><h4 id="room-namelabel-fontfamily" tabindex="-1">room.nameLabel.fontFamily <a class="header-anchor" href="#room-namelabel-fontfamily" aria-label="Permalink to &quot;room.nameLabel.fontFamily&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>&#39;system-ui, -apple-system, sans-serif&#39;</code></li></ul><p>房间名称字体名称。</p><h4 id="room-namelabel-fontweight" tabindex="-1">room.nameLabel.fontWeight <a class="header-anchor" href="#room-namelabel-fontweight" aria-label="Permalink to &quot;room.nameLabel.fontWeight&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>TextStyleFontWeight</code></li><li><strong>默认值</strong>: <code>&#39;500&#39;</code></li></ul><p>房间名称字体粗细。</p><h3 id="room-type" tabindex="-1">room.type <a class="header-anchor" href="#room-type" aria-label="Permalink to &quot;room.type&quot;">​</a></h3><p>房间类型图标配置。</p><h4 id="room-type-assets" tabindex="-1">room.type.assets <a class="header-anchor" href="#room-type-assets" aria-label="Permalink to &quot;room.type.assets&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[内置资源, ...]</code></li></ul><p>房间类型图标资源数组。</p><p>数组索引对应 <code>RoomProperty.type</code> 值,即 <code>assets[type]</code> 显示该索引对应的图标。</p><p><strong>内置默认资源映射表:</strong></p><p>以下是内置默认图标与 <code>type</code> 值的对应关系:</p><table tabindex="0"><thead><tr><th style="text-align:left;">ID (索引)</th><th style="text-align:left;">房间类型</th></tr></thead><tbody><tr><td style="text-align:left;">0</td><td style="text-align:left;">通用/房间</td></tr><tr><td style="text-align:left;">1</td><td style="text-align:left;">客厅</td></tr><tr><td style="text-align:left;">2</td><td style="text-align:left;">餐厅</td></tr><tr><td style="text-align:left;">3</td><td style="text-align:left;">主卧</td></tr><tr><td style="text-align:left;">4</td><td style="text-align:left;">次卧/卧室</td></tr><tr><td style="text-align:left;">5</td><td style="text-align:left;">书房</td></tr><tr><td style="text-align:left;">6</td><td style="text-align:left;">厨房</td></tr><tr><td style="text-align:left;">7</td><td style="text-align:left;">卫生间</td></tr><tr><td style="text-align:left;">8</td><td style="text-align:left;">洗衣房</td></tr><tr><td style="text-align:left;">9</td><td style="text-align:left;">休息室</td></tr><tr><td style="text-align:left;">10</td><td style="text-align:left;">储物间</td></tr><tr><td style="text-align:left;">11</td><td style="text-align:left;">儿童房</td></tr><tr><td style="text-align:left;">12</td><td style="text-align:left;">阳光房</td></tr><tr><td style="text-align:left;">13</td><td style="text-align:left;">走廊</td></tr><tr><td style="text-align:left;">14</td><td style="text-align:left;">阳台</td></tr><tr><td style="text-align:left;">15</td><td style="text-align:left;">健身房</td></tr><tr><td style="text-align:left;">16</td><td style="text-align:left;">玄关</td></tr></tbody></table><p>当使用内置默认资源时,索引与房间类型的对应关系详见<a href="/guide/advanced-usage.html#房间类型图标">房间类型图标</a>。如果开发者通过此配置项自定义了数组,则映射关系完全取决于自定义数组的顺序。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>如果某个索引对应的资源为空字符串(<code>&#39;&#39;</code>),则该类型的房间将不会显示任何图标。例如,通过设置 <code>assets[0] = &#39;&#39;</code> 可以隐藏 type 为 0 的房间图标。</p></div><h4 id="room-type-iconsize" tabindex="-1">room.type.iconSize <a class="header-anchor" href="#room-type-iconsize" aria-label="Permalink to &quot;room.type.iconSize&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>12</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>房间类型图标大小。</p><h4 id="room-type-gap" tabindex="-1">room.type.gap <a class="header-anchor" href="#room-type-gap" aria-label="Permalink to &quot;room.type.gap&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>4</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>图标与房间名称文字之间的间距。</p><h4 id="room-type-position" tabindex="-1">room.type.position <a class="header-anchor" href="#room-type-position" aria-label="Permalink to &quot;room.type.position&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>&#39;left&#39; | &#39;right&#39;</code></li><li><strong>默认值</strong>: <code>&#39;left&#39;</code></li></ul><p>图标相对于房间名称文字的显示位置。</p><h4 id="room-type-container" tabindex="-1">room.type.container <a class="header-anchor" href="#room-type-container" aria-label="Permalink to &quot;room.type.container&quot;">​</a></h4><p>房间类型图标背景容器配置。</p><h5 id="room-type-container-visible" tabindex="-1">room.type.container.visible <a class="header-anchor" href="#room-type-container-visible" aria-label="Permalink to &quot;room.type.container.visible&quot;">​</a></h5><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示背景容器。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li><strong>颜色逻辑</strong>: <ul><li>当开启背景容器(<code>container.visible: true</code>)时,背景将填充为房间名称颜色(<code>room.colors.name</code>),图标将自动设置为白色(<code>tint: #ffffff</code>)。</li><li>当禁用背景容器(<code>container.visible: false</code>)时,图标将直接使用房间名称颜色(<code>room.colors.name</code>)。</li></ul></li><li><strong>最佳实践</strong>:为了实现自动换色效果,建议使用单色(通常为黑色或白色)的 SVG 资源。如果使用彩色 PNG 资源,建议将 <code>container.visible</code> 设为 <code>false</code> 以保持原色。</li></ul></div><h5 id="room-type-container-size" tabindex="-1">room.type.container.size <a class="header-anchor" href="#room-type-container-size" aria-label="Permalink to &quot;room.type.container.size&quot;">​</a></h5><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>16</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>背景容器大小。</p><h5 id="room-type-container-borderradius" tabindex="-1">room.type.container.borderRadius <a class="header-anchor" href="#room-type-container-borderradius" aria-label="Permalink to &quot;room.type.container.borderRadius&quot;">​</a></h5><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>16</code></li><li><strong>单位</strong>: <code>px</code></li></ul><p>背景容器圆角大小。</p><h3 id="room-property" tabindex="-1">room.property <a class="header-anchor" href="#room-property" aria-label="Permalink to &quot;room.property&quot;">​</a></h3><p>房间属性配置。</p><h4 id="room-property-displayorders" tabindex="-1">room.property.displayOrders <a class="header-anchor" href="#room-property-displayorders" aria-label="Permalink to &quot;room.property.displayOrders&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>(&#39;cleanMode&#39; | &#39;suction&#39; | &#39;cistern&#39; | &#39;cleanTimes&#39; | string)[]</code></li><li><strong>默认值</strong>: <code>[&#39;cleanMode&#39;, &#39;suction&#39;, &#39;cistern&#39;, &#39;cleanTimes&#39;]</code></li></ul><p>房间属性显示顺序。</p><p>你也可以传入自定义的字段名,比如 <code>[&#39;cleanMode&#39;, &#39;suction&#39;, &#39;cistern&#39;, &#39;cleanTimes&#39;, &#39;customProperty1&#39;]</code>。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>如果要隐藏某个房间属性,比如 <code>cleanTimes</code>,那么清扫次数图标将不会显示。</p></div><h4 id="room-property-customassets" tabindex="-1">room.property.customAssets <a class="header-anchor" href="#room-property-customassets" aria-label="Permalink to &quot;room.property.customAssets&quot;">​</a></h4><ul><li><strong>类型</strong>: <code>Record&lt;string, string[]&gt;</code></li><li><strong>默认值</strong>: <code>undefined</code></li></ul><p>自定义属性图标资源配置,</p><p>你可以传入自定义的字段名和对应的图标资源数组,比如:</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:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
170
170
  <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> room</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
171
171
  <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> property</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
172
172
  <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> displayOrders</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;cleanMode&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;suction&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;customProperty1&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;cistern&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;cleanTimes&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;customProperty2&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">],</span></span>
@@ -236,4 +236,4 @@ import{_ as i,c as e,o as a,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g
236
236
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> anchor: { x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.5</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1.0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }, </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 所有检测物体都使用底部中心作为锚点</span></span>
237
237
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
238
238
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
239
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div><h2 id="snapshot" tabindex="-1">snapshot <a class="header-anchor" href="#snapshot" aria-label="Permalink to &quot;snapshot&quot;">​</a></h2><p>截图配置。</p><h3 id="snapshot-format" tabindex="-1">snapshot.format <a class="header-anchor" href="#snapshot-format" aria-label="Permalink to &quot;snapshot.format&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>&#39;png&#39; | &#39;jpg&#39; | &#39;webp&#39;</code></li><li><strong>默认值</strong>: <code>&#39;png&#39;</code></li></ul><p>截图输出格式。</p><h3 id="snapshot-quality" tabindex="-1">snapshot.quality <a class="header-anchor" href="#snapshot-quality" aria-label="Permalink to &quot;snapshot.quality&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>1</code></li></ul><p>截图质量 (0-1)。</p><h3 id="snapshot-antialias" tabindex="-1">snapshot.antialias <a class="header-anchor" href="#snapshot-antialias" aria-label="Permalink to &quot;snapshot.antialias&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>截图是否开启抗锯齿。</p><h3 id="snapshot-resolution" tabindex="-1">snapshot.resolution <a class="header-anchor" href="#snapshot-resolution" aria-label="Permalink to &quot;snapshot.resolution&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>4</code></li></ul><p>截图分辨率倍数。</p>`,1319)])])}const k=i(s,[["render",n]]);export{g as __pageData,k as default};
239
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div><h2 id="snapshot" tabindex="-1">snapshot <a class="header-anchor" href="#snapshot" aria-label="Permalink to &quot;snapshot&quot;">​</a></h2><p>截图配置。</p><h3 id="snapshot-format" tabindex="-1">snapshot.format <a class="header-anchor" href="#snapshot-format" aria-label="Permalink to &quot;snapshot.format&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>&#39;png&#39; | &#39;jpg&#39; | &#39;webp&#39;</code></li><li><strong>默认值</strong>: <code>&#39;png&#39;</code></li></ul><p>截图输出格式。</p><h3 id="snapshot-quality" tabindex="-1">snapshot.quality <a class="header-anchor" href="#snapshot-quality" aria-label="Permalink to &quot;snapshot.quality&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>1</code></li></ul><p>截图质量 (0-1)。</p><h3 id="snapshot-antialias" tabindex="-1">snapshot.antialias <a class="header-anchor" href="#snapshot-antialias" aria-label="Permalink to &quot;snapshot.antialias&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>截图是否开启抗锯齿。</p><h3 id="snapshot-resolution" tabindex="-1">snapshot.resolution <a class="header-anchor" href="#snapshot-resolution" aria-label="Permalink to &quot;snapshot.resolution&quot;">​</a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>4</code></li></ul><p>截图分辨率倍数。</p>`,1337)])])}const k=e(s,[["render",n]]);export{g as __pageData,k as default};
@@ -1 +1 @@
1
- import{_ as i,c as e,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":1777535786000}'),s={name:"reference/config.md"};function n(l,o,r,c,d,h){return a(),e("div",null,[...o[0]||(o[0]=[t("",1319)])])}const k=i(s,[["render",n]]);export{g as __pageData,k as default};
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":1778207150000}'),s={name:"reference/config.md"};function n(l,o,r,c,d,h){return a(),i("div",null,[...o[0]||(o[0]=[t("",1337)])])}const k=e(s,[["render",n]]);export{g as __pageData,k 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.DrVvoJqD.js"></script>
12
+ <script type="module" src="/assets/app.BxnZmRJz.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.C_XzLiDc.js">
14
+ <link rel="modulepreload" href="/assets/chunks/theme.BluH8Q7i.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.BboplJc2.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>
@@ -544,7 +544,19 @@
544
544
  <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
545
  <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
546
  <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>
547
+ <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>
548
+ <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>
549
+ <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>
550
+ <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>
551
+ <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>
552
+ <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // applyMapRotation 默认 true,矩形在屏幕上视觉保持正放;</span></span>
553
+ <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 如果你只需要地图坐标系下的轴对齐矩形,传 false。</span></span>
554
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span>
555
+ <span class="line"></span>
556
+ <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">setCustomZones</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">([</span></span>
557
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">customZones,</span></span>
558
+ <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>
559
+ <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
560
  <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
561
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 房间唯一标识符 */</span></span>
550
562
  <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>
@@ -1143,8 +1155,8 @@
1143
1155
  <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
1156
  <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
1157
  <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\":\"GeenewB7\",\"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>
1158
+ <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-30T09:46:27.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>
1159
+ <script>window.__VP_HASH_MAP__=JSON.parse("{\"guide_advanced-usage.md\":\"BboplJc2\",\"guide_concepts.md\":\"CJ87tk-r\",\"guide_getting-started.md\":\"DOh8beTe\",\"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\":\"BW7btOQc\",\"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>
1148
1160
 
1149
1161
  </body>
1150
1162
  </html>