@ray-js/robot-map-sdk 0.0.13 → 0.0.14-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.rjs.js +1 -1
- package/dist-app/assets/{index-BzBtiwcY.js → index-D5NfGFNi.js} +1 -1
- package/dist-app/index.html +1 -1
- package/dist-docs/404.html +2 -2
- package/dist-docs/assets/{app.CoDGIQ53.js → app.BvEA7OUD.js} +1 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.DgSSKtBp.js +1 -0
- package/dist-docs/assets/chunks/{BitmapFont.DDRqV796.js → BitmapFont.ZlRh5xJO.js} +1 -1
- package/dist-docs/assets/chunks/{BufferResource.aFEHKM_N.js → BufferResource.CdcMCLiG.js} +1 -1
- package/dist-docs/assets/chunks/{CanvasRenderer.BefGXFZ-.js → CanvasRenderer.BG9dkLJp.js} +1 -1
- package/dist-docs/assets/chunks/{RenderTargetSystem.CsgIm493.js → RenderTargetSystem.DhOKhSsc.js} +1 -1
- package/dist-docs/assets/chunks/{VPLocalSearchBox.CVEAMjKj.js → VPLocalSearchBox.DceyzShG.js} +1 -1
- package/dist-docs/assets/chunks/{WebGLRenderer.p4DxJ1iF.js → WebGLRenderer.DuuxSWTv.js} +1 -1
- package/dist-docs/assets/chunks/{WebGPURenderer.BhOx1ll0.js → WebGPURenderer.CgbaDBMF.js} +1 -1
- package/dist-docs/assets/chunks/{browserAll.CXRAifqY.js → browserAll.BDysYc3x.js} +1 -1
- package/dist-docs/assets/chunks/{index.Dmmvsq5C.js → index.Bt4MWbdd.js} +5 -5
- package/dist-docs/assets/chunks/{theme.Cii0G4Y-.js → theme.CjTS9gFB.js} +3 -3
- package/dist-docs/assets/chunks/{webworkerAll.CY0RXZhY.js → webworkerAll.0Br3PwIr.js} +1 -1
- package/dist-docs/assets/{guide_getting-started.md.9hcfOAq4.js → guide_getting-started.md.DjSa-UXA.js} +2 -2
- package/dist-docs/assets/guide_getting-started.md.DjSa-UXA.lean.js +1 -0
- package/dist-docs/assets/{reference_config.md.DHynhVxG.js → reference_config.md.DJFVf513.js} +3 -3
- package/dist-docs/assets/{reference_config.md.DHynhVxG.lean.js → reference_config.md.DJFVf513.lean.js} +1 -1
- package/dist-docs/guide/advanced-usage.html +3 -3
- package/dist-docs/guide/concepts.html +3 -3
- package/dist-docs/guide/getting-started.html +5 -5
- package/dist-docs/guide/mcp.html +3 -3
- package/dist-docs/hashmap.json +1 -1
- package/dist-docs/index.html +3 -3
- package/dist-docs/plans/2026-03-04-detected-objects-visibility-design.html +3 -3
- package/dist-docs/plans/2026-03-04-show-detected-objects-implementation-plan.html +3 -3
- package/dist-docs/plans/2026-03-10-simulator-debug-design.html +3 -3
- package/dist-docs/plans/2026-03-10-simulator-events-console-design.html +3 -3
- package/dist-docs/plans/2026-03-10-simulator-events-console-implementation-plan.html +3 -3
- package/dist-docs/plans/2026-03-10-simulator-runtime-controls-design.html +3 -3
- package/dist-docs/plans/2026-03-10-simulator-runtime-controls-implementation-plan.html +3 -3
- package/dist-docs/plans/2026-03-11-simulator-logger-dump-implementation-plan.html +3 -3
- package/dist-docs/records/bugs/2026-02-28-fix-pixi-bindgroup-webgpu-snapshot-whitescreen-bugfix.html +3 -3
- package/dist-docs/records/bugs/2026-03-10-events-drawer-toolbar-scroll-bugfix.html +3 -3
- package/dist-docs/records/bugs/2026-03-10-simulator-initial-render-layout-bugfix.html +3 -3
- package/dist-docs/records/bugs/2026-03-10-simulator-wheel-scroll-leak-bugfix.html +3 -3
- package/dist-docs/records/bugs/2026-03-11-docs-server-bin-clean-bugfix.html +3 -3
- package/dist-docs/records/bugs/2026-03-11-render-result-runtime-sync-bugfix.html +3 -3
- package/dist-docs/records/plans/2026-03-02-furniture-feature-plan.html +3 -3
- package/dist-docs/records/plans/2026-03-10-simulator-events-console-plan.html +3 -3
- package/dist-docs/records/plans/2026-03-10-simulator-last-successful-combo-cache-plan.html +3 -3
- package/dist-docs/records/plans/2026-03-10-simulator-map-parsed-view-plan.html +3 -3
- package/dist-docs/records/plans/2026-03-10-simulator-map-playground-refactor-plan.html +3 -3
- package/dist-docs/records/plans/2026-03-10-simulator-playground-plan.html +3 -3
- package/dist-docs/records/plans/2026-03-10-simulator-runtime-controls-plan.html +3 -3
- package/dist-docs/records/plans/2026-03-11-docs-cli-ui-polish-plan.html +3 -3
- package/dist-docs/records/plans/2026-03-11-simulator-logger-dump-plan.html +3 -3
- package/dist-docs/records/plans/2026-03-11-simulator-src-migration-implementation.html +3 -3
- package/dist-docs/records/plans/2026-03-11-simulator-src-migration-plan.html +3 -3
- package/dist-docs/records/plans/2026-03-11-simulator-style-tokenization-plan.html +3 -3
- package/dist-docs/reference/callbacks.html +3 -3
- package/dist-docs/reference/config.html +6 -6
- package/dist-docs/reference/data.html +3 -3
- package/dist-docs/reference/methods.html +3 -3
- package/dist-docs/reference/runtime.html +3 -3
- package/dist-docs/reference/types.html +3 -3
- package/dist-docs/reference/utils.html +3 -3
- package/dist-docs/simulator/index.html +3 -3
- package/package.json +1 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.DELY0TLT.js +0 -1
- package/dist-docs/assets/guide_getting-started.md.9hcfOAq4.lean.js +0 -1
|
@@ -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.
|
|
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.Bt4MWbdd.js";import"./framework.CBLqO2Q1.js";import"./mapValues.D2X8cRgC.js";import"./theme.CjTS9gFB.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
|
|
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 "快速开始""></a></h1><p>Tuya Robot Map 提供了开箱即用的 React 组件,专为扫地机器人应用设计。</p><h2 id="安装" tabindex="-1">安装 <a class="header-anchor" href="#安装" aria-label="Permalink to "安装""></a></h2><div class="vp-code-group vp-adaptive-theme"><div class="tabs"><input type="radio" name="group-Mrdd3" id="tab-3TgpWLo" checked><label data-title="yarn" for="tab-3TgpWLo">yarn</label><input type="radio" name="group-Mrdd3" id="tab-Ofupf5E"><label data-title="npm" for="tab-Ofupf5E">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 "数据传入""></a></h2><p>仅需传入几个基本的数据props,即可完成地图的呈现。</p><div class="vp-code-group vp-adaptive-theme"><div class="tabs"><input type="radio" name="group-tg2wM" id="tab-XZm3CU4" checked><label data-title="点阵协议地图数据" for="tab-XZm3CU4">点阵协议地图数据</label><input type="radio" name="group-tg2wM" id="tab-6NswG_M"><label data-title="结构化协议地图数据" for="tab-6NswG_M">结构化协议地图数据</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;"> 'react'</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;"> '@ray-js/robot-map'</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;"> '@ray-js/robot-map'</span></span>
|
|
4
4
|
<span class="line"></span>
|
|
@@ -208,4 +208,4 @@ import{_ as i,c as a,o as n,aq as h}from"./chunks/framework.CBLqO2Q1.js";const g
|
|
|
208
208
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</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;">{handleGetCleanZones}>获取清扫区域</</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">Button</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
|
209
209
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">View</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
|
210
210
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
|
|
211
|
-
<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">TIP</p><p>注意所有地图方法都是异步的Promise,需要使用 <code>await</code> 或 <code>then</code> 来获取结果。</p></div>`,27)])])}const y=i(
|
|
211
|
+
<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">TIP</p><p>注意所有地图方法都是异步的Promise,需要使用 <code>await</code> 或 <code>then</code> 来获取结果。</p></div>`,27)])])}const y=i(h,[["render",l]]);export{g as __pageData,y as default};
|
|
@@ -0,0 +1 @@
|
|
|
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("",27)])])}const y=i(h,[["render",l]]);export{g as __pageData,y as default};
|
package/dist-docs/assets/{reference_config.md.DHynhVxG.js → reference_config.md.DJFVf513.js}
RENAMED
|
@@ -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":
|
|
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":1773391519000}'),s={name:"reference/config.md"};function r(l,o,n,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 "配置""></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 "使用示例""></a></h2><h3 id="基础配置" tabindex="-1">基础配置 <a class="header-anchor" href="#基础配置" aria-label="Permalink to "基础配置""></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;"> 'react'</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;"> '@ray-js/robot-map'</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>
|
|
@@ -162,7 +162,7 @@ import{_ as i,c as e,o as a,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g
|
|
|
162
162
|
<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>
|
|
163
163
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
164
164
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
165
|
-
<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 "global.backgroundAlpha""></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>'rgba(255, 255, 255, 0.5)'</code>)来控制透明度。</p></div><h3 id="global-performancemode" tabindex="-1">global.performanceMode <a class="header-anchor" href="#global-performancemode" aria-label="Permalink to "global.performanceMode""></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 "global.resolution""></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 "global.enableLogger""></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><h2 id="interaction" tabindex="-1">interaction <a class="header-anchor" href="#interaction" aria-label="Permalink to "interaction""></a></h2><p>交互配置,控制地图的缩放和手势操作。</p><h3 id="interaction-zoomrange" tabindex="-1">interaction.zoomRange <a class="header-anchor" href="#interaction-zoomrange" aria-label="Permalink to "interaction.zoomRange""></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 "interaction.zoomRange.min""></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 "interaction.zoomRange.max""></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 "interaction.fitMinScale""></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 "interaction.fitMaxScale""></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 "interaction.enable""></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 "interaction.enableDoubleTapZoom""></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 "interaction.enableRobotClick""></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 "interaction.enableChargingStationClick""></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 "map""></a></h2><p>地图配置。</p><h3 id="map-autopaddinghorizontalpercent" tabindex="-1">map.autoPaddingHorizontalPercent <a class="header-anchor" href="#map-autopaddinghorizontalpercent" aria-label="Permalink to "map.autoPaddingHorizontalPercent""></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 "map.autoPaddingVerticalPercent""></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 "map.obstacleColor""></a></h3><ul><li><strong>类型</strong>: <code>ColorSource</code></li><li><strong>默认值</strong>: <code>'#999999'</code></li></ul><p>障碍点显示颜色。</p><h3 id="map-freecolor" tabindex="-1">map.freeColor <a class="header-anchor" href="#map-freecolor" aria-label="Permalink to "map.freeColor""></a></h3><ul><li><strong>类型</strong>: <code>ColorSource</code></li><li><strong>默认值</strong>: <code>'#ebebeb'</code></li></ul><p>自由区域点显示颜色。(仅结构化地图可用)</p><h3 id="map-autofitoffset" tabindex="-1">map.autoFitOffset <a class="header-anchor" href="#map-autofitoffset" aria-label="Permalink to "map.autoFitOffset""></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 "map.adjacencyThreshold""></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 "map.originChangeAutoFitThreshold""></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 "map.sizeChangeAutoFitThreshold""></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 "heatmap""></a></h2><p>热力图配置,控制信号强度热力图的渲染效果。</p><h3 id="heatmap-cellsize" tabindex="-1">heatmap.cellSize <a class="header-anchor" href="#heatmap-cellsize" aria-label="Permalink to "heatmap.cellSize""></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 "heatmap.maxDistance""></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 "heatmap.smoothIterations""></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 "heatmap.heatmapAlpha""></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 "heatmap.useGradient""></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 "heatmap.colorGradients""></a></h3><ul><li><strong>类型</strong>: <code>[ColorSource, ColorSource, ColorSource, ColorSource, ColorSource, ColorSource, ColorSource, ColorSource]</code></li><li><strong>默认值</strong>: <code>['#FF3B30', '#FF7A00', '#FFA100', '#FFD700', '#99DD70', '#2EC070', '#40E0D0', '#88D0E9']</code></li></ul><p>热力图颜色渐变配置,从高强度到低强度。</p><h2 id="room" tabindex="-1">room <a class="header-anchor" href="#room" aria-label="Permalink to "room""></a></h2><p>房间配置,控制房间的颜色、名称、属性显示等。</p><h3 id="room-colors" tabindex="-1">room.colors <a class="header-anchor" href="#room-colors" aria-label="Permalink to "room.colors""></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 "room.colors.sortBy""></a></h3><ul><li><strong>类型</strong>: <code>'index' | 'area'</code></li><li><strong>默认值</strong>: <code>'index'</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 "room.colors.strategy""></a></h3><ul><li><strong>类型</strong>: <code>'priority' | 'balanced'</code></li><li><strong>默认值</strong>: <code>'priority'</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 "room.colors.active""></a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>['#a8c8f5', '#9de5c7', '#d4b9f7', '#ffd399']</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 "room.colors.inactive""></a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>['#d6e7fc', '#d1f4e5', '#ece0fb', '#fff0d9']</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 "room.colors.normal""></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 "room.colors.name""></a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>['#2563b8', '#26966b', '#7c3fb8', '#d97706']</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 "room.colors.nameInactive""></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 "room.colors.nameNormal""></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 "room.colors.propertyTheme""></a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>['#2563b8', '#26966b', '#7c3fb8', '#d97706']</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 "room.colors.propertyThemeInactive""></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 "room.colors.propertyThemeNormal""></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 "room.colors.selectionIndicatorBackground""></a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>['#2563b8', '#26966b', '#7c3fb8', '#d97706']</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 "room.colors.selectionIndicatorIcon""></a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>['#ffffff', '#ffffff', '#ffffff', '#ffffff']</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 "room.colors.NO_ROOM_DATA""></a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>'#ebebeb'</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 "room.colors.ROOM_GAP""></a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>'#ebebeb'</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 "room.colors.OBSTACLE_ROOM""></a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>'#ebebeb'</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 "room.colors.UNKNOWN_ROOM""></a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>'#ebebeb'</code></li></ul><p>未知房间的颜色。对于结构化协议代表 <code>roomId >= 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 "room.colors.VERSION0_ROOM""></a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>''</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 "room.nameLabel""></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 "room.nameLabel.fontSize""></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 "room.nameLabel.fontFamily""></a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>'system-ui, -apple-system, sans-serif'</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 "room.nameLabel.fontWeight""></a></h4><ul><li><strong>类型</strong>: <code>TextStyleFontWeight</code></li><li><strong>默认值</strong>: <code>'500'</code></li></ul><p>房间名称字体粗细。</p><h3 id="room-type" tabindex="-1">room.type <a class="header-anchor" href="#room-type" aria-label="Permalink to "room.type""></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 "room.type.assets""></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>''</code>),则该类型的房间将不会显示任何图标。例如,通过设置 <code>assets[0] = ''</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 "room.type.iconSize""></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 "room.type.gap""></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 "room.type.position""></a></h4><ul><li><strong>类型</strong>: <code>'left' | 'right'</code></li><li><strong>默认值</strong>: <code>'left'</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 "room.type.container""></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 "room.type.container.visible""></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 "room.type.container.size""></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 "room.type.container.borderRadius""></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 "room.property""></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 "room.property.displayOrders""></a></h4><ul><li><strong>类型</strong>: <code>('cleanMode' | 'suction' | 'cistern' | 'cleanTimes' | string)[]</code></li><li><strong>默认值</strong>: <code>['cleanMode', 'suction', 'cistern', 'cleanTimes']</code></li></ul><p>房间属性显示顺序。</p><p>你也可以传入自定义的字段名,比如 <code>['cleanMode', 'suction', 'cistern', 'cleanTimes', 'customProperty1']</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 "room.property.customAssets""></a></h4><ul><li><strong>类型</strong>: <code>Record<string, string[]></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>
|
|
165
|
+
<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 "global.backgroundAlpha""></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>'rgba(255, 255, 255, 0.5)'</code>)来控制透明度。</p></div><h3 id="global-performancemode" tabindex="-1">global.performanceMode <a class="header-anchor" href="#global-performancemode" aria-label="Permalink to "global.performanceMode""></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 "global.resolution""></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 "global.enableLogger""></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 "global.rendererPreference""></a></h3><ul><li><strong>类型</strong>: <code>'webgpu' | 'webgl'</code></li><li><strong>默认值</strong>: <code>'webgpu'</code></li></ul><p>渲染器偏好,设置 PIXI.js 优先使用的渲染后端。</p><h2 id="interaction" tabindex="-1">interaction <a class="header-anchor" href="#interaction" aria-label="Permalink to "interaction""></a></h2><p>交互配置,控制地图的缩放和手势操作。</p><h3 id="interaction-zoomrange" tabindex="-1">interaction.zoomRange <a class="header-anchor" href="#interaction-zoomrange" aria-label="Permalink to "interaction.zoomRange""></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 "interaction.zoomRange.min""></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 "interaction.zoomRange.max""></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 "interaction.fitMinScale""></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 "interaction.fitMaxScale""></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 "interaction.enable""></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 "interaction.enableDoubleTapZoom""></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 "interaction.enableRobotClick""></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 "interaction.enableChargingStationClick""></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 "map""></a></h2><p>地图配置。</p><h3 id="map-autopaddinghorizontalpercent" tabindex="-1">map.autoPaddingHorizontalPercent <a class="header-anchor" href="#map-autopaddinghorizontalpercent" aria-label="Permalink to "map.autoPaddingHorizontalPercent""></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 "map.autoPaddingVerticalPercent""></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 "map.obstacleColor""></a></h3><ul><li><strong>类型</strong>: <code>ColorSource</code></li><li><strong>默认值</strong>: <code>'#999999'</code></li></ul><p>障碍点显示颜色。</p><h3 id="map-freecolor" tabindex="-1">map.freeColor <a class="header-anchor" href="#map-freecolor" aria-label="Permalink to "map.freeColor""></a></h3><ul><li><strong>类型</strong>: <code>ColorSource</code></li><li><strong>默认值</strong>: <code>'#ebebeb'</code></li></ul><p>自由区域点显示颜色。(仅结构化地图可用)</p><h3 id="map-autofitoffset" tabindex="-1">map.autoFitOffset <a class="header-anchor" href="#map-autofitoffset" aria-label="Permalink to "map.autoFitOffset""></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 "map.adjacencyThreshold""></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 "map.originChangeAutoFitThreshold""></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 "map.sizeChangeAutoFitThreshold""></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 "heatmap""></a></h2><p>热力图配置,控制信号强度热力图的渲染效果。</p><h3 id="heatmap-cellsize" tabindex="-1">heatmap.cellSize <a class="header-anchor" href="#heatmap-cellsize" aria-label="Permalink to "heatmap.cellSize""></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 "heatmap.maxDistance""></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 "heatmap.smoothIterations""></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 "heatmap.heatmapAlpha""></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 "heatmap.useGradient""></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 "heatmap.colorGradients""></a></h3><ul><li><strong>类型</strong>: <code>[ColorSource, ColorSource, ColorSource, ColorSource, ColorSource, ColorSource, ColorSource, ColorSource]</code></li><li><strong>默认值</strong>: <code>['#FF3B30', '#FF7A00', '#FFA100', '#FFD700', '#99DD70', '#2EC070', '#40E0D0', '#88D0E9']</code></li></ul><p>热力图颜色渐变配置,从高强度到低强度。</p><h2 id="room" tabindex="-1">room <a class="header-anchor" href="#room" aria-label="Permalink to "room""></a></h2><p>房间配置,控制房间的颜色、名称、属性显示等。</p><h3 id="room-colors" tabindex="-1">room.colors <a class="header-anchor" href="#room-colors" aria-label="Permalink to "room.colors""></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 "room.colors.sortBy""></a></h3><ul><li><strong>类型</strong>: <code>'index' | 'area'</code></li><li><strong>默认值</strong>: <code>'index'</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 "room.colors.strategy""></a></h3><ul><li><strong>类型</strong>: <code>'priority' | 'balanced'</code></li><li><strong>默认值</strong>: <code>'priority'</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 "room.colors.active""></a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>['#a8c8f5', '#9de5c7', '#d4b9f7', '#ffd399']</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 "room.colors.inactive""></a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>['#d6e7fc', '#d1f4e5', '#ece0fb', '#fff0d9']</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 "room.colors.normal""></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 "room.colors.name""></a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>['#2563b8', '#26966b', '#7c3fb8', '#d97706']</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 "room.colors.nameInactive""></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 "room.colors.nameNormal""></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 "room.colors.propertyTheme""></a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>['#2563b8', '#26966b', '#7c3fb8', '#d97706']</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 "room.colors.propertyThemeInactive""></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 "room.colors.propertyThemeNormal""></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 "room.colors.selectionIndicatorBackground""></a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>['#2563b8', '#26966b', '#7c3fb8', '#d97706']</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 "room.colors.selectionIndicatorIcon""></a></h4><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>['#ffffff', '#ffffff', '#ffffff', '#ffffff']</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 "room.colors.NO_ROOM_DATA""></a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>'#ebebeb'</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 "room.colors.ROOM_GAP""></a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>'#ebebeb'</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 "room.colors.OBSTACLE_ROOM""></a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>'#ebebeb'</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 "room.colors.UNKNOWN_ROOM""></a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>'#ebebeb'</code></li></ul><p>未知房间的颜色。对于结构化协议代表 <code>roomId >= 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 "room.colors.VERSION0_ROOM""></a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>''</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 "room.nameLabel""></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 "room.nameLabel.fontSize""></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 "room.nameLabel.fontFamily""></a></h4><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>'system-ui, -apple-system, sans-serif'</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 "room.nameLabel.fontWeight""></a></h4><ul><li><strong>类型</strong>: <code>TextStyleFontWeight</code></li><li><strong>默认值</strong>: <code>'500'</code></li></ul><p>房间名称字体粗细。</p><h3 id="room-type" tabindex="-1">room.type <a class="header-anchor" href="#room-type" aria-label="Permalink to "room.type""></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 "room.type.assets""></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>''</code>),则该类型的房间将不会显示任何图标。例如,通过设置 <code>assets[0] = ''</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 "room.type.iconSize""></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 "room.type.gap""></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 "room.type.position""></a></h4><ul><li><strong>类型</strong>: <code>'left' | 'right'</code></li><li><strong>默认值</strong>: <code>'left'</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 "room.type.container""></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 "room.type.container.visible""></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 "room.type.container.size""></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 "room.type.container.borderRadius""></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 "room.property""></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 "room.property.displayOrders""></a></h4><ul><li><strong>类型</strong>: <code>('cleanMode' | 'suction' | 'cistern' | 'cleanTimes' | string)[]</code></li><li><strong>默认值</strong>: <code>['cleanMode', 'suction', 'cistern', 'cleanTimes']</code></li></ul><p>房间属性显示顺序。</p><p>你也可以传入自定义的字段名,比如 <code>['cleanMode', 'suction', 'cistern', 'cleanTimes', 'customProperty1']</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 "room.property.customAssets""></a></h4><ul><li><strong>类型</strong>: <code>Record<string, string[]></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>
|
|
166
166
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> room</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
|
167
167
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> property</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
|
168
168
|
<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;">'cleanMode'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'suction'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'customProperty1'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'cistern'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'cleanTimes'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'customProperty2'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">],</span></span>
|
|
@@ -209,4 +209,4 @@ import{_ as i,c as e,o as a,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g
|
|
|
209
209
|
<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>
|
|
210
210
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
211
211
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
212
|
-
<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 "snapshot""></a></h2><p>截图配置。</p><h3 id="snapshot-format" tabindex="-1">snapshot.format <a class="header-anchor" href="#snapshot-format" aria-label="Permalink to "snapshot.format""></a></h3><ul><li><strong>类型</strong>: <code>'png' | 'jpg' | 'webp'</code></li><li><strong>默认值</strong>: <code>'png'</code></li></ul><p>截图输出格式。</p><h3 id="snapshot-quality" tabindex="-1">snapshot.quality <a class="header-anchor" href="#snapshot-quality" aria-label="Permalink to "snapshot.quality""></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 "snapshot.antialias""></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 "snapshot.resolution""></a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>4</code></li></ul><p>截图分辨率倍数。</p>`,
|
|
212
|
+
<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 "snapshot""></a></h2><p>截图配置。</p><h3 id="snapshot-format" tabindex="-1">snapshot.format <a class="header-anchor" href="#snapshot-format" aria-label="Permalink to "snapshot.format""></a></h3><ul><li><strong>类型</strong>: <code>'png' | 'jpg' | 'webp'</code></li><li><strong>默认值</strong>: <code>'png'</code></li></ul><p>截图输出格式。</p><h3 id="snapshot-quality" tabindex="-1">snapshot.quality <a class="header-anchor" href="#snapshot-quality" aria-label="Permalink to "snapshot.quality""></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 "snapshot.antialias""></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 "snapshot.resolution""></a></h3><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>4</code></li></ul><p>截图分辨率倍数。</p>`,1302)])])}const u=i(s,[["render",r]]);export{g as __pageData,u 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":
|
|
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":1773391519000}'),s={name:"reference/config.md"};function r(l,o,n,c,d,h){return a(),e("div",null,[...o[0]||(o[0]=[t("",1302)])])}const u=i(s,[["render",r]]);export{g as __pageData,u as default};
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
<link rel="preload stylesheet" href="/assets/style.hiWmcVfN.css" as="style">
|
|
10
10
|
<link rel="preload stylesheet" href="/vp-icons.css" as="style">
|
|
11
11
|
|
|
12
|
-
<script type="module" src="/assets/app.
|
|
12
|
+
<script type="module" src="/assets/app.BvEA7OUD.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.
|
|
14
|
+
<link rel="modulepreload" href="/assets/chunks/theme.CjTS9gFB.js">
|
|
15
15
|
<link rel="modulepreload" href="/assets/chunks/framework.CBLqO2Q1.js">
|
|
16
16
|
<link rel="modulepreload" href="/assets/guide_advanced-usage.md.COVLyRkA.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>
|
|
@@ -1073,7 +1073,7 @@
|
|
|
1073
1073
|
<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>
|
|
1074
1074
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
1075
1075
|
<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-03-09T08:16:06.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>
|
|
1076
|
-
<script>window.__VP_HASH_MAP__=JSON.parse("{\"guide_advanced-usage.md\":\"COVLyRkA\",\"guide_concepts.md\":\"CJ87tk-r\",\"guide_getting-started.md\":\"
|
|
1076
|
+
<script>window.__VP_HASH_MAP__=JSON.parse("{\"guide_advanced-usage.md\":\"COVLyRkA\",\"guide_concepts.md\":\"CJ87tk-r\",\"guide_getting-started.md\":\"DjSa-UXA\",\"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-11-simulator-logger-dump-implementation-plan.md\":\"Ck5BGdoX\",\"records_bugs_2026-02-28-fix-pixi-bindgroup-webgpu-snapshot-whitescreen-bugfix.md\":\"BbQpA41Y\",\"records_bugs_2026-03-10-events-drawer-toolbar-scroll-bugfix.md\":\"DbHxPv4D\",\"records_bugs_2026-03-10-simulator-initial-render-layout-bugfix.md\":\"w7--2hvH\",\"records_bugs_2026-03-10-simulator-wheel-scroll-leak-bugfix.md\":\"B6gIem2P\",\"records_bugs_2026-03-11-docs-server-bin-clean-bugfix.md\":\"GGWCjkok\",\"records_bugs_2026-03-11-render-result-runtime-sync-bugfix.md\":\"DRNUuaFT\",\"records_plans_2026-03-02-furniture-feature-plan.md\":\"CqSsyNDo\",\"records_plans_2026-03-10-simulator-events-console-plan.md\":\"CfHLEHcc\",\"records_plans_2026-03-10-simulator-last-successful-combo-cache-plan.md\":\"Z2RoK239\",\"records_plans_2026-03-10-simulator-map-parsed-view-plan.md\":\"S9jPz75o\",\"records_plans_2026-03-10-simulator-map-playground-refactor-plan.md\":\"BuILlmcV\",\"records_plans_2026-03-10-simulator-playground-plan.md\":\"CQAR-T7p\",\"records_plans_2026-03-10-simulator-runtime-controls-plan.md\":\"DSVD-qCa\",\"records_plans_2026-03-11-docs-cli-ui-polish-plan.md\":\"B8oZt_5R\",\"records_plans_2026-03-11-simulator-logger-dump-plan.md\":\"CkjDCM2N\",\"records_plans_2026-03-11-simulator-src-migration-implementation.md\":\"FnB5Cx6R\",\"records_plans_2026-03-11-simulator-src-migration-plan.md\":\"BBfaeRrq\",\"records_plans_2026-03-11-simulator-style-tokenization-plan.md\":\"D4BgkNlO\",\"reference_callbacks.md\":\"BIwuGR3s\",\"reference_config.md\":\"DJFVf513\",\"reference_data.md\":\"B_XpUFrn\",\"reference_methods.md\":\"eH-UCMbE\",\"reference_runtime.md\":\"BEy8BhSZ\",\"reference_types.md\":\"hikiO8Cq\",\"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>
|
|
1077
1077
|
|
|
1078
1078
|
</body>
|
|
1079
1079
|
</html>
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
<link rel="preload stylesheet" href="/assets/style.hiWmcVfN.css" as="style">
|
|
10
10
|
<link rel="preload stylesheet" href="/vp-icons.css" as="style">
|
|
11
11
|
|
|
12
|
-
<script type="module" src="/assets/app.
|
|
12
|
+
<script type="module" src="/assets/app.BvEA7OUD.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.
|
|
14
|
+
<link rel="modulepreload" href="/assets/chunks/theme.CjTS9gFB.js">
|
|
15
15
|
<link rel="modulepreload" href="/assets/chunks/framework.CBLqO2Q1.js">
|
|
16
16
|
<link rel="modulepreload" href="/assets/guide_concepts.md.CJ87tk-r.lean.js">
|
|
17
17
|
<script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<div id="app"><div class="Layout" data-v-5d98c3a5><!--[--><!--]--><!--[--><span tabindex="-1" data-v-0b0ada53></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-0b0ada53>Skip to content</a><!--]--><!----><header class="VPNav" data-v-5d98c3a5 data-v-ae24b3ad><div class="VPNavBar" data-v-ae24b3ad data-v-6aa21345><div class="wrapper" data-v-6aa21345><div class="container" data-v-6aa21345><div class="title" data-v-6aa21345><div class="VPNavBarTitle has-sidebar" data-v-6aa21345 data-v-1168a8e4><a class="title" href="/" data-v-1168a8e4><!--[--><!--]--><!----><span data-v-1168a8e4>Tuya Robot Map</span><!--[--><!--]--></a></div></div><div class="content" data-v-6aa21345><div class="content-body" data-v-6aa21345><!--[--><!--]--><div class="VPNavBarSearch search" data-v-6aa21345><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><span class="vp-icon DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-6aa21345 data-v-dc692963><span id="main-nav-aria-label" class="visually-hidden" data-v-dc692963> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>首页</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink active" href="/guide/concepts.html" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>指南</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/reference/data.html" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>参考</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/simulator/" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>模拟调试</span><!--]--></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-6aa21345 data-v-6c893767><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-6c893767 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div><!----><div class="VPFlyout VPNavBarExtra extra" data-v-6aa21345 data-v-bb2aa2f0 data-v-cf11d7a2><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-cf11d7a2><span class="vpi-more-horizontal icon" data-v-cf11d7a2></span></button><div class="menu" data-v-cf11d7a2><div class="VPMenu" data-v-cf11d7a2 data-v-b98bc113><!----><!--[--><!--[--><!----><div class="group" data-v-bb2aa2f0><div class="item appearance" data-v-bb2aa2f0><p class="label" data-v-bb2aa2f0>Appearance</p><div class="appearance-action" data-v-bb2aa2f0><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-bb2aa2f0 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div></div></div><!----><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-6aa21345 data-v-e5dd9c1c><span class="container" data-v-e5dd9c1c><span class="top" data-v-e5dd9c1c></span><span class="middle" data-v-e5dd9c1c></span><span class="bottom" data-v-e5dd9c1c></span></span></button></div></div></div></div><div class="divider" data-v-6aa21345><div class="divider-line" data-v-6aa21345></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-5d98c3a5 data-v-a6f0e41e><div class="container" data-v-a6f0e41e><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-a6f0e41e><span class="vpi-align-left menu-icon" data-v-a6f0e41e></span><span class="menu-text" data-v-a6f0e41e>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-a6f0e41e data-v-8a42e2b4><button data-v-8a42e2b4>Return to top</button><!----></div></div></div><aside class="VPSidebar" data-v-5d98c3a5 data-v-319d5ca6><div class="curtain" data-v-319d5ca6></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-319d5ca6><span class="visually-hidden" id="sidebar-aria-label" data-v-319d5ca6> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 has-active" data-v-c40bc020 data-v-b3fd67f8><div class="item" role="button" tabindex="0" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><h2 class="text" data-v-b3fd67f8>指南</h2><!----></div><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/guide/concepts.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>基本概念</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/guide/getting-started.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>快速开始</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/guide/advanced-usage.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>进阶使用</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-5d98c3a5 data-v-1428d186><div class="VPDoc has-sidebar has-aside" data-v-1428d186 data-v-39a288b8><!--[--><!--]--><div class="container" data-v-39a288b8><div class="aside" data-v-39a288b8><div class="aside-curtain" data-v-39a288b8></div><div class="aside-container" data-v-39a288b8><div class="aside-content" data-v-39a288b8><div class="VPDocAside" data-v-39a288b8 data-v-3f215769><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-3f215769 data-v-a5bbad30><div class="content" data-v-a5bbad30><div class="outline-marker" data-v-a5bbad30></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-a5bbad30>页面导航</div><ul class="VPDocOutlineItem root" data-v-a5bbad30 data-v-b933a997><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-3f215769></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-39a288b8><div class="content-container" data-v-39a288b8><!--[--><!--]--><main class="main" data-v-39a288b8><div style="position:relative;" class="vp-doc _guide_concepts" data-v-39a288b8><div><h1 id="基本概念" tabindex="-1">基本概念 <a class="header-anchor" href="#基本概念" aria-label="Permalink to "基本概念""></a></h1><p>了解 Tuya Robot Map 的核心概念。</p><h2 id="核心组件" tabindex="-1">核心组件 <a class="header-anchor" href="#核心组件" aria-label="Permalink to "核心组件""></a></h2><p>后续文档中,我们会使用 <code>RobotMap</code> 组件作为示例,你可以根据实际需求选择使用 <code>RobotMap</code> 或 <code>RjsRobotMap</code> 组件。</p><h3 id="robotmap-组件" tabindex="-1">RobotMap 组件 <a class="header-anchor" href="#robotmap-组件" aria-label="Permalink to "RobotMap 组件""></a></h3><p>React 地图组件,提供完整的地图渲染和交互功能:</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /></span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li><p><code>RobotMap</code> 组件是基于 <a href="https://developer.tuya.com/cn/miniapp/develop/ray/component/open/web-view" target="_blank" rel="noreferrer">WebView</a> 开发的,开发前请详细阅读<a href="https://developer.tuya.com/cn/miniapp/develop/miniapp/component/native-component/native-component" target="_blank" rel="noreferrer">原生组件说明</a>。</p></li><li><p><code>RobotMap</code> 默认铺满全屏,适用于<strong>首页实时地图</strong>等场景,一个页面只能有一个 <code>RobotMap</code> 组件。</p></li><li><p>需要在小程序<code>global.config.ts</code>中配置<code>webviewRoot</code>让小程序能够正确加载<code>RobotMap</code>的资源。</p></li></ul><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
|
22
22
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "webviewRoot"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"node_modules/@ray-js/robot-map-sdk/dist-app"</span></span>
|
|
23
23
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div></div><h3 id="rjsrobotmap-组件" tabindex="-1">RjsRobotMap 组件 <a class="header-anchor" href="#rjsrobotmap-组件" aria-label="Permalink to "RjsRobotMap 组件""></a></h3><p>基于Rjs开发的地图组件,它拥有和 <code>RobotMap</code> 组件相同的Props。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RjsRobotMap</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /></span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title">TIP</p><p><code>RjsRobotMap</code> 基于 <a href="https://developer.tuya.com/cn/miniapp/develop/ray/framework/render" target="_blank" rel="noreferrer">Rjs</a> 开发,它没有原生组件的限制,一个页面可以有多个 <code>RjsRobotMap</code> 组件。适用于<strong>多地图</strong>、<strong>弹窗里的地图</strong> 等场景。</p></div><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>引入 <code>RjsRobotMap</code> 对页面加载速度有一定影响。如无必要场景,我们建议始终使用 <code>RobotMap</code> 组件。</p></div><h2 id="坐标系统" tabindex="-1">坐标系统 <a class="header-anchor" href="#坐标系统" aria-label="Permalink to "坐标系统""></a></h2><h3 id="地图原点坐标" tabindex="-1">地图原点坐标 <a class="header-anchor" href="#地图原点坐标" aria-label="Permalink to "地图原点坐标""></a></h3><p>地图原点是扫地机器人运行过程中确定的参考点,地图上的元素都是基于这个原点计算的相对位置。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>地图原点本身是相对于地图左上角来定位的。例如在一张100 x 100(宽 x 高)的 地图中,如果原点坐标是(20, 80),表示原点位于相对于地图左上角(20, 80)的位置。</p></div><h3 id="地图坐标系" tabindex="-1">地图坐标系 <a class="header-anchor" href="#地图坐标系" aria-label="Permalink to "地图坐标系""></a></h3><p>地图坐标系是本 SDK 实际使用的坐标系,用于在地图上渲染和显示各种元素。地图坐标系以地图原点为中心(0, 0):</p><ul><li>X轴:向右为正方向</li><li>Y轴:向下为正方向</li></ul><h4 id="与机器坐标系的不同" tabindex="-1">与机器坐标系的不同 <a class="header-anchor" href="#与机器坐标系的不同" aria-label="Permalink to "与机器坐标系的不同""></a></h4><p>需要注意的是,本 SDK 使用的地图坐标系与扫地机器人设备本身使用的机器坐标系在 Y 轴方向上相反:</p><ul><li><p><strong>机器坐标系</strong>(设备使用的坐标系):</p><ul><li>X轴:向右为正方向</li><li>Y轴:向上为正方向</li></ul></li><li><p><strong>地图坐标系</strong>(本 SDK 使用的坐标系):</p><ul><li>X轴:向右为正方向(与机器坐标系一致)</li><li>Y轴:向下为正方向(与机器坐标系相反)</li></ul></li></ul><p>SDK 采用标准的屏幕坐标系(Screen Coordinate System)进行渲染,因此 Y 轴方向与机器坐标系相反。在 SDK 中,如果原点在(0, 0),坐标为(1, 1)的点会渲染在原点的右下方。</p><p>例如,以下元素的坐标均使用地图坐标系:</p><ul><li>充电桩</li><li>清扫路径 (含机器人位置)</li><li>虚拟墙</li><li>禁区</li><li>清扫区域</li><li>分割线</li><li>其他自定义元素</li><li>...</li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>本文档中,如果未特别说明,涉及到的坐标均指地图坐标系(X向右,Y向下)。</p></div></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><!----><div class="last-updated" data-v-e257564d><p class="VPLastUpdated" data-v-e257564d data-v-e98dd255>最后更新于: <time datetime="2025-12-30T11:04:05.000Z" data-v-e98dd255></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><!----></div><div class="pager" data-v-e257564d><a class="VPLink link pager-link next" href="/guide/getting-started.html" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>Next page</span><span class="title" data-v-e257564d>快速开始</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
|
|
24
|
-
<script>window.__VP_HASH_MAP__=JSON.parse("{\"guide_advanced-usage.md\":\"COVLyRkA\",\"guide_concepts.md\":\"CJ87tk-r\",\"guide_getting-started.md\":\"
|
|
24
|
+
<script>window.__VP_HASH_MAP__=JSON.parse("{\"guide_advanced-usage.md\":\"COVLyRkA\",\"guide_concepts.md\":\"CJ87tk-r\",\"guide_getting-started.md\":\"DjSa-UXA\",\"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-11-simulator-logger-dump-implementation-plan.md\":\"Ck5BGdoX\",\"records_bugs_2026-02-28-fix-pixi-bindgroup-webgpu-snapshot-whitescreen-bugfix.md\":\"BbQpA41Y\",\"records_bugs_2026-03-10-events-drawer-toolbar-scroll-bugfix.md\":\"DbHxPv4D\",\"records_bugs_2026-03-10-simulator-initial-render-layout-bugfix.md\":\"w7--2hvH\",\"records_bugs_2026-03-10-simulator-wheel-scroll-leak-bugfix.md\":\"B6gIem2P\",\"records_bugs_2026-03-11-docs-server-bin-clean-bugfix.md\":\"GGWCjkok\",\"records_bugs_2026-03-11-render-result-runtime-sync-bugfix.md\":\"DRNUuaFT\",\"records_plans_2026-03-02-furniture-feature-plan.md\":\"CqSsyNDo\",\"records_plans_2026-03-10-simulator-events-console-plan.md\":\"CfHLEHcc\",\"records_plans_2026-03-10-simulator-last-successful-combo-cache-plan.md\":\"Z2RoK239\",\"records_plans_2026-03-10-simulator-map-parsed-view-plan.md\":\"S9jPz75o\",\"records_plans_2026-03-10-simulator-map-playground-refactor-plan.md\":\"BuILlmcV\",\"records_plans_2026-03-10-simulator-playground-plan.md\":\"CQAR-T7p\",\"records_plans_2026-03-10-simulator-runtime-controls-plan.md\":\"DSVD-qCa\",\"records_plans_2026-03-11-docs-cli-ui-polish-plan.md\":\"B8oZt_5R\",\"records_plans_2026-03-11-simulator-logger-dump-plan.md\":\"CkjDCM2N\",\"records_plans_2026-03-11-simulator-src-migration-implementation.md\":\"FnB5Cx6R\",\"records_plans_2026-03-11-simulator-src-migration-plan.md\":\"BBfaeRrq\",\"records_plans_2026-03-11-simulator-style-tokenization-plan.md\":\"D4BgkNlO\",\"reference_callbacks.md\":\"BIwuGR3s\",\"reference_config.md\":\"DJFVf513\",\"reference_data.md\":\"B_XpUFrn\",\"reference_methods.md\":\"eH-UCMbE\",\"reference_runtime.md\":\"BEy8BhSZ\",\"reference_types.md\":\"hikiO8Cq\",\"reference_utils.md\":\"Dy6XKVWh\",\"simulator_index.md\":\"CF95Y_c9\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Tuya Robot Map\",\"description\":\"涂鸦扫地机地图组件\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"siteTitle\":\"Tuya Robot Map\",\"outline\":{\"level\":[2,6],\"label\":\"页面导航\"},\"nav\":[{\"text\":\"首页\",\"link\":\"/\"},{\"text\":\"指南\",\"link\":\"/guide/concepts\",\"activeMatch\":\"^/guide/\"},{\"text\":\"参考\",\"link\":\"/reference/data\",\"activeMatch\":\"^/reference/\"},{\"text\":\"模拟调试\",\"link\":\"/simulator/\",\"activeMatch\":\"^/simulator/\"}],\"sidebar\":{\"/guide/\":[{\"text\":\"指南\",\"items\":[{\"text\":\"基本概念\",\"link\":\"/guide/concepts\"},{\"text\":\"快速开始\",\"link\":\"/guide/getting-started\"},{\"text\":\"进阶使用\",\"link\":\"/guide/advanced-usage\"}]}],\"/reference/\":[{\"text\":\"组件Props\",\"items\":[{\"text\":\"数据\",\"link\":\"/reference/data\"},{\"text\":\"配置\",\"link\":\"/reference/config\"},{\"text\":\"运行时\",\"link\":\"/reference/runtime\"},{\"text\":\"地图事件回调\",\"link\":\"/reference/callbacks\"}]},{\"text\":\"方法\",\"items\":[{\"text\":\"地图方法\",\"link\":\"/reference/methods\"},{\"text\":\"工具方法\",\"link\":\"/reference/utils\"}]},{\"text\":\"类型定义\",\"items\":[{\"text\":\"类型定义\",\"link\":\"/reference/types\"}]}],\"/simulator/\":[{\"text\":\"模拟调试\",\"items\":[{\"text\":\"实时模拟调试\",\"link\":\"/simulator/\"}]}]},\"search\":{\"provider\":\"local\"},\"lastUpdated\":{\"text\":\"最后更新于\",\"formatOptions\":{\"dateStyle\":\"short\",\"timeStyle\":\"short\"}}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
|
25
25
|
|
|
26
26
|
</body>
|
|
27
27
|
</html>
|