new fengmap.FMFirstPersonControl(options)
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
参数集合
|
Members
-
readonlyisEnabled
-
Properties:
Name Type Description isEnabledbool 是否开启第一人称相机
Methods
-
disable()
-
禁用第一人称控制器
-
enable(buildingID)
-
开启第一人称控制器
Name Type Description buildingIDstring 建筑ID, 默认null
-
enterBuilding(options)
-
进入建筑
Name Type Description optionsjson 参数集合
Name Type Description buildingIDString 建筑ID
isHideOutBuildingboolean 是否隐藏园区地图,默认为false
finishfunction 完成回调函数
-
exitBuilding(options)
-
退出建筑
Name Type Description optionsjson 参数集合
Name Type Description finishfunction 完成回调函数
-
getTargetViewPoint(options){Object}
-
根据地图坐标点, 计算移动的目标位置和角度, 会避开镂空区域
Name Type Description optionsObject 地图点击内容
Name Type Description coordsObject 地图坐标信息
Name Type Description xnumber 地图x
ynumber 地图y
heightnumber 相对于所属楼层的位置
targetsObject 地图拾取内容
Returns:
Name Type Description resultObject 返回内容 Name Type Description xnumber 位置x坐标 ynumber 位置y坐标 heightnumber 相对于所属楼层的位置 headingnumber 水平角度 tiltnumber 俯仰角度 -
getViewPoint(){Object}
-
获取当前的相机位置
Returns:
Name Type Description optionsObject Name Type Description xnumber 地图x坐标 ynumber 地图y坐标 heightnumber 相对于所属楼层的位置 headingnumber 水平角度 tiltnumber 俯仰角度 -
moveTo(options)
-
设置位置
Name Type Description optionsObject 参数
Name Type Description xnumber 地图x坐标, 必填
ynumber 地图y坐标, 必填
heightnumber 相对于所属楼层的位置
animateboolean true 开启动画 false 关闭动画, 选填,默认 true
durationnumber 移动到指定位置所用的时间( 秒), 选填, 默认0.5
finishfunction 移动完成事件, 选填
-
rotateTo(options)
-
设置偏航角度
Name Type Description optionsObject 参数
Name Type Description headingnumber 偏航角度
animateboolean true 开启动画 false 关闭动画, 选填,默认 true
durationnumber 移动到指定位置所用的时间( 秒), 选填, 默认0.5
finishfunction 移动完成事件, 选填
-
tiltTo(options)
-
设置俯仰角度
Name Type Description optionsObject 参数
Name Type Description tiltnumber 俯仰角
animateboolean true 开启动画 false 关闭动画, 选填,默认 true
durationnumber 移动到指定位置所用的时间( 秒), 选填, 默认0.5
finishfunction 移动完成事件, 选填