-
dispose() → {null}
-
销毁view类
Returns:
null
-
getScreenShot(width, height) → {string}
-
得到当前ooomap场景的屏幕截图
Parameters:
| Name |
Type |
Description |
width |
int
|
像素宽度 |
height |
int
|
像素高度 |
Returns:
string
- base64 image string
-
getViewState() → {object}
-
得到当前的视图状态
Returns:
object
- 当前的视图状态:{viewMode, zoom, zoomLevel, viewAngle, polarAngle, viewCenter}
-
moveTo(viewCenter, cb)
-
移动视角中心
Parameters:
| Name |
Type |
Description |
viewCenter |
Vector3
|
object
|
Array.<float>
|
目标点的场景坐标
Properties
| Name |
Type |
Attributes |
Description |
viewCenter |
Vector3
|
Array.<float>
|
|
目标点的场景坐标 |
viewAngle |
float
|
<optional>
|
地图的平面角度,与正北方向的夹角 |
zoom |
float
|
<optional>
|
比例尺 |
zoomLevel |
float
|
<optional>
|
比例尺级别 |
polarAngle |
float
|
<optional>
|
地图的倾斜角度 |
duration |
float
|
<optional>
|
动画的过渡时间(毫秒) |
easing |
string
|
<optional>
|
动画的过渡方式 |
callback |
function
|
<optional>
|
移动完成后的回调方法 |
|
cb |
function
|
回调函数 |
-
onlyShow(buildingIDs, floorNumbers, options) → {null}
-
只显示某些个建筑,或某些建筑的某些楼层
Parameters:
| Name |
Type |
Description |
buildingIDs |
Array.<string>
|
undefined
|
要单独显示的建筑的id数组, undefined: 显示所有 |
floorNumbers |
Array.<int>
|
string
|
要单独显示的楼层编号数组, string: 'all', 表示显示所有层 |
options |
object
|
关于单独显示的一些配置参数
Properties
| Name |
Type |
Default |
Description |
focus |
boolean
|
true
|
是否要聚焦到单独显示的对象 |
withScene |
boolean
|
false
|
是否显示场景 |
|
Returns:
null
-
resize(w, h)
-
重新设置视图的大小
Parameters:
| Name |
Type |
Description |
w |
int
|
width视图的宽度 |
h |
int
|
height视图的高度 |
-
setConfig(config)
-
设置视图的配置,主要用于打开新的OMScene时,应用此场景的视图配置
Parameters:
| Name |
Type |
Description |
config |
object
|
视图配置 |
-
setViewState(config, durationopt, callback)
-
设置视图的状态,如:viewMode, zoom, zoomLevel, viewAngle, polarAngle
Parameters:
| Name |
Type |
Attributes |
Description |
config |
object
|
|
视图状态的配置信息
Properties
| Name |
Type |
Attributes |
Description |
viewMode |
string
|
<optional>
|
视图模式 |
zoom |
float
|
<optional>
|
视图的比例尺 |
zoomLevel |
float
|
<optional>
|
视图的比例尺级别 |
viewAngle |
float
|
<optional>
|
视图的平面角度(度数) |
polarAngle |
float
|
<optional>
|
视图的倾斜角度(度数) |
viewCenter |
Array.<float>
|
<optional>
|
当前视图的中心点坐标数组[x, y, z] |
easing |
string
|
<optional>
|
动画的缓动曲线 |
callback |
function
|
<optional>
|
视图变换完成后的回调 |
|
duration |
float
|
<optional>
|
视图状态过渡所用时间(毫秒数) |
callback |
function
|
|
回调函数 |
-
setZoomLevelRange(minopt, maxopt)
-
设置比例尺级别范围
Parameters:
| Name |
Type |
Attributes |
Description |
min |
int
|
<optional>
|
最小比例尺级别,默认为地图配置config中的minZoomLevel |
max |
int
|
<optional>
|
最大比例尺级别,默认为地图配置config中的maxZoomLevel |
-
updateCamera2D(top, right, keepZoom)
-
传入 top, right来更新, camera2D
Parameters:
| Name |
Type |
Default |
Description |
top |
float
|
|
top值 |
right |
float
|
|
right值 |
keepZoom |
boolean
|
false
|
是否保持之前的zoom |
-
updateFrustum(forceopt)
-
更新视锥
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
force |
Boolean
|
<optional>
|
false
|
更新当前相机的Maxtrix |