new FdPathsManager(type)
Parameters:
Name | Type | Description |
---|---|---|
type |
Example
var viewer = Freedo.FdApp.createDefaultViewer('freedoContainer'); var pathsManager = new FdPathsManager(viewer, {}); pathsManager.setSpeed(20); pathsManager.setLoop(false); pathsManager.setKBStatus(true); pathsManager.setGroupSmoothRate(5); pathsManager.setHeight(0); pathsManager.setHeading(0); pathsManager.setPitch(45); //设置高度偏移,就是在实际拾取到的点的高度的基础上增加一个值 pathsManager.setOffsetH(50); pathsManager.setPathViewMode(true); pathsManager.setPathShow(true); currentGroupId = pathsManager.createGroup('Group_' + new Date().getTime()); //准备进行选点操作 pathsManager.preAppendPathPoint();
Methods
-
appendPathPoint(groupID, options)
-
在当前组列表的末尾增加一个点
Parameters:
Name Type Description groupID
String 组ID
options
Object 点选项
Properties
Name Type Description name
Array 点名,可以为空
position
Array 代表位置的数组[经度,纬度,高度],单位为度
-
changeStartPoint()
-
变换起始点
-
createGroup(groupName)
-
给定组名称,创建组
Parameters:
Name Type Description groupName
String 组的名称
Returns:
返回组ID
- Type
- String
-
dispose()
-
销毁所有资源
-
editNext()
-
编辑下一个节点
-
editPre()
-
编辑上一个节点
-
endAppendPathPoint()
-
结束增加点
-
endEdit()
-
编辑下一个节点
-
flyTo(groupID, index)
-
飞入某个点
Parameters:
Name Type Description groupID
String 组ID
index
number 指定组列表中的位置
-
getAllGroupIDs()
-
获取所有组的ID
Returns:
返回一个包含组ID的数组
-
getCurrentGroupID()
-
获取当前组ID
Returns:
组ID
- Type
- String
-
getData()
-
获取数据
Returns:
返回值格式(经纬度单位为度,高度为米): { 编号1:{ list: [{name: 名称,position: [经度,纬度,高度]}...] name: 道路名称, smooth: 平滑度 }
编号2:{ list: [{name: 名称,position: [经度,纬度,高度]}...] name: 道路名称, smooth: 平滑度 }
}
- Type
- Array.<Object>
-
getGroupName(groupID)
-
获组的名字
Parameters:
Name Type Description groupID
String 组ID
Returns:
组名称
- Type
- String
-
getGroupPlayingGroupID()
-
获取正在播放的组ID
Returns:
组ID
- Type
- String
-
getGroupSmooth(groupID)
-
获组的平滑度
Parameters:
Name Type Description groupID
String 组ID
Returns:
平滑度
- Type
- Number
-
getHeight()
-
获取视角高度
Returns:
单位米
- Type
- Number
-
getKBStatus()
-
获取是否开启键盘操作
-
getModel()
-
设置模型url
-
getModelDistance()
-
获取当前模型视点水平距离
-
getPathPoint(groupID, index)
-
获取点属性
Parameters:
Name Type Description groupID
String 组ID
index
number 指定组列表中的位置
Returns:
-
options 点选项,目前只有position
- Type
- Object
-
options.position [经度,纬度,高度]单位为度度米
- Type
- Array.<Number>
-
-
getPathsLength(groupID)
-
获取组中点的数量
Parameters:
Name Type Description groupID
String 组ID
Returns:
数量
- Type
- Number
-
getPitch()
-
获取俯仰角
Returns:
单位度
- Type
- Number
-
getSmoothRadius()
-
获取平滑半径
-
getSpeed()
-
获取动画播放速度
Returns:
单位米/秒
- Type
- Number
-
goto(groupID, index)
-
跳入到点
Parameters:
Name Type Description groupID
String 组ID
index
number 指定组列表中的位置
-
insertPathPoint(groupID, options)
-
在组列表的某个位置插入一个点
Parameters:
Name Type Description groupID
String 组ID
options
Object 点选项
Properties
Name Type Description name
Array 点名,可以为空
position
Array 代表位置的数组[经度,纬度,高度],单位为度
position
Array.<Number> [经度,纬度,高度]单位为度度米
-
on(listener [, scope])
-
注册事件捕捉
Parameters:
Name Type Argument Description listener
FdMicroApp.FdPathsManager~FdPathsManagerCallback 当有事件触发时被执行的函数。
scope
Object <optional>
listener函数执行时的绑定的对象。
Returns:
返回一个函数,调用该函数可以取消监听。
- Type
- Freedo.Event~RemoveCallback
-
pause()
-
暂停正在播放的组
-
preAppendPathPoint()
-
准备增加点
-
removeAllGroups()
-
删除所有组
-
removeGroup(groupID)
-
删除组
Parameters:
Name Type Description groupID
String 组ID
-
removePathPoint(groupID, index)
-
删除组中的点
Parameters:
Name Type Description groupID
String 组ID
index
number 指定组列表中的位置
-
reset()
-
重置
-
setCurrentGroupID(组ID)
-
设置当前组ID
Parameters:
Name Type Description 组ID
String -
setGroupName(groupID, groupName)
-
设置组的名字
Parameters:
Name Type Description groupID
String 组ID
groupName
String 组名称
-
setGroupSmoothRate(groupID)
-
设置组的平滑度
Parameters:
Name Type Description groupID
String 组ID
Returns:
true为设置成功
- Type
- Boolean
-
setHeading(h)
-
设置偏航角
Parameters:
Name Type Description h
Number 单位米
-
setHeight(h)
-
设置视角距离
Parameters:
Name Type Description h
Number 单位米
-
setKBStatus(enable)
-
设置是否开启键盘操作
Parameters:
Name Type Description enable
Boolean true为开启
-
setLoop(loop)
-
设置是否循环播放
Parameters:
Name Type Description loop
Boolean true为循环播放
-
setModel()
-
设置模型url
-
setModelDistance()
-
设置注视模型距离
-
setModelHeading(val)
-
设置模型航向角
Parameters:
Name Type Description val
Number 航向角(角度值)
-
setNearRate(rate)
-
设置路径贴近率
Parameters:
Name Type Description rate
Number 贴近率,建议1-100之间
-
setOffsetH(offsetH)
-
设置路径高度偏移
Parameters:
Name Type Description offsetH
Number 单位米
-
setPathNameShow(show)
-
是否显示路径名
Parameters:
Name Type Description show
Boolean true为显示
-
setPathPoint(groupID, index, options)
-
设置点
Parameters:
Name Type Description groupID
String 组ID
index
number 指定组列表中的位置
options
Object 点选项,目前只有position
Properties
Name Type Description position
Array.<Number> [经度,纬度,高度]单位为度度米
-
setPathShow(show)
-
是否显示路径
Parameters:
Name Type Description show
Boolean true为显示
-
setPathViewMode(true为路径视角模式)
-
设置路径视角模式
Parameters:
Name Type Description true为路径视角模式
Number -
setPitch(pitch)
-
设置俯仰角
Parameters:
Name Type Description pitch
Number 单位度
-
setSmoothRadius()
-
设置平滑半径
-
setSpeed(s)
-
设置动画播放速度
Parameters:
Name Type Description s
Number 单位米/秒
-
start()
-
开始播放
-
startEdit(组ID)
-
开始进行节点编辑
Parameters:
Name Type Description 组ID
String -
stop()
-
停止正在播放的组。
Type Definitions
-
FdPathsManagerCallback(eventType, eventArg)
-
Parameters:
Name Type Description eventType
String 事件类型有:GroupChanged,GroupsChanged,DataChanged
eventArg
Object 事件参数