@ray-js/robot-map-sdk 0.0.9-beta.3 → 0.0.9
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/constant/methods.js +1 -1
- package/dist/index.d.ts +177 -6
- package/dist/index.rjs.js +1 -1
- package/dist-app/assets/doubleBed-CzextF6m.png +0 -0
- package/dist-app/assets/index-BzBtiwcY.js +1 -0
- package/dist-app/index.html +1 -1
- package/dist-docs/404.html +2 -2
- package/dist-docs/assets/{app.BhvJYn39.js → app.BJnAJzet.js} +1 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.HZmZuAtg.js +1 -0
- package/dist-docs/assets/chunks/{VPLocalSearchBox.B8QXL3Iw.js → VPLocalSearchBox.D9iYIKMO.js} +1 -1
- package/dist-docs/assets/chunks/{theme.Nx563P9F.js → theme.D78lSkQK.js} +2 -2
- package/dist-docs/assets/{guide_advanced-usage.md.BQuNyTwG.js → guide_advanced-usage.md.BPrKHNKt.js} +81 -3
- package/dist-docs/assets/{guide_advanced-usage.md.BQuNyTwG.lean.js → guide_advanced-usage.md.BPrKHNKt.lean.js} +1 -1
- package/dist-docs/assets/{guide_getting-started.md.COeLD2eD.js → guide_getting-started.md.Zvm4buzY.js} +1 -1
- package/dist-docs/assets/plans_2026-03-04-detected-objects-visibility-design.md.530AI9zE.js +1 -0
- package/dist-docs/assets/plans_2026-03-04-detected-objects-visibility-design.md.530AI9zE.lean.js +1 -0
- package/dist-docs/assets/plans_2026-03-04-show-detected-objects-implementation-plan.md.foeG7qiK.js +34 -0
- package/dist-docs/assets/plans_2026-03-04-show-detected-objects-implementation-plan.md.foeG7qiK.lean.js +1 -0
- package/dist-docs/assets/records_bugs_2026-02-28-fix-pixi-bindgroup-webgpu-snapshot-whitescreen-bugfix.md.BT3816jW.js +2 -0
- package/dist-docs/assets/records_bugs_2026-02-28-fix-pixi-bindgroup-webgpu-snapshot-whitescreen-bugfix.md.BT3816jW.lean.js +1 -0
- package/dist-docs/assets/records_plans_2026-03-02-furniture-feature-plan.md.DkXKivuL.js +1 -0
- package/dist-docs/assets/records_plans_2026-03-02-furniture-feature-plan.md.DkXKivuL.lean.js +1 -0
- package/dist-docs/assets/{reference_callbacks.md.CZ8IiuH-.js → reference_callbacks.md.CwvDSJWk.js} +2 -2
- package/dist-docs/assets/{reference_callbacks.md.CZ8IiuH-.lean.js → reference_callbacks.md.CwvDSJWk.lean.js} +1 -1
- package/dist-docs/assets/{reference_config.md.B0jHOsqG.js → reference_config.md.CK4ueBig.js} +24 -3
- package/dist-docs/assets/reference_config.md.CK4ueBig.lean.js +1 -0
- package/dist-docs/assets/{reference_methods.md.CEJFnJJg.js → reference_methods.md.CL2sjTJ7.js} +8 -3
- package/dist-docs/assets/reference_methods.md.CL2sjTJ7.lean.js +1 -0
- package/dist-docs/assets/{reference_runtime.md.BnT09w_m.js → reference_runtime.md.aDpGKfHs.js} +3 -2
- package/dist-docs/assets/{reference_runtime.md.BnT09w_m.lean.js → reference_runtime.md.aDpGKfHs.lean.js} +1 -1
- package/dist-docs/assets/{reference_types.md.CL_VFfB8.js → reference_types.md.D2IglsHQ.js} +9 -2
- package/dist-docs/assets/{reference_types.md.CL_VFfB8.lean.js → reference_types.md.D2IglsHQ.lean.js} +1 -1
- package/dist-docs/guide/advanced-usage.html +84 -6
- 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 +25 -0
- package/dist-docs/plans/2026-03-04-show-detected-objects-implementation-plan.html +58 -0
- package/dist-docs/records/bugs/2026-02-28-fix-pixi-bindgroup-webgpu-snapshot-whitescreen-bugfix.html +26 -0
- package/dist-docs/records/plans/2026-03-02-furniture-feature-plan.html +25 -0
- package/dist-docs/reference/callbacks.html +5 -5
- package/dist-docs/reference/config.html +27 -6
- package/dist-docs/reference/data.html +3 -3
- package/dist-docs/reference/methods.html +11 -6
- package/dist-docs/reference/runtime.html +6 -5
- package/dist-docs/reference/types.html +12 -5
- package/dist-docs/reference/utils.html +3 -3
- package/package.json +2 -2
- package/dist-app/assets/index-B29F5iw3.js +0 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.BcHnsGL-.js +0 -1
- package/dist-docs/assets/reference_config.md.B0jHOsqG.lean.js +0 -1
- package/dist-docs/assets/reference_methods.md.CEJFnJJg.lean.js +0 -1
- /package/dist-docs/assets/{guide_getting-started.md.COeLD2eD.lean.js → guide_getting-started.md.Zvm4buzY.lean.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as i,c as e,o as a,ag as t}from"./chunks/framework.DRADY2L-.js";const g=JSON.parse('{"title":"配置","description":"","frontmatter":{},"headers":[],"relativePath":"reference/config.md","filePath":"reference/config.md","lastUpdated":1772620557000}'),s={name:"reference/config.md"};function r(l,o,n,c,d,h){return a(),e("div",null,[...o[0]||(o[0]=[t("",1299)])])}const u=i(s,[["render",r]]);export{g as __pageData,u as default};
|
package/dist-docs/assets/{reference_methods.md.CEJFnJJg.js → reference_methods.md.CL2sjTJ7.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as i,c as a,o as n,ag as t}from"./chunks/framework.DRADY2L-.js";const g=JSON.parse('{"title":"地图方法","description":"","frontmatter":{},"headers":[],"relativePath":"reference/methods.md","filePath":"reference/methods.md","lastUpdated":
|
|
1
|
+
import{_ as i,c as a,o as n,ag as t}from"./chunks/framework.DRADY2L-.js";const g=JSON.parse('{"title":"地图方法","description":"","frontmatter":{},"headers":[],"relativePath":"reference/methods.md","filePath":"reference/methods.md","lastUpdated":1772617250000}'),e={name:"reference/methods.md"};function p(h,s,l,k,r,d){return n(),a("div",null,[...s[0]||(s[0]=[t(`<h1 id="地图方法" tabindex="-1">地图方法 <a class="header-anchor" href="#地图方法" aria-label="Permalink to "地图方法""></a></h1><p>了解 RobotMap 提供的 API 方法。</p><h2 id="使用示例" tabindex="-1">使用示例 <a class="header-anchor" href="#使用示例" aria-label="Permalink to "使用示例""></a></h2><p>通过 <code>onMapReady</code> 回调获得 <code>MapApi</code> 实例,该实例包含所有可调用的地图方法。这些方法让你可以主动控制地图行为、查询数据和执行各种操作。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { MapApi } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@ray-js/robot-map'</span></span>
|
|
2
2
|
<span class="line"></span>
|
|
3
3
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MapPage</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
|
|
4
4
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> mapApi</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> useRef</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">MapApi</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
|
|
@@ -38,7 +38,11 @@ import{_ as i,c as a,o as n,ag as t}from"./chunks/framework.DRADY2L-.js";const g
|
|
|
38
38
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> size</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
39
39
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetX</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
40
40
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetY</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
41
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">Point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]></span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>options</code> - 配置选项</li><li><code>options.size</code>: <code>number</code> - 区域大小,单位米,默认使用配置中的最小尺寸</li><li><code>options.offsetX</code>: <code>number</code> - X方向像素偏移,支持负数,默认为 0</li><li><code>options.offsetY</code>: <code>number</code> - Y方向像素偏移,支持负数,默认为 0</li></ul><p><strong>返回值</strong>: <a href="/reference/types.html#point"><code>Promise<Point[]></code></a></p><h2 id="
|
|
41
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">Point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]></span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>options</code> - 配置选项</li><li><code>options.size</code>: <code>number</code> - 区域大小,单位米,默认使用配置中的最小尺寸</li><li><code>options.offsetX</code>: <code>number</code> - X方向像素偏移,支持负数,默认为 0</li><li><code>options.offsetY</code>: <code>number</code> - Y方向像素偏移,支持负数,默认为 0</li></ul><p><strong>返回值</strong>: <a href="/reference/types.html#point"><code>Promise<Point[]></code></a></p><h2 id="drawfurnitures" tabindex="-1">drawFurnitures() <a class="header-anchor" href="#drawfurnitures" aria-label="Permalink to "drawFurnitures()""></a></h2><p>绘制家具。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> drawFurnitures</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">items</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> FurnitureParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[])</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">void</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>items</code>: <a href="/reference/types.html#furnitureparam"><code>FurnitureParam[]</code></a> - 家具数据数组。新 ID 会被添加,已有 ID 的数据变化会被更新,不在列表中的已有 ID 会被移除。传入空数组即清空所有家具。</li></ul><p><strong>返回值</strong>: <code>Promise<void></code></p><h2 id="getfurniturepointsbyviewportcenter" tabindex="-1">getFurniturePointsByViewportCenter() <a class="header-anchor" href="#getfurniturepointsbyviewportcenter" aria-label="Permalink to "getFurniturePointsByViewportCenter()""></a></h2><p>基于视口中心生成家具的四个顶点坐标。初始尺寸来源于 <code>config.furniture.assets</code> 中对应类型的 <code>width</code>/<code>height</code>(单位为米),SDK 内部根据地图 <code>resolution</code> 自动转换为像素坐标。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> getFurniturePointsByViewportCenter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
42
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> furnitureType</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
43
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetX</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
44
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetY</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
45
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">Point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]></span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>options</code> - 配置选项</li><li><code>options.furnitureType</code>: <code>number</code> - 家具类型编号,匹配 <code>config.furniture.assets</code> 中的 <code>type</code>。默认使用第一个素材的类型</li><li><code>options.offsetX</code>: <code>number</code> - X方向像素偏移,支持负数,默认为 0</li><li><code>options.offsetY</code>: <code>number</code> - Y方向像素偏移,支持负数,默认为 0</li></ul><p><strong>返回值</strong>: <a href="/reference/types.html#point"><code>Promise<Point[]></code></a></p><h2 id="getspotpointbyviewportcenter" tabindex="-1">getSpotPointByViewportCenter() <a class="header-anchor" href="#getspotpointbyviewportcenter" aria-label="Permalink to "getSpotPointByViewportCenter()""></a></h2><p>基于视口中心生成定点清扫的点坐标。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> getSpotPointByViewportCenter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
42
46
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetX</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
43
47
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetY</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
44
48
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">Point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>options</code> - 配置选项</li><li><code>options.size</code>: <code>number</code> - 区域大小,单位米,默认使用配置中的最小尺寸</li><li><code>options.offsetX</code>: <code>number</code> - X方向像素偏移,支持负数,默认为 0</li><li><code>options.offsetY</code>: <code>number</code> - Y方向像素偏移,支持负数,默认为 0</li></ul><p><strong>返回值</strong>: <a href="/reference/types.html#point"><code>Promise<Point[]></code></a></p><h2 id="isnearchargerorrobot" tabindex="-1">isNearChargerOrRobot() <a class="header-anchor" href="#isnearchargerorrobot" aria-label="Permalink to "isNearChargerOrRobot()""></a></h2><p>判断一个点、墙体或区域是否与充电桩或机器人距离小于阈值。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> isNearChargerOrRobot</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span></span>
|
|
@@ -151,7 +155,8 @@ import{_ as i,c as a,o as n,ag as t}from"./chunks/framework.DRADY2L-.js";const g
|
|
|
151
155
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> forbiddenMopZones</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ZoneParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]</span></span>
|
|
152
156
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> virtualWalls</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> VirtualWallParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]</span></span>
|
|
153
157
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> detectedObjects</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> DetectedObjectParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]</span></span>
|
|
158
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> furnitures</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> FurnitureParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]</span></span>
|
|
154
159
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
155
160
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> runtime</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> DeepPartialRuntimeConfig</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
156
161
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">backgroundColor</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ColorSource</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
157
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>data</code> - 地图数据对象</li><li><code>data.map</code>: <code>string</code> - 地图字符串数据 (支持结构化协议和栅格协议)</li><li><code>data.path</code>: <code>string</code> - 可选的路径数据</li><li><code>data.roomProperties</code>: <code>RoomProperty[]</code> - 可选的房间属性数据</li><li><code>data.customElements</code>: <code>CustomElementParam[]</code> - 可选的自定义元素数据</li><li><code>data.forbiddenSweepZones</code>: <code>ZoneParam[]</code> - 可选的禁扫区域数据</li><li><code>data.forbiddenMopZones</code>: <code>ZoneParam[]</code> - 可选的禁拖区域数据</li><li><code>data.virtualWalls</code>: <code>VirtualWallParam[]</code> - 可选的虚拟墙数据</li><li><code>data.detectedObjects</code>: <code>DetectedObjectParam[]</code> - 可选的检测物体数据</li><li><code>runtime</code> - 可选的运行时配置 (DeepPartialRuntimeConfig)</li><li><code>options</code> - 截图配置选项</li><li><code>options.backgroundColor</code>: <code>ColorSource</code> - 指定生成截图时的背景颜色。若不指定,将默认使用 <code>config.global.backgroundColor</code>。</li></ul><p><strong>返回值</strong>: <a href="/reference/types.html#string"><code>Promise<string></code></a> - Base64 格式的图片数据 (Data URL)。</p><h2 id="forceendgesture" tabindex="-1">forceEndGesture() <a class="header-anchor" href="#forceendgesture" aria-label="Permalink to "forceEndGesture()""></a></h2><p>强制结束当前正在进行的手势交互。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> forceEndGesture</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">void</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><p><strong>返回值</strong>: <code>Promise<void></code></p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>该方法主要用于解决小程序异层渲染导致的 <code>touchend</code> 事件丢失问题。如果小程序侧通过原生手势监听到松手,但 SDK 由于层级劫持未收到事件,可调用此方法手动终止 SDK 内部的手势状态。这会触发当前的控制元素(如禁区)执行最终的位置更新并抛出 <code>onUpdateXxx</code> 回调。</p></div>`,
|
|
162
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>data</code> - 地图数据对象</li><li><code>data.map</code>: <code>string</code> - 地图字符串数据 (支持结构化协议和栅格协议)</li><li><code>data.path</code>: <code>string</code> - 可选的路径数据</li><li><code>data.roomProperties</code>: <code>RoomProperty[]</code> - 可选的房间属性数据</li><li><code>data.customElements</code>: <code>CustomElementParam[]</code> - 可选的自定义元素数据</li><li><code>data.forbiddenSweepZones</code>: <code>ZoneParam[]</code> - 可选的禁扫区域数据</li><li><code>data.forbiddenMopZones</code>: <code>ZoneParam[]</code> - 可选的禁拖区域数据</li><li><code>data.virtualWalls</code>: <code>VirtualWallParam[]</code> - 可选的虚拟墙数据</li><li><code>data.detectedObjects</code>: <code>DetectedObjectParam[]</code> - 可选的检测物体数据</li><li><code>data.furnitures</code>: <a href="/reference/types.html#furnitureparam"><code>FurnitureParam[]</code></a> - 可选的家具数据</li><li><code>runtime</code> - 可选的运行时配置 (DeepPartialRuntimeConfig)</li><li><code>options</code> - 截图配置选项</li><li><code>options.backgroundColor</code>: <code>ColorSource</code> - 指定生成截图时的背景颜色。若不指定,将默认使用 <code>config.global.backgroundColor</code>。</li></ul><p><strong>返回值</strong>: <a href="/reference/types.html#string"><code>Promise<string></code></a> - Base64 格式的图片数据 (Data URL)。</p><h2 id="forceendgesture" tabindex="-1">forceEndGesture() <a class="header-anchor" href="#forceendgesture" aria-label="Permalink to "forceEndGesture()""></a></h2><p>强制结束当前正在进行的手势交互。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> forceEndGesture</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">void</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><p><strong>返回值</strong>: <code>Promise<void></code></p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>该方法主要用于解决小程序异层渲染导致的 <code>touchend</code> 事件丢失问题。如果小程序侧通过原生手势监听到松手,但 SDK 由于层级劫持未收到事件,可调用此方法手动终止 SDK 内部的手势状态。这会触发当前的控制元素(如禁区)执行最终的位置更新并抛出 <code>onUpdateXxx</code> 回调。</p></div>`,177)])])}const E=i(e,[["render",p]]);export{g as __pageData,E as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as i,c as a,o as n,ag as t}from"./chunks/framework.DRADY2L-.js";const g=JSON.parse('{"title":"地图方法","description":"","frontmatter":{},"headers":[],"relativePath":"reference/methods.md","filePath":"reference/methods.md","lastUpdated":1772617250000}'),e={name:"reference/methods.md"};function p(h,s,l,k,r,d){return n(),a("div",null,[...s[0]||(s[0]=[t("",177)])])}const E=i(e,[["render",p]]);export{g as __pageData,E as default};
|
package/dist-docs/assets/{reference_runtime.md.BnT09w_m.js → reference_runtime.md.aDpGKfHs.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
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":
|
|
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":1772624835000}'),t={name:"reference/runtime.md"};function n(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
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>
|
|
@@ -10,10 +10,11 @@ import{_ as e,c as i,o as a,ag as s}from"./chunks/framework.DRADY2L-.js";const g
|
|
|
10
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
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
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;"> showDetectedObjects: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
13
14
|
<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
15
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ... 其他运行时配置</span></span>
|
|
15
16
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }}</span></span>
|
|
16
17
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ... 其他props</span></span>
|
|
17
18
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /></span></span>
|
|
18
19
|
<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};
|
|
20
|
+
<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="showdetectedobjects" tabindex="-1">showDetectedObjects <a class="header-anchor" href="#showdetectedobjects" aria-label="Permalink to "showDetectedObjects""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示 AI 检测物体。</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>`,99)])])}const k=e(t,[["render",n]]);export{g as __pageData,k as default};
|
|
@@ -1 +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":
|
|
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":1772624835000}'),t={name:"reference/runtime.md"};function n(l,o,r,d,h,c){return a(),i("div",null,[...o[0]||(o[0]=[s("",99)])])}const k=e(t,[["render",n]]);export{g as __pageData,k as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
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":1772617250000}'),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>
|
|
@@ -68,6 +68,13 @@ import{_ as i,c as a,o as n,ag as p}from"./chunks/framework.DRADY2L-.js";const y
|
|
|
68
68
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> id</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> string</span></span>
|
|
69
69
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 点集合,组成区域的顶点坐标 */</span></span>
|
|
70
70
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> points</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]</span></span>
|
|
71
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="furnitureparam" tabindex="-1">FurnitureParam <a class="header-anchor" href="#furnitureparam" aria-label="Permalink to "FurnitureParam {#furnitureparam}""></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;"> FurnitureParam</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
72
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 家具ID */</span></span>
|
|
73
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> id</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> string</span></span>
|
|
74
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 家具类型编号,匹配 config.furniture.assets 中的 type */</span></span>
|
|
75
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> furnitureType</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
76
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 四个顶点坐标 (顺时针: 左上→右上→右下→左下) */</span></span>
|
|
77
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> points</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]</span></span>
|
|
71
78
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="virtualwallparam" tabindex="-1">VirtualWallParam <a class="header-anchor" href="#virtualwallparam" aria-label="Permalink to "VirtualWallParam {#virtualwallparam}""></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;"> VirtualWallParam</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
72
79
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 虚拟墙ID */</span></span>
|
|
73
80
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> id</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> string</span></span>
|
|
@@ -224,4 +231,4 @@ import{_ as i,c as a,o as n,ag as p}from"./chunks/framework.DRADY2L-.js";const y
|
|
|
224
231
|
<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>
|
|
225
232
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 自定义数据 */</span></span>
|
|
226
233
|
<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>
|
|
227
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div>`,
|
|
234
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div>`,53)])])}const F=i(h,[["render",l]]);export{y as __pageData,F as default};
|
package/dist-docs/assets/{reference_types.md.CL_VFfB8.lean.js → reference_types.md.D2IglsHQ.lean.js}
RENAMED
|
@@ -1 +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":
|
|
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":1772617250000}'),h={name:"reference/types.md"};function l(t,s,k,e,r,d){return n(),a("div",null,[...s[0]||(s[0]=[p("",53)])])}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.BJnAJzet.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.D78lSkQK.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.BPrKHNKt.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>
|
|
@@ -750,7 +750,85 @@
|
|
|
750
750
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onClickDetectedObject</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{handleClickDetectedObject}</span></span>
|
|
751
751
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /></span></span>
|
|
752
752
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
|
|
753
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="
|
|
753
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="家具" tabindex="-1">家具 <a class="header-anchor" href="#家具" aria-label="Permalink to "家具""></a></h2><p>家具功能用于在地图上放置和编辑家具图片(如床、沙发、桌子等)。家具使用和禁区相同的四点坐标结构,但以图片方式渲染,并支持点击式旋转(每次旋转 90 度)。</p><h3 id="基本用法" tabindex="-1">基本用法 <a class="header-anchor" href="#基本用法" aria-label="Permalink to "基本用法""></a></h3><p>通过 <code>furnitures</code> prop 传入家具数据,并通过 <code>runtime.editingFurnitureIds</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, { useState } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'react'</span></span>
|
|
754
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { RobotMap, FurnitureParam } </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>
|
|
755
|
+
<span class="line"></span>
|
|
756
|
+
<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>
|
|
757
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">furnitures</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">setFurnitures</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> useState</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">FurnitureParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]>([])</span></span>
|
|
758
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">editingFurnitureIds</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">setEditingFurnitureIds</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> useState</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]>([])</span></span>
|
|
759
|
+
<span class="line"></span>
|
|
760
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> handleAddFurniture</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> async</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>
|
|
761
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> points</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> mapApi.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">getFurniturePointsByViewportCenter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
762
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> furnitureType: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
763
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
|
|
764
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> id</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> nanoid</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span></span>
|
|
765
|
+
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> setFurnitures</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;">furnitures, { id, furnitureType: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, points }])</span></span>
|
|
766
|
+
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> setEditingFurnitureIds</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">([id])</span></span>
|
|
767
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
768
|
+
<span class="line"></span>
|
|
769
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> handleUpdateFurniture</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;">furniture</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> FurnitureParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
770
|
+
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> setFurnitures</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span></span>
|
|
771
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> furnitures.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">map</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">((</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">item</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span></span>
|
|
772
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> item.id </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">===</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> furniture.id </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> furniture </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> item,</span></span>
|
|
773
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ),</span></span>
|
|
774
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
|
|
775
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
776
|
+
<span class="line"></span>
|
|
777
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> handleRemoveFurniture</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;">id</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> string</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>
|
|
778
|
+
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> setFurnitures</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(furnitures.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">filter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">((</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">item</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;"> item.id </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">!==</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> id))</span></span>
|
|
779
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
780
|
+
<span class="line"></span>
|
|
781
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> handleClickFurniture</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;">furniture</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> FurnitureParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
782
|
+
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> setEditingFurnitureIds</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">([furniture.id])</span></span>
|
|
783
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
784
|
+
<span class="line"></span>
|
|
785
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span></span>
|
|
786
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span></span>
|
|
787
|
+
<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>
|
|
788
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> furniture: {</span></span>
|
|
789
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> assets: [</span></span>
|
|
790
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
791
|
+
<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:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
792
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> src: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'path/to/bed-image.png'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
793
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> width: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1.8</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
794
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> height: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2.0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
795
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
796
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ],</span></span>
|
|
797
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
798
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }}</span></span>
|
|
799
|
+
<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>
|
|
800
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> editingFurnitureIds,</span></span>
|
|
801
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }}</span></span>
|
|
802
|
+
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> furnitures</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{furnitures}</span></span>
|
|
803
|
+
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onUpdateFurniture</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{handleUpdateFurniture}</span></span>
|
|
804
|
+
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onRemoveFurniture</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{handleRemoveFurniture}</span></span>
|
|
805
|
+
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onClickFurniture</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{handleClickFurniture}</span></span>
|
|
806
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /></span></span>
|
|
807
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
|
|
808
|
+
<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>通过 <code>config.furniture.assets</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>
|
|
809
|
+
<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>
|
|
810
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> furniture: {</span></span>
|
|
811
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> assets: [</span></span>
|
|
812
|
+
<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:#24292E;--shiki-dark:#E1E4E8;">, src: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'/assets/bed.png'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, width: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1.8</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, height: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2.0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
813
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { type: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, src: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'/assets/sofa.png'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, width: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2.0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, height: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.8</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
814
|
+
<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:#24292E;--shiki-dark:#E1E4E8;">, src: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'/assets/table.png'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, width: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1.2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, height: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1.2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
815
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ],</span></span>
|
|
816
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
817
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }}</span></span>
|
|
818
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/></span></span></code></pre></div><p>每个素材的 <code>type</code> 字段与 <code>FurnitureParam.furnitureType</code> 对应,SDK 会根据类型自动加载匹配的图片资源。<code>width</code>/<code>height</code> 单位为米,用于确定通过 <code>getFurniturePointsByViewportCenter()</code> 新增家具时的初始尺寸,SDK 内部会根据地图 <code>resolution</code> 自动转换为像素坐标。</p><h3 id="旋转方向" tabindex="-1">旋转方向 <a class="header-anchor" href="#旋转方向" aria-label="Permalink to "旋转方向""></a></h3><p>默认情况下,点击旋转按钮会顺时针旋转 90 度。你可以通过 <code>config.furniture.rotateDirection</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>
|
|
819
|
+
<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>
|
|
820
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> furniture: {</span></span>
|
|
821
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> rotateDirection: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ccw'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
822
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
823
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }}</span></span>
|
|
824
|
+
<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>通过 <code>minScaleRatio</code> 和 <code>maxScaleRatio</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>
|
|
825
|
+
<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>
|
|
826
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> furniture: {</span></span>
|
|
827
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> minScaleRatio: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.5</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 最小缩小到 50%</span></span>
|
|
828
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> maxScaleRatio: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 最大放大到 200%</span></span>
|
|
829
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
830
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }}</span></span>
|
|
831
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/></span></span></code></pre></div><p>设置 <code>minScaleRatio: 0</code> 表示不限制最小缩放,设置 <code>maxScaleRatio: Infinity</code> 表示不限制最大缩放。</p><h3 id="相关配置项-2" tabindex="-1">相关配置项 <a class="header-anchor" href="#相关配置项-2" aria-label="Permalink to "相关配置项""></a></h3><table tabindex="0"><thead><tr><th>配置项</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td><a href="/reference/config.html#furniture-assets"><code>furniture.assets</code></a></td><td><code>[内置双人床]</code></td><td>家具素材列表</td></tr><tr><td><a href="/reference/config.html#furniture-opacity"><code>furniture.opacity</code></a></td><td><code>1</code></td><td>家具图片透明度</td></tr><tr><td><a href="/reference/config.html#furniture-rotatedirection"><code>furniture.rotateDirection</code></a></td><td><code>'cw'</code></td><td>旋转方向</td></tr><tr><td><a href="/reference/config.html#furniture-minscaleratio"><code>furniture.minScaleRatio</code></a></td><td><code>0.5</code></td><td>最小缩放倍数</td></tr><tr><td><a href="/reference/config.html#furniture-maxscaleratio"><code>furniture.maxScaleRatio</code></a></td><td><code>2</code></td><td>最大缩放倍数</td></tr><tr><td><a href="/reference/config.html#furniture-iconwrapperfillcolor"><code>furniture.iconWrapperFillColor</code></a></td><td><code>'#26a69a'</code></td><td>编辑按钮颜色</td></tr></tbody></table><h2 id="自定义元素" tabindex="-1">自定义元素 <a class="header-anchor" href="#自定义元素" aria-label="Permalink to "自定义元素""></a></h2><p>你可以在地图上显示自定义的元素,它们完全受控于 <code>customElements</code> 中的数据。</p><p>目前支持自定义的元素有:</p><ul><li>图片</li><li>GIF</li><li>HTML</li></ul><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> React </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'react'</span></span>
|
|
754
832
|
<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>
|
|
755
833
|
<span class="line"></span>
|
|
756
834
|
<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>
|
|
@@ -901,8 +979,8 @@
|
|
|
901
979
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (mapApi) {</span></span>
|
|
902
980
|
<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>
|
|
903
981
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
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-
|
|
905
|
-
<script>window.__VP_HASH_MAP__=JSON.parse("{\"guide_advanced-usage.md\":\"
|
|
982
|
+
<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-04T09:40:50.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>
|
|
983
|
+
<script>window.__VP_HASH_MAP__=JSON.parse("{\"guide_advanced-usage.md\":\"BPrKHNKt\",\"guide_concepts.md\":\"DBFk-g-l\",\"guide_getting-started.md\":\"Zvm4buzY\",\"guide_mcp.md\":\"1UIpY4E0\",\"index.md\":\"Sm6vD2Gl\",\"plans_2026-03-04-detected-objects-visibility-design.md\":\"530AI9zE\",\"plans_2026-03-04-show-detected-objects-implementation-plan.md\":\"foeG7qiK\",\"records_bugs_2026-02-28-fix-pixi-bindgroup-webgpu-snapshot-whitescreen-bugfix.md\":\"BT3816jW\",\"records_plans_2026-03-02-furniture-feature-plan.md\":\"DkXKivuL\",\"reference_callbacks.md\":\"CwvDSJWk\",\"reference_config.md\":\"CK4ueBig\",\"reference_data.md\":\"DciSLVC8\",\"reference_methods.md\":\"CL2sjTJ7\",\"reference_runtime.md\":\"aDpGKfHs\",\"reference_types.md\":\"D2IglsHQ\",\"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>
|
|
906
984
|
|
|
907
985
|
</body>
|
|
908
986
|
</html>
|