Skip to content

运行时配置

了解 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 | null
  • 默认值: null

正在分割的房间ID。

enableRoomSelection

  • 类型: boolean
  • 默认值: false

是否启用房间选择功能

TIP

enableRoomSelectionfalse 时,房间会始终处于高亮状态。

enableRoomSelectiontrue 时,房间是否高亮取决于 selectRoomIds 是否包含该房间ID。

editingForbiddenSweepZoneIds

  • 类型: string[]
  • 默认值: []

正在编辑的禁扫区域ID列表。

editingForbiddenMopZoneIds

  • 类型: string[]
  • 默认值: []

正在编辑的禁拖区域ID列表。

editingCleanZoneIds

  • 类型: string[]
  • 默认值: []

正在编辑的清扫区域ID列表。

editingVirtualWallIds

  • 类型: string[]
  • 默认值: []

正在编辑的虚拟墙ID列表。

editingSpotIds

  • 类型: string[]
  • 默认值: []

正在编辑的定点清扫ID列表。

roomPropertyFoldIds

  • 类型: number[]
  • 默认值: []

处于折叠状态的房间ID列表。

roomSelectionMode

  • 类型: 'checkmark' | 'order'
  • 默认值: 'checkmark'

房间选中的指示方式。

TIP

roomSelectionMode'checkmark' 时,房间选中后会显示选择指示器。

roomSelectionMode'order' 时,房间选中后会显示清扫顺序数字。

selectRoomIds

  • 类型: number[]
  • 默认值: []

选中的房间ID列表。只有当 enableRoomSelectiontrue 时,这个值才会生效。

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

是否显示机器人睡眠动画。