| Name | Type | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
container |
String |
optional
绑定的canvas标签id。 |
||||||||||||||||
props |
Object |
optional
包含如下属性的Object:
|
Example:
var xxx = new CooWasm.Map({
container:"canvas"
})
Demo:
Members
Service Worker 缓存助手 仅在 HTTPS 下使用
是否缓存数据。
-
Default Value:
true
是否展示进度。
-
Default Value:
true
cooWasmApi库相对调用网页位置。
数据线程数。
-
Default Value:
4
elevationLayers : Array.<ElevationLayer>
地形高程图层数组。
featureLayers : Array.<FeatureLayer>
矢量图层数组。
获取已加载在地图中的对象,通过各类对象数组返回。
Example:
// 获取对象
map.getObjects()
imageLayers : Array.<ImageLayer>
地形影像图层数组。
授权服务ip地址。
-
Default Value:
""
授权服务端口号。
-
Default Value:
-1
meshLayers : Array.<MeshLayer>
倾斜摄影图层数组。
modelLayers : Array.<ModelLayer>
人工模型图层数组。
节点数量上限。
-
Default Value:
3000
canvas的父亲节点。
进度div。
进度div样式。
网络协议,默认0,代表Http。
-
Default Value:
0
Methods
清除三维地图缓存(支持 IndexedDB 和 Service Worker)。
Returns:
这个方法不返回任何值
Example:
map.clearCache()
从场景中销毁自身。
Returns:
null 空值。
Example:
// 销毁对象
xxx = xxx.destroy()
启用或禁用键盘快捷键
| Name | Type | Description |
|---|---|---|
enabled |
Boolean |
是否启用快捷键 |
开启或者关闭鼠标位置回调。
| Name | Type | Description |
|---|---|---|
state |
Boolean |
开关状态。 |
func |
CallbackObj |
返回经纬度位置信息的回调函数。 |
Example:
map.enableMousePosition(true, position=>{
console.log(position)
})
开启或者关闭鼠标位置对应比例尺回调。
| Name | Type | Description |
|---|---|---|
state |
Boolean |
开关状态。 |
func |
CallbackString |
返回鼠标位置对应比例尺信息的回调函数,字符串格式: 像素值/米。 |
Example:
map.enableMouseScale(true, str=>{
console.log(str)
})
开启或者关闭三维地图漫游。
| Name | Type | Description |
|---|---|---|
state |
Boolean |
开关状态。 |
Example:
// 禁用漫游
map.enableRoam(false)
渐变移除加载动画
| Name | Type | Description |
|---|---|---|
callback |
function |
渐变完成后的回调函数 |
获取当前激活调度节点数。
Returns:
当前激活调度节点数。
获取当前请求节点数。
Returns:
当前请求节点个数。
获取当前调度节点总数。
Returns:
当前调度节点总数。
测试内存极限。
| Name | Type | Description |
|---|---|---|
step |
Number |
步长。 |
times |
Number |
测试次数。 |
Example:
// 测试内存极限
map.memoryTest()
获取内存使用情况。
Returns:
已使用内存(MB)。
设置相机LodScale
| Name | Type | Description |
|---|---|---|
lodScale |
Number |
调度比例值。 |
Example:
// 设置相机LodScale
map.setLodScale(1.0)
显隐三维地图本身。
| Name | Type | Description |
|---|---|---|
state |
Boolean |
显隐状态。 |
Example:
// 显隐三维地图
map.visible(false)
