Appearance
运行时配置
了解 RobotMap 的运行时配置项,用于控制地图在运行过程中的动态行为和状态。
使用示例
运行时配置通过 runtime 传递,所有配置项都是可选的,你可以只覆盖需要修改的部分。
tsx
import React from 'react'
import { RobotMap } from '@ray-js/robot-map'
function MapPage() {
return (
<RobotMap
runtime={{
showPath: true,
showChargingStation: true,
showRoomName: true,
showRoomProperty: true,
showRoomOrder: true,
enableRoomSelection: false,
// ... 其他运行时配置
}}
// ... 其他props
/>
)
}dividingRoomId
- 类型:
number - 默认值:
-1
正在分割的房间ID。
你可以通过将 dividingRoomId 设置为 -1 来移除分割线。
enableRoomSelection
- 类型:
boolean - 默认值:
false
是否启用房间选择功能
TIP
当 enableRoomSelection 为 false 时,房间会始终处于高亮状态。
当 enableRoomSelection 为 true 时,房间是否高亮取决于 selectRoomIds 是否包含该房间ID。
enableInteraction
- 类型:
boolean - 默认值:
false
是否启用交互功能。
当 enableInteraction 为 false 时,地图不会响应任何交互事件。
enableMapClickCapture
- 类型:
boolean - 默认值:
false
是否启用地图点击捕获功能。
开启地图点击捕获功能后,用户点击地图时会触发 onClickMap 回调。
editingForbiddenSweepZoneIds
- 类型:
string[] - 默认值:
[]
正在编辑的禁扫区域ID列表。
editingForbiddenMopZoneIds
- 类型:
string[] - 默认值:
[]
正在编辑的禁拖区域ID列表。
editingCleanZoneIds
- 类型:
string[] - 默认值:
[]
正在编辑的清扫区域ID列表。
editingVirtualWallIds
- 类型:
string[] - 默认值:
[]
正在编辑的虚拟墙ID列表。
editingSpotIds
- 类型:
string[] - 默认值:
[]
正在编辑的定点清扫ID列表。
editingWayPointIds
- 类型:
string[] - 默认值:
[]
正在编辑的途径点ID列表。
mapRotation
- 类型:
number - 默认值:
0 - 单位:
度(°)
地图旋转角度。
roomPropertyFoldIds
- 类型:
number[] - 默认值:
[]
处于折叠状态的房间ID列表。
roomSelectionMode
- 类型:
'checkmark' | 'order' - 默认值:
'checkmark'
房间选中的指示方式。
TIP
当 roomSelectionMode 为 'checkmark' 时,房间选中后会显示选择指示器。
当 roomSelectionMode 为 'order' 时,房间选中后会显示清扫顺序数字。
selectRoomIds
- 类型:
number[] - 默认值:
[]
选中的房间ID列表。只有当 enableRoomSelection 为 true 时,这个值才会生效。
showRoomProperty
- 类型:
boolean - 默认值:
false
是否显示房间属性。
showRoomOrder
- 类型:
boolean - 默认值:
true
是否显示房间清扫顺序。
showRoomName
- 类型:
boolean - 默认值:
true
是否显示房间名称。
showPath
- 类型:
boolean - 默认值:
true
是否显示机器人路径。
showChargingStation
- 类型:
boolean - 默认值:
true
是否显示充电桩。
showRoomFloorType
- 类型:
boolean - 默认值:
true
是否显示房间地板材质。
showCarpet
- 类型:
boolean - 默认值:
true
是否显示地毯。
showChargingStationRing
- 类型:
boolean - 默认值:
false
是否显示充电桩预警圈。
showRobotRing
- 类型:
boolean - 默认值:
false
是否显示机器人预警圈。
showRobotSleepAnimation
- 类型:
boolean - 默认值:
false
是否显示机器人睡眠动画。
showRobotPulseCircle
- 类型:
boolean - 默认值:
false
是否显示机器人脉冲圈(呼吸效果)。
TIP
机器人脉冲圈会在机器人图标下方显示一个呼吸动画效果,可用于充电等状态的视觉提示。
unit
- 类型:
meter | feet | centimeter - 默认值:
'meter'
尺寸标签单位。
尺寸标签的显示会根据这个单位进行转换计算。
unitLabel
- 类型:
string - 默认值:
'm'
尺寸标签单位显示文本。