@ray-js/robot-map-sdk 0.0.6-beta.8 → 0.0.6
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/bin/mcp-server.js +124 -0
- package/dist/index.d.ts +191 -4
- package/dist/index.rjs.js +1 -1
- package/dist-app/assets/index-Cb0Ul36y.js +1 -0
- package/dist-app/index.html +1 -1
- package/dist-docs/404.html +2 -2
- package/dist-docs/assets/{app.CQVg0TIo.js → app.XWdqe1Jg.js} +1 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.jsScsXKs.js +1 -0
- package/dist-docs/assets/chunks/{VPLocalSearchBox.bA13bjBq.js → VPLocalSearchBox.BiAazhoT.js} +1 -1
- package/dist-docs/assets/chunks/{theme.CJUk_n1k.js → theme.D2rRQxPQ.js} +2 -2
- package/dist-docs/assets/{guide_advanced-usage.md.N6C1_tsi.js → guide_advanced-usage.md.B4LS-34s.js} +52 -8
- package/dist-docs/assets/{guide_advanced-usage.md.N6C1_tsi.lean.js → guide_advanced-usage.md.B4LS-34s.lean.js} +1 -1
- package/dist-docs/assets/{guide_getting-started.md.C0I2Hrft.js → guide_getting-started.md.DMnUXWCy.js} +1 -1
- package/dist-docs/assets/reference_config.md.DLC4kvTR.js +107 -0
- package/dist-docs/assets/reference_config.md.DLC4kvTR.lean.js +1 -0
- package/dist-docs/assets/reference_runtime.md.BnT09w_m.js +19 -0
- package/dist-docs/assets/reference_runtime.md.BnT09w_m.lean.js +1 -0
- package/dist-docs/assets/{reference_types.md.BezgeVDp.js → reference_types.md.CL_VFfB8.js} +33 -3
- package/dist-docs/assets/reference_types.md.CL_VFfB8.lean.js +1 -0
- package/dist-docs/guide/advanced-usage.html +55 -11
- package/dist-docs/guide/concepts.html +3 -3
- package/dist-docs/guide/getting-started.html +5 -5
- package/dist-docs/hashmap.json +1 -1
- package/dist-docs/index.html +3 -3
- package/dist-docs/reference/callbacks.html +3 -3
- package/dist-docs/reference/config.html +47 -7
- package/dist-docs/reference/data.html +3 -3
- package/dist-docs/reference/methods.html +3 -3
- package/dist-docs/reference/runtime.html +5 -5
- package/dist-docs/reference/types.html +36 -6
- package/dist-docs/reference/utils.html +3 -3
- package/package.json +14 -4
- package/dist-app/assets/index-DVPHRsnu.js +0 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.fwP4JnhB.js +0 -1
- package/dist-docs/assets/reference_config.md.HZKo49HT.js +0 -67
- package/dist-docs/assets/reference_config.md.HZKo49HT.lean.js +0 -1
- package/dist-docs/assets/reference_runtime.md.DnKqKiB4.js +0 -19
- package/dist-docs/assets/reference_runtime.md.DnKqKiB4.lean.js +0 -1
- package/dist-docs/assets/reference_types.md.BezgeVDp.lean.js +0 -1
- /package/dist-docs/assets/{guide_getting-started.md.C0I2Hrft.lean.js → guide_getting-started.md.DMnUXWCy.lean.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,c as t,o as r,ag as i}from"./chunks/framework.DRADY2L-.js";const g=JSON.parse('{"title":"配置","description":"","frontmatter":{},"headers":[],"relativePath":"reference/config.md","filePath":"reference/config.md","lastUpdated":1770281833000}'),a={name:"reference/config.md"};function l(n,o,s,c,d,h){return r(),t("div",null,[...o[0]||(o[0]=[i("",1093)])])}const u=e(a,[["render",l]]);export{g as __pageData,u as default};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{_ as e,c as i,o as a,ag as s}from"./chunks/framework.DRADY2L-.js";const g=JSON.parse('{"title":"运行时配置","description":"","frontmatter":{},"headers":[],"relativePath":"reference/runtime.md","filePath":"reference/runtime.md","lastUpdated":1770281833000}'),n={name:"reference/runtime.md"};function t(l,o,r,d,h,c){return a(),i("div",null,[...o[0]||(o[0]=[s(`<h1 id="运行时配置" tabindex="-1">运行时配置 <a class="header-anchor" href="#运行时配置" aria-label="Permalink to "运行时配置""></a></h1><p>了解 RobotMap 的运行时配置项,用于控制地图在运行过程中的动态行为和状态。</p><h2 id="使用示例" tabindex="-1">使用示例 <a class="header-anchor" href="#使用示例" aria-label="Permalink to "使用示例""></a></h2><p>运行时配置通过 <code>runtime</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
|
+
<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
|
+
<span class="line"></span>
|
|
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>
|
|
5
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span></span>
|
|
6
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span></span>
|
|
7
|
+
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> runtime</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{{</span></span>
|
|
8
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> showPath: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
9
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> showChargingStation: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
10
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> showRoomName: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
11
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> showRoomProperty: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
12
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> showRoomOrder: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
13
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> enableRoomSelection: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
14
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ... 其他运行时配置</span></span>
|
|
15
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }}</span></span>
|
|
16
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ... 其他props</span></span>
|
|
17
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /></span></span>
|
|
18
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
|
|
19
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="dividingroomid" tabindex="-1">dividingRoomId <a class="header-anchor" href="#dividingroomid" aria-label="Permalink to "dividingRoomId""></a></h2><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>-1</code></li></ul><p>正在分割的房间ID。</p><p>你可以通过将 <code>dividingRoomId</code> 设置为 <code>-1</code> 来移除分割线。</p><h2 id="enableroomselection" tabindex="-1">enableRoomSelection <a class="header-anchor" href="#enableroomselection" aria-label="Permalink to "enableRoomSelection""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否启用房间选择功能</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li><strong>当 <code>enableRoomSelection</code> 为 <code>false</code> 时</strong>:房间使用普通展示模式的颜色(对应 <code>room.colors.normal</code>,若未定义则使用 <code>room.colors.active</code>)。</li><li><strong>当 <code>enableRoomSelection</code> 为 <code>true</code> 时</strong>:进入房间选择模式。房间颜色根据是否被选中(是否在 <code>selectRoomIds</code> 中)在 <code>active</code> 和 <code>inactive</code> 之间切换。</li></ul></div><h2 id="enableinteraction" tabindex="-1">enableInteraction <a class="header-anchor" href="#enableinteraction" aria-label="Permalink to "enableInteraction""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否启用交互功能。</p><p>当 <code>enableInteraction</code> 为 <code>false</code> 时,地图不会响应任何交互事件。</p><h2 id="enablemapclickcapture" tabindex="-1">enableMapClickCapture <a class="header-anchor" href="#enablemapclickcapture" aria-label="Permalink to "enableMapClickCapture""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否启用地图点击捕获功能。</p><p>开启地图点击捕获功能后,用户点击地图时会触发 <code>onClickMap</code> 回调。</p><h2 id="editingforbiddensweepzoneids" tabindex="-1">editingForbiddenSweepZoneIds <a class="header-anchor" href="#editingforbiddensweepzoneids" aria-label="Permalink to "editingForbiddenSweepZoneIds""></a></h2><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>正在编辑的禁扫区域ID列表。</p><h2 id="editingforbiddenmopzoneids" tabindex="-1">editingForbiddenMopZoneIds <a class="header-anchor" href="#editingforbiddenmopzoneids" aria-label="Permalink to "editingForbiddenMopZoneIds""></a></h2><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>正在编辑的禁拖区域ID列表。</p><h2 id="editingcleanzoneids" tabindex="-1">editingCleanZoneIds <a class="header-anchor" href="#editingcleanzoneids" aria-label="Permalink to "editingCleanZoneIds""></a></h2><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>正在编辑的清扫区域ID列表。</p><h2 id="editingvirtualwallids" tabindex="-1">editingVirtualWallIds <a class="header-anchor" href="#editingvirtualwallids" aria-label="Permalink to "editingVirtualWallIds""></a></h2><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>正在编辑的虚拟墙ID列表。</p><h2 id="editingspotids" tabindex="-1">editingSpotIds <a class="header-anchor" href="#editingspotids" aria-label="Permalink to "editingSpotIds""></a></h2><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>正在编辑的定点清扫ID列表。</p><h2 id="editingwaypointids" tabindex="-1">editingWayPointIds <a class="header-anchor" href="#editingwaypointids" aria-label="Permalink to "editingWayPointIds""></a></h2><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>正在编辑的途径点ID列表。</p><h2 id="maprotation" tabindex="-1">mapRotation <a class="header-anchor" href="#maprotation" aria-label="Permalink to "mapRotation""></a></h2><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>0</code></li><li><strong>单位</strong>: <code>度(°)</code></li></ul><p>地图旋转角度。</p><h2 id="roompropertyfoldids" tabindex="-1">roomPropertyFoldIds <a class="header-anchor" href="#roompropertyfoldids" aria-label="Permalink to "roomPropertyFoldIds""></a></h2><ul><li><strong>类型</strong>: <code>number[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>处于折叠状态的房间ID列表。</p><h2 id="roomselectionmode" tabindex="-1">roomSelectionMode <a class="header-anchor" href="#roomselectionmode" aria-label="Permalink to "roomSelectionMode""></a></h2><ul><li><strong>类型</strong>: <code>'checkmark' | 'order'</code></li><li><strong>默认值</strong>: <code>'checkmark'</code></li></ul><p>房间选中的指示方式。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>当 <code>roomSelectionMode</code> 为 <code>'checkmark'</code> 时,房间选中后会显示选择指示器。</p><p>当 <code>roomSelectionMode</code> 为 <code>'order'</code> 时,房间选中后会显示清扫顺序数字。</p></div><h2 id="selectroomids" tabindex="-1">selectRoomIds <a class="header-anchor" href="#selectroomids" aria-label="Permalink to "selectRoomIds""></a></h2><ul><li><strong>类型</strong>: <code>number[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>选中的房间ID列表。只有当 <code>enableRoomSelection</code> 为 <code>true</code> 时,这个值才会生效。</p><h2 id="showroomproperty" tabindex="-1">showRoomProperty <a class="header-anchor" href="#showroomproperty" aria-label="Permalink to "showRoomProperty""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否显示房间属性。</p><h2 id="showroomorder" tabindex="-1">showRoomOrder <a class="header-anchor" href="#showroomorder" aria-label="Permalink to "showRoomOrder""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示房间清扫顺序。</p><h2 id="showroomname" tabindex="-1">showRoomName <a class="header-anchor" href="#showroomname" aria-label="Permalink to "showRoomName""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示房间名称。</p><h2 id="showroomtype" tabindex="-1">showRoomType <a class="header-anchor" href="#showroomtype" aria-label="Permalink to "showRoomType""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示房间类型图标。</p><h2 id="showpath" tabindex="-1">showPath <a class="header-anchor" href="#showpath" aria-label="Permalink to "showPath""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示机器人路径。</p><h2 id="showchargingstation" tabindex="-1">showChargingStation <a class="header-anchor" href="#showchargingstation" aria-label="Permalink to "showChargingStation""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示充电桩。</p><h2 id="showroomfloortype" tabindex="-1">showRoomFloorType <a class="header-anchor" href="#showroomfloortype" aria-label="Permalink to "showRoomFloorType""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示房间地板材质。</p><h2 id="showcarpet" tabindex="-1">showCarpet <a class="header-anchor" href="#showcarpet" aria-label="Permalink to "showCarpet""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示地毯。</p><h2 id="showchargingstationring" tabindex="-1">showChargingStationRing <a class="header-anchor" href="#showchargingstationring" aria-label="Permalink to "showChargingStationRing""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否显示充电桩预警圈。</p><h2 id="showrobotring" tabindex="-1">showRobotRing <a class="header-anchor" href="#showrobotring" aria-label="Permalink to "showRobotRing""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否显示机器人预警圈。</p><h2 id="showrobotsleepanimation" tabindex="-1">showRobotSleepAnimation <a class="header-anchor" href="#showrobotsleepanimation" aria-label="Permalink to "showRobotSleepAnimation""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否显示机器人睡眠动画。</p><h2 id="showrobotpulsecircle" tabindex="-1">showRobotPulseCircle <a class="header-anchor" href="#showrobotpulsecircle" aria-label="Permalink to "showRobotPulseCircle""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否显示机器人脉冲圈(呼吸效果)。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>机器人脉冲圈会在机器人图标下方显示一个呼吸动画效果,可用于充电等状态的视觉提示。</p></div><h2 id="unit" tabindex="-1">unit <a class="header-anchor" href="#unit" aria-label="Permalink to "unit""></a></h2><ul><li><strong>类型</strong>: <code>meter | feet | centimeter</code></li><li><strong>默认值</strong>: <code>'meter'</code></li></ul><p>尺寸标签单位。</p><p>尺寸标签的显示会根据这个单位进行转换计算。</p><h2 id="unitlabel" tabindex="-1">unitLabel <a class="header-anchor" href="#unitlabel" aria-label="Permalink to "unitLabel""></a></h2><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>'m'</code></li></ul><p>尺寸标签单位显示文本。</p>`,96)])])}const u=e(n,[["render",t]]);export{g as __pageData,u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,c as i,o as a,ag as s}from"./chunks/framework.DRADY2L-.js";const g=JSON.parse('{"title":"运行时配置","description":"","frontmatter":{},"headers":[],"relativePath":"reference/runtime.md","filePath":"reference/runtime.md","lastUpdated":1770281833000}'),n={name:"reference/runtime.md"};function t(l,o,r,d,h,c){return a(),i("div",null,[...o[0]||(o[0]=[s("",96)])])}const u=e(n,[["render",t]]);export{g as __pageData,u as default};
|
|
@@ -1,9 +1,37 @@
|
|
|
1
|
-
import{_ as i,c as a,o as n,ag as p}from"./chunks/framework.DRADY2L-.js";const y=JSON.parse('{"title":"类型定义","description":"","frontmatter":{},"headers":[],"relativePath":"reference/types.md","filePath":"reference/types.md","lastUpdated":
|
|
1
|
+
import{_ as i,c as a,o as n,ag as p}from"./chunks/framework.DRADY2L-.js";const y=JSON.parse('{"title":"类型定义","description":"","frontmatter":{},"headers":[],"relativePath":"reference/types.md","filePath":"reference/types.md","lastUpdated":1770197345000}'),h={name:"reference/types.md"};function l(t,s,k,e,r,d){return n(),a("div",null,[...s[0]||(s[0]=[p(`<h1 id="类型定义" tabindex="-1">类型定义 <a class="header-anchor" href="#类型定义" aria-label="Permalink to "类型定义""></a></h1><p>了解 RobotMap 支持的各种数据类型和格式。</p><h2 id="point" tabindex="-1">Point <a class="header-anchor" href="#point" aria-label="Permalink to "Point {#point}""></a></h2><p>坐标点类型。</p><div class="language-typescript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Point</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
2
2
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** X坐标 */</span></span>
|
|
3
3
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> x</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
4
4
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** Y坐标 */</span></span>
|
|
5
5
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> y</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
6
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="direction" tabindex="-1">Direction <a class="header-anchor" href="#direction" aria-label="Permalink to "Direction {#direction}""></a></h2><p>方向类型。</p><div class="language-typescript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Direction</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'horizontal'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'vertical'</span></span></code></pre></div><h2 id="
|
|
6
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="direction" tabindex="-1">Direction <a class="header-anchor" href="#direction" aria-label="Permalink to "Direction {#direction}""></a></h2><p>方向类型。</p><div class="language-typescript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Direction</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'horizontal'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'vertical'</span></span></code></pre></div><h2 id="backgroundgradient" tabindex="-1">BackgroundGradient <a class="header-anchor" href="#backgroundgradient" aria-label="Permalink to "BackgroundGradient {#backgroundgradient}""></a></h2><p>渐变背景配置类型。</p><div class="language-typescript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> BackgroundGradient</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
7
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 渐变类型 */</span></span>
|
|
8
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> type</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'linear'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'radial'</span></span>
|
|
9
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 线性渐变起点x (相对于视口宽度,0-1) */</span></span>
|
|
10
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> x0</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
11
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 线性渐变起点y (相对于视口高度,0-1) */</span></span>
|
|
12
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> y0</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
13
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 线性渐变终点x (相对于视口宽度,0-1) */</span></span>
|
|
14
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> x1</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
15
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 线性渐变终点y (相对于视口高度,0-1) */</span></span>
|
|
16
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> y1</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
17
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 径向渐变中心x (相对于视口宽度,0-1) */</span></span>
|
|
18
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> cx</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
19
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 径向渐变中心y (相对于视口高度,0-1) */</span></span>
|
|
20
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> cy</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
21
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 径向渐变半径 (相对于视口对角线长度,0-1) */</span></span>
|
|
22
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> r</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
23
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 渐变色停靠点 */</span></span>
|
|
24
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> colorStops</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><{ </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">offset</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">; </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">color</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ColorSource</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }></span></span>
|
|
25
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="backgroundimage" tabindex="-1">BackgroundImage <a class="header-anchor" href="#backgroundimage" aria-label="Permalink to "BackgroundImage {#backgroundimage}""></a></h2><p>图片背景配置类型。</p><div class="language-typescript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> BackgroundImage</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
26
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 图片URL */</span></span>
|
|
27
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> src</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> string</span></span>
|
|
28
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 图片适应模式,默认'cover' */</span></span>
|
|
29
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> fit</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'fill'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'contain'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'cover'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'none'</span></span>
|
|
30
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 图片位置(x, y为相对于视口的比例,0-1),默认居中(0.5, 0.5) */</span></span>
|
|
31
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> position</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">x</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">; </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">y</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
32
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 是否重复平铺,默认false */</span></span>
|
|
33
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> repeat</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> boolean</span></span>
|
|
34
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="mapstate" tabindex="-1">MapState <a class="header-anchor" href="#mapstate" aria-label="Permalink to "MapState {#mapstate}""></a></h2><p>地图状态信息。</p><div class="language-typescript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MapState</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
7
35
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 地图ID */</span></span>
|
|
8
36
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> id</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
9
37
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 地图状态 */</span></span>
|
|
@@ -74,6 +102,8 @@ import{_ as i,c as a,o as n,ag as p}from"./chunks/framework.DRADY2L-.js";const y
|
|
|
74
102
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> cistern</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
75
103
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 清洁模式 */</span></span>
|
|
76
104
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> cleanMode</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
105
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 房间类型 */</span></span>
|
|
106
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> type</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> null</span></span>
|
|
77
107
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 自定义数据 */</span></span>
|
|
78
108
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> customData</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Record</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">any</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
|
79
109
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="roomdata" tabindex="-1">RoomData <a class="header-anchor" href="#roomdata" aria-label="Permalink to "RoomData {#roomdata}""></a></h2><p>房间显示数据类型。</p><div class="language-typescript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> RoomData</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> RoomProperty</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
@@ -194,4 +224,4 @@ import{_ as i,c as a,o as n,ag as p}from"./chunks/framework.DRADY2L-.js";const y
|
|
|
194
224
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> height</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
195
225
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 自定义数据 */</span></span>
|
|
196
226
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> customData</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Record</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">any</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
|
197
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div>`,
|
|
227
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div>`,50)])])}const F=i(h,[["render",l]]);export{y as __pageData,F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as i,c as a,o as n,ag as p}from"./chunks/framework.DRADY2L-.js";const y=JSON.parse('{"title":"类型定义","description":"","frontmatter":{},"headers":[],"relativePath":"reference/types.md","filePath":"reference/types.md","lastUpdated":1770197345000}'),h={name:"reference/types.md"};function l(t,s,k,e,r,d){return n(),a("div",null,[...s[0]||(s[0]=[p("",50)])])}const F=i(h,[["render",l]]);export{y as __pageData,F as default};
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
<link rel="preload stylesheet" href="/assets/style.CN_tJoU2.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.XWdqe1Jg.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.D2rRQxPQ.js">
|
|
15
15
|
<link rel="modulepreload" href="/assets/chunks/framework.DRADY2L-.js">
|
|
16
|
-
<link rel="modulepreload" href="/assets/guide_advanced-usage.md.
|
|
16
|
+
<link rel="modulepreload" href="/assets/guide_advanced-usage.md.B4LS-34s.lean.js">
|
|
17
17
|
<script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
|
|
18
18
|
<script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
|
|
19
19
|
</head>
|
|
@@ -108,8 +108,11 @@
|
|
|
108
108
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ✅ 推荐:所有数组长度一致</span></span>
|
|
109
109
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> active: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#a8c8f5'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#9de5c7'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#d4b9f7'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#ffd399'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">],</span></span>
|
|
110
110
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> inactive: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#d6e7fc'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#d1f4e5'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#ece0fb'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#fff0d9'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">],</span></span>
|
|
111
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> normal: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#a8c8f5'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#9de5c7'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#d4b9f7'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#ffd399'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">], </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 普通模式背景</span></span>
|
|
111
112
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> name: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#2563b8'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#26966b'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#7c3fb8'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#d97706'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">],</span></span>
|
|
113
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> nameNormal: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#2563b8'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#26966b'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#7c3fb8'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#d97706'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">], </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 普通模式文字</span></span>
|
|
112
114
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> propertyTheme: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#2563b8'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#26966b'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#7c3fb8'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#d97706'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">],</span></span>
|
|
115
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> propertyThemeNormal: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#2563b8'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#26966b'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#7c3fb8'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'#d97706'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">], </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 普通模式图标</span></span>
|
|
113
116
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> selectionIndicatorBackground: [</span></span>
|
|
114
117
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '#2563b8'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
115
118
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '#26966b'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
@@ -119,7 +122,7 @@
|
|
|
119
122
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
120
123
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
121
124
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }}</span></span>
|
|
122
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/></span></span></code></pre></div><p>这样可以确保房间的所有视觉元素(填充色、名称、属性图标等)都使用一致的配色主题。</p><h4 id="颜色对比度" tabindex="-1">颜色对比度 <a class="header-anchor" href="#颜色对比度" aria-label="Permalink to "颜色对比度""></a></h4><p>选择颜色时要考虑:</p><ul><li><strong>相邻房间的区分度</strong>:相邻房间的颜色应该有足够的对比,便于用户区分</li><li><strong>文字可读性</strong>:房间名称、属性图标等文字元素的颜色要与背景色有足够对比</li><li><strong>无障碍访问</strong>:考虑色盲用户,避免仅依靠红绿色进行区分</li></ul><h3 id="相关配置项-1" tabindex="-1">相关配置项 <a class="header-anchor" href="#相关配置项-1" aria-label="Permalink to "相关配置项""></a></h3><p>以下配置项与房间智能配色相关:</p><table tabindex="0"><thead><tr><th>配置项</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td><a href="/reference/config.html#room-colors-strategy"><code>room.colors.strategy</code></a></td><td><code>'balanced'</code></td><td>颜色分配策略(<code>priority</code> 或 <code>balanced</code>)</td></tr><tr><td><a href="/reference/config.html#room-colors-sortby"><code>room.colors.sortBy</code></a></td><td><code>'index'</code></td><td>房间排序方式(<code>index</code> 或 <code>area</code>)</td></tr><tr><td><a href="/reference/config.html#room-colors-active"><code>room.colors.active</code></a></td><td>4 种颜色</td><td
|
|
125
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/></span></span></code></pre></div><p>这样可以确保房间的所有视觉元素(填充色、名称、属性图标等)都使用一致的配色主题。</p><h4 id="颜色对比度" tabindex="-1">颜色对比度 <a class="header-anchor" href="#颜色对比度" aria-label="Permalink to "颜色对比度""></a></h4><p>选择颜色时要考虑:</p><ul><li><strong>相邻房间的区分度</strong>:相邻房间的颜色应该有足够的对比,便于用户区分</li><li><strong>文字可读性</strong>:房间名称、属性图标等文字元素的颜色要与背景色有足够对比</li><li><strong>无障碍访问</strong>:考虑色盲用户,避免仅依靠红绿色进行区分</li></ul><h3 id="相关配置项-1" tabindex="-1">相关配置项 <a class="header-anchor" href="#相关配置项-1" aria-label="Permalink to "相关配置项""></a></h3><p>以下配置项与房间智能配色相关:</p><table tabindex="0"><thead><tr><th>配置项</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td><a href="/reference/config.html#room-colors-strategy"><code>room.colors.strategy</code></a></td><td><code>'balanced'</code></td><td>颜色分配策略(<code>priority</code> 或 <code>balanced</code>)</td></tr><tr><td><a href="/reference/config.html#room-colors-sortby"><code>room.colors.sortBy</code></a></td><td><code>'index'</code></td><td>房间排序方式(<code>index</code> 或 <code>area</code>)</td></tr><tr><td><a href="/reference/config.html#room-colors-active"><code>room.colors.active</code></a></td><td>4 种颜色</td><td><code>enableRoomSelection: true</code> 时选中房间的填充色</td></tr><tr><td><a href="/reference/config.html#room-colors-inactive"><code>room.colors.inactive</code></a></td><td>4 种颜色</td><td><code>enableRoomSelection: true</code> 时未选中房间的填充色</td></tr><tr><td><a href="/reference/config.html#room-colors-normal"><code>room.colors.normal</code></a></td><td><code>undefined</code></td><td><code>enableRoomSelection: false</code> 时的填充色(若未定义则使用 <code>active</code>)</td></tr><tr><td><a href="/reference/config.html#room-colors-name"><code>room.colors.name</code></a></td><td>4 种颜色</td><td><code>enableRoomSelection: true</code> 时选中房间的文字颜色</td></tr><tr><td><a href="/reference/config.html#room-colors-namenormal"><code>room.colors.nameNormal</code></a></td><td><code>undefined</code></td><td><code>enableRoomSelection: false</code> 时的文字颜色(若未定义则使用 <code>name</code>)</td></tr><tr><td><a href="/reference/config.html#room-colors-propertytheme"><code>room.colors.propertyTheme</code></a></td><td>4 种颜色</td><td><code>enableRoomSelection: true</code> 时选中房间的图标颜色</td></tr><tr><td><a href="/reference/config.html#room-colors-propertythemenormal"><code>room.colors.propertyThemeNormal</code></a></td><td><code>undefined</code></td><td><code>enableRoomSelection: false</code> 时的图标颜色(若未定义则使用 <code>propertyTheme</code>)</td></tr><tr><td><a href="/reference/config.html#map-adjacencythreshold"><code>map.adjacencyThreshold</code></a></td><td><code>3</code></td><td>房间相邻判定阈值(单位:像素)</td></tr></tbody></table><h2 id="选择房间" tabindex="-1">选择房间 <a class="header-anchor" href="#选择房间" aria-label="Permalink to "选择房间""></a></h2><p>用于选区清扫、定时预约、房间分割等业务场景。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>选择房间是完全受控的,取决于你传入的 <code>enableRoomSelection</code> 和 <code>selectRoomIds</code>。点击房间的时候组件内部并不会做任何事,只是抛出 <code>onClickRoom</code> 事件。</p></div><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>
|
|
123
126
|
<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>
|
|
124
127
|
<span class="line"></span>
|
|
125
128
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MapPage</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> () </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
@@ -146,18 +149,23 @@
|
|
|
146
149
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> config</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{{</span></span>
|
|
147
150
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> room: {</span></span>
|
|
148
151
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> colors: {</span></span>
|
|
149
|
-
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">
|
|
152
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /**</span></span>
|
|
150
153
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> * 房间颜色数组(建议至少 4 种颜色)</span></span>
|
|
151
154
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> * 使用四色定理算法自动分配,确保相邻房间颜色不同</span></span>
|
|
152
|
-
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> * enableRoomSelection 为 true
|
|
153
|
-
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> * enableRoomSelection 为 false
|
|
155
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> * - 当 enableRoomSelection 为 true 时:代表“选中”房间的颜色</span></span>
|
|
156
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> * - 当 enableRoomSelection 为 false 时:代表房间的默认展示颜色(若未配置 normal 则使用此项)</span></span>
|
|
154
157
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> */</span></span>
|
|
155
158
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> active: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">YOUR_ACTIVE_COLORS</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
156
159
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /**</span></span>
|
|
157
160
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> * 非激活状态的房间颜色数组(建议与 active 长度一致)</span></span>
|
|
158
|
-
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> * enableRoomSelection 为 true
|
|
161
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> * 仅在 enableRoomSelection 为 true 且房间“未选中”时生效</span></span>
|
|
159
162
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> */</span></span>
|
|
160
163
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> inactive: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">YOUR_INACTIVE_COLORS</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
164
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /**</span></span>
|
|
165
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> * 普通展示模式下的颜色数组(可选)</span></span>
|
|
166
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> * 仅在 enableRoomSelection 为 false 时生效,若不配置则默认使用 active 颜色</span></span>
|
|
167
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> */</span></span>
|
|
168
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> normal: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">YOUR_NORMAL_COLORS</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
161
169
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
162
170
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 选择指示器配置</span></span>
|
|
163
171
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> selectionIndicator: {</span></span>
|
|
@@ -485,6 +493,8 @@
|
|
|
485
493
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> cistern</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> null</span></span>
|
|
486
494
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 清洁模式 */</span></span>
|
|
487
495
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> cleanMode</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> null</span></span>
|
|
496
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 房间类型 */</span></span>
|
|
497
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> type</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> null</span></span>
|
|
488
498
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 自定义属性 */</span></span>
|
|
489
499
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> customData</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Record</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">any</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
|
490
500
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>对于不同的扫地机协议 <code>roomProperties</code> 的获取方式不同。</p><ul><li>点阵协议:可以通过 <code>decodeRoomProperties</code> 方法解析原始地图数据获取</li></ul><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">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>
|
|
@@ -502,7 +512,41 @@
|
|
|
502
512
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
|
|
503
513
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> .</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">catch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">((</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
504
514
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> console.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'请求失败:'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, error)</span></span>
|
|
505
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span></code></pre></div><h3 id="
|
|
515
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span></code></pre></div><h3 id="房间类型图标" tabindex="-1">房间类型图标 <a class="header-anchor" href="#房间类型图标" aria-label="Permalink to "房间类型图标""></a></h3><p>SDK 支持在房间名称旁边显示预设的房间类型图标(如客厅、卧室、厨房等)。</p><h4 id="配置图标资源" tabindex="-1">配置图标资源 <a class="header-anchor" href="#配置图标资源" aria-label="Permalink to "配置图标资源""></a></h4><p>你可以通过 <code>config.room.type</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:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span></span>
|
|
516
|
+
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> config</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{{</span></span>
|
|
517
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> room: {</span></span>
|
|
518
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> type: {</span></span>
|
|
519
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 图标显示在文字左侧</span></span>
|
|
520
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> position: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'left'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
521
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 图标与文字间距</span></span>
|
|
522
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> gap: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">6</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
523
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 图标大小</span></span>
|
|
524
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> iconSize: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">16</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
525
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 背景容器配置</span></span>
|
|
526
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> container: {</span></span>
|
|
527
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> visible: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
528
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> size: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">24</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
529
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> borderRadius: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">4</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
530
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
531
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
532
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
533
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }}</span></span>
|
|
534
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/></span></span></code></pre></div><h4 id="使用图标" tabindex="-1">使用图标 <a class="header-anchor" href="#使用图标" aria-label="Permalink to "使用图标""></a></h4><p>在传入的 <code>roomProperties</code> 数据中包含 <code>type</code> 字段(数值类型),SDK 会自动根据索引从内置图标库或自定义资源中加载图标。</p><p><strong>示例代码:</strong></p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> roomProperties</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span></span>
|
|
535
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
536
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> id: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
537
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> name: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'客厅'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
538
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> type: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 对应内置图标:客厅</span></span>
|
|
539
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
540
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
541
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> id: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
542
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> name: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'主卧'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
543
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> type: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">3</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 对应内置图标:主卧</span></span>
|
|
544
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
545
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span></code></pre></div><h4 id="动态控制显示" tabindex="-1">动态控制显示 <a class="header-anchor" href="#动态控制显示" aria-label="Permalink to "动态控制显示""></a></h4><p>通过 <code>runtime.showRoomType</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:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span></span>
|
|
546
|
+
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> runtime</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{{</span></span>
|
|
547
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> showRoomType: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 开启显示</span></span>
|
|
548
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }}</span></span>
|
|
549
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/></span></span></code></pre></div><h3 id="自定义属性" tabindex="-1">自定义属性 <a class="header-anchor" href="#自定义属性" aria-label="Permalink to "自定义属性""></a></h3><p>如果需要在房间气泡中显示自定义属性,可以这样:</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> React </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'react'</span></span>
|
|
506
550
|
<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>
|
|
507
551
|
<span class="line"></span>
|
|
508
552
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MapPage</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> () </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
@@ -857,8 +901,8 @@
|
|
|
857
901
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (mapApi) {</span></span>
|
|
858
902
|
<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>
|
|
859
903
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
860
|
-
<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-
|
|
861
|
-
<script>window.__VP_HASH_MAP__=JSON.parse("{\"guide_advanced-usage.md\":\"
|
|
904
|
+
<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-02-05T08:57:13.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>
|
|
905
|
+
<script>window.__VP_HASH_MAP__=JSON.parse("{\"guide_advanced-usage.md\":\"B4LS-34s\",\"guide_concepts.md\":\"DBFk-g-l\",\"guide_getting-started.md\":\"DMnUXWCy\",\"index.md\":\"Sm6vD2Gl\",\"reference_callbacks.md\":\"CZ8IiuH-\",\"reference_config.md\":\"DLC4kvTR\",\"reference_data.md\":\"DciSLVC8\",\"reference_methods.md\":\"BNxMKwmx\",\"reference_runtime.md\":\"BnT09w_m\",\"reference_types.md\":\"CL_VFfB8\",\"reference_utils.md\":\"CSshxnp0\"}");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/\"}],\"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\"}]}]},\"search\":{\"provider\":\"local\"},\"lastUpdated\":{\"text\":\"最后更新于\",\"formatOptions\":{\"dateStyle\":\"short\",\"timeStyle\":\"short\"}}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
|
862
906
|
|
|
863
907
|
</body>
|
|
864
908
|
</html>
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
<link rel="preload stylesheet" href="/assets/style.CN_tJoU2.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.XWdqe1Jg.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.D2rRQxPQ.js">
|
|
15
15
|
<link rel="modulepreload" href="/assets/chunks/framework.DRADY2L-.js">
|
|
16
16
|
<link rel="modulepreload" href="/assets/guide_concepts.md.DBFk-g-l.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><!--]--><!--]--></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\":\"
|
|
24
|
+
<script>window.__VP_HASH_MAP__=JSON.parse("{\"guide_advanced-usage.md\":\"B4LS-34s\",\"guide_concepts.md\":\"DBFk-g-l\",\"guide_getting-started.md\":\"DMnUXWCy\",\"index.md\":\"Sm6vD2Gl\",\"reference_callbacks.md\":\"CZ8IiuH-\",\"reference_config.md\":\"DLC4kvTR\",\"reference_data.md\":\"DciSLVC8\",\"reference_methods.md\":\"BNxMKwmx\",\"reference_runtime.md\":\"BnT09w_m\",\"reference_types.md\":\"CL_VFfB8\",\"reference_utils.md\":\"CSshxnp0\"}");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/\"}],\"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\"}]}]},\"search\":{\"provider\":\"local\"},\"lastUpdated\":{\"text\":\"最后更新于\",\"formatOptions\":{\"dateStyle\":\"short\",\"timeStyle\":\"short\"}}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
|
25
25
|
|
|
26
26
|
</body>
|
|
27
27
|
</html>
|