Skip to content

@indoor-map/fmap-reactDocs


导航面板属性(完全受控)

Properties

dragItemIndex

dragItemIndex: null | number

当前正在拖拽的索引


end

end: null | NavigationPanelPoint

终点


focusField?

optional focusField: null | string

plan 模式下初始自动聚焦的输入框字段('start' | 'end' | 'wp-<index>'


maxWaypoints?

optional maxWaypoints: number

途经点最大数量,默认 3


mode?

optional mode: "plan" | "result"

面板形态:plan-输入规划(默认)| result-规划完成后的底部可编辑结果面板


onAddWaypoint()

onAddWaypoint: () => void

添加途经点回调

Returns

void


onClose()?

optional onClose: () => void

结果页关闭回调(mode=result)

Returns

void


onComplete()

onComplete: () => void

完成规划回调

Returns

void


onDragEnd()

onDragEnd: () => void

拖拽结束回调

Returns

void


onDragEnter()

onDragEnter: (index) => (e) => void

拖拽进入回调

Parameters

index: number

Returns

Function

Parameters

e: DragEvent<Element>

Returns

void


onDragOver()

onDragOver: (e) => void

拖拽悬停回调

Parameters

e: DragEvent<Element>

Returns

void


onDragStart()

onDragStart: (index) => (e) => void

拖拽开始回调

Parameters

index: number

Returns

Function

Parameters

e: DragEvent<Element>

Returns

void


onEditPoint()?

optional onEditPoint: (field) => void

结果页点某行回调:跳到导航页重新编辑该字段('start' | 'end' | 'wp-<index>'

Parameters

field: "end" | "start" | `wp-${number}`

Returns

void


onEndChange()

onEndChange: (point) => void

终点变更回调

Parameters

point: null | NavigationPanelPoint

Returns

void


onEndSelect()

onEndSelect: (poi) => void

终点选中 POI 回调

Parameters

poi: FMapModel

Returns

void


onMapPick()

onMapPick: () => void

地图选点回调

Returns

void


onNavFieldFocus()

onNavFieldFocus: (field) => void

输入框聚焦回调(用于地图选点定位字段:'start' | 'end' | 'wp-<index>'

Parameters

field: string

Returns

void


onRemoveWaypoint()

onRemoveWaypoint: (index) => void

删除途经点回调

Parameters

index: number

Returns

void


onStartChange()

onStartChange: (point) => void

起点变更回调

Parameters

point: null | NavigationPanelPoint

Returns

void


onStartSelect()

onStartSelect: (poi) => void

起点选中 POI 回调

Parameters

poi: FMapModel

Returns

void


onStartSimulation()

onStartSimulation: () => void

开始模拟导航回调

Returns

void


onStrategyChange()

onStrategyChange: (key) => void

策略切换回调

Parameters

key: string

Returns

void


onSuggestionsChange()?

optional onSuggestionsChange: (field, items) => void

输入框搜索建议变化上报(按字段,全量不截断)。 传入后输入框隐藏内置悬浮下拉,建议列表由外部渲染 (可展示在路线历史等面板区域,避免悬浮下拉被遮挡)。

Parameters

field: string

items: FMapModel[]

Returns

void


onSwap()

onSwap: () => void

交换起终点回调

Returns

void


onWaypointChange()

onWaypointChange: (index, point) => void

途经点变更回调

Parameters

index: number

point: NavigationPanelPoint

Returns

void


onWaypointSelect()

onWaypointSelect: (index, poi) => void

途经点选中 POI 回调

Parameters

index: number

poi: FMapModel

Returns

void


route

route: null | NaviResult

规划结果(有值则展示路线摘要与模拟导航)


start

start: null | NavigationPanelPoint

起点


strategy

strategy: string

当前路线策略 key


style?

optional style: CSSProperties

自定义样式


waypoints

waypoints: NavigationPanelPoint[]

途经点列表

基于蜂鸟视图 Fengmap SDK 构建