Members
(constant) base64Prefix
图例base64前缀字符
(constant) BD_FACTOR
cacheLegendImage
图例管理
key:layerDefinition,//图层资源ID
value:[
name 名称
label 显示名称
icon 图片 base64
width 宽
height 高
]
cacheResource
key:layerDefinition,//图层资源ID
value:{
featureName //要素类
primaryKey //主键值
featureSource//要素源
tableHeader //表头
}
cacheResourceByClassName
key:CLASSNAMES,//表名称
value:{
featureName //要素类
primaryKey //主键值
featureSource//要素源
tableHeader //表头
}
commonParam
请求公共参数
(constant) currentEspgCode
地球默认坐标系
(constant) EARTH_RADIUS
(constant) fieldUnit
项目字段单位
(constant) guest
游客登录
isArray
判断对象是否为数组类型
(constant) mapguidPrefix
请求mapguid前缀
mapguidVersion
mapguid发布版本
mapsList
整理后的数据
options
配置信息
primaryKey
项目主键
projectClassName
项目表名
(constant) projectFilePrefix
项目附件前缀
(constant) projectNoKey
项目编号主键字段
(constant) projectSysField
项目系统字段 ???无layerDefinition的没有显示项 所有过滤系统字段
reflectBlendColor
反射混合色
rotate
自旋转效果
schemeAttachTableName
方案附件表名称
(constant) schemeMap
方案map对照表 表名
(constant) schemeNoKey
方案编号主键字段
schemePrimaryKey
方案主键
schemeTableName
方案表名
schemeThumbnailTableName
缩略图表名称
serverFilePath
服务器文件路径
(constant) settingPrefix
设置三维图层前缀
syscurrentTime
服务器时间戳
tableHeader
项目表表头
tableHeader
方案表表头
(constant) tableName
mapguid 创建表名
(constant) tiltePrefix
3dtitle请求地址前缀
(constant) TIMEOUT
超时时间
tmpJWD
更新实体的贴地属性和高度 仅支持静态实体,动态实体本身点组就是实时更新的,因此不做处理
waterColor
水面颜色
(constant) zprg
三维偏移地址后缀
Methods
(async) _loadAgentLayer(layerItem, map)
代理图层数据请求 内部使用方法
Parameters:
Name | Type | Description |
---|---|---|
layerItem |
Object | 代理图层数据节点信息 |
map |
Object | map |
Returns:
[]
alert(msg, title)
弹出框消息
Parameters:
Name | Type | Description |
---|---|---|
msg |
String | 消息内容 |
title |
String | 标题 |
AnimationBillboard(options)
让BillBoard上下移动动画
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | 参数 Properties
|
bindLayerPopup(popup, getHtmlFun)
对zz3d内置图层的绑定处理(图层一般因为有属性读取及格式化处理)
Parameters:
Name | Type | Description |
---|---|---|
popup |
* | 弹出内容 |
getHtmlFun |
* | 回调函数 |
BloomGroundRoads(options)
贴地泛光路网
Parameters:
Name | Type | Description |
---|---|---|
options |
* |
buffer(geojson, width) → {JSON}
缓冲分析(比如是建筑物单体化时,缓冲扩大点范围),单位:米
Parameters:
Name | Type | Description |
---|---|---|
geojson |
JSON | geojson格式数据 |
width |
Number | 范围 |
Returns:
返回值
- Type
- JSON
checkCesiumVersionBeClassic() → {Boolean}
检测cesium版本是否是经典版 即1.86版本 小于等于1.86会被认为是经典版
Returns:
若当前版本大于1.86则返回false 否则返回true
- Type
- Boolean
checkEntityIsClampToGround(entity) → {Boolean}
检测entity是否贴地
Parameters:
Name | Type | Description |
---|---|---|
entity |
Entity | 待检实体 |
Returns:
返回是否贴地
- Type
- Boolean
clone(obj, removeKeys, level) → {Object}
克隆对象
Parameters:
Name | Type | Default | Description |
---|---|---|---|
obj |
Object | 原始对象 |
|
removeKeys |
Array | 不复制的属性名 数组 |
|
level |
Number |
5
|
复制的最大层数 |
Returns:
克隆后的对象
- Type
- Object
computedOffsetData(ori, dir, wid) → {Cartesian3}
计算相交点
Parameters:
Name | Type | Description |
---|---|---|
ori |
* | |
dir |
* | |
wid |
* |
Returns:
- Type
- Cartesian3
computeVolume(opts) → {Number}
体积计算
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object |
Properties
|
Returns:
- Type
- Number
constructorFilter(key, condition, value) → {String}
过滤条件构造
Parameters:
Name | Type | Description |
---|---|---|
key |
String/Array | 键 当为String时为单条件 当为Array时为连接OR多条件 eg:[id:"OBJECTID",label:"12"] |
condition |
String | 条件 默认模糊查询 |
value |
String | 值 |
Returns:
- Type
- String
constructorPaging(pageIndex, pageSize) → {String}
获取分页数据
Parameters:
Name | Type | Description |
---|---|---|
pageIndex |
Number | 页码 默认 1 |
pageSize |
Number | 每页显示多少条 默认10 |
Returns:
- Type
- String
constructorTransformTo(epsgId) → {String}
TRANSFORMTO 参数构造
Parameters:
Name | Type | Description |
---|---|---|
epsgId |
String | 页码 默认 1 |
Returns:
- Type
- String
ConvertWiseMapProperty()
把WiseMap中倾斜摄影pick查询返回的结果转成对象
createAllServeLayerList(operationallayersCfg, viewer)
创建服务图层
Example
[{
url: 'http://127.0.0.1:18080',
resourceId: ['Library://示例数据/地图/示例数据.MapDefinition', 'Library://中国天地图/地图/中国天地图.MapDefinition'],
type: 'WiseMap',
userName: 'Administrator',
password: 'admin'
},
{
name: 'ARCGIS服务',
resourceId: 'http://192.168.15.2:6080/arcgis/rest/services//MyMapService052402/MapServer',
type: 'ArcgisServe',
},
{
name: 'OGC-WMS服务',
resourceId: 'http://localhost:18080/WiseMap/mapagent/mapagent.fcgi?SERVICENAME=zz&service=wms&request=GetCapabilities',
type: 'WiseMapWms'
},
{
name: 'OGC-WMTS服务',
resourceId: 'http://localhost:18080/WiseMap/rest/v2/WiseMapWmts/1.0.0/zz/WMTSCapabilities.xml',
type: 'WiseMapWmts'
},
{
name: 'OGC-WFS服务',
resourceId: 'http://localhost:18080/WiseMap/mapagent/mapagent.fcgi?SERVICENAME=zz&service=wfs&request=GetCapabilities',
type: 'WiseMapWfs'
},
{
name: 'W3DS服务',
resourceId: 'http://localhost:18080/WiseMap/rest/v2/W3DS/1.0.0/zz/W3DSCapabilities.json',
type: 'WiseMapW3ds'
},
{
name: 'WMVTS服务',
resourceId: 'http://localhost:18080/WiseMap/rest/v2/WMVTS/1.0.0/zz/WMVTSCapabilities.json',
type: 'WiseMapWmvts'
}]
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operationallayersCfg |
Array |
Properties
|
||||||||||||||||||||||||||||
viewer |
Object | 场景 |
createImageryProvider(item, serverURL) → {Object}
创建地图影像图层
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
item |
Object | 图层相关参数,含有以下属性: Properties
|
||||||||||||||||||||
serverURL |
String | 若该参数有效,则会用该参数替换其他URL中的“serverURL”字段 |
Returns:
图层对象
- Type
- Object
createLayer(item, viewer, serverURL) → {Object}
创建图层
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
item |
Object | 图层相关参数,含有以下必须属性: Properties
|
||||||||||||
viewer |
Viewer | 场景对象 |
||||||||||||
serverURL |
String | 若该参数有效,则会用该参数替换其他URL中的“serverURL”字段 |
Returns:
图层对象
- Type
- Object
createLightNingStage()
雷雨后处理
createLuminosityHighPass(name)
创建高光纹理
Parameters:
Name | Type | Description |
---|---|---|
name |
* |
Returns:
highPass
createMap(opt) → {Viewer}
创建地图 调用方式为 zz3d.createMap()
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opt |
Object | 含有以下属性: Properties
|
Returns:
- Type
- Viewer
createMapEx(container, config_url, custom_options) → {Promise}
根据参数异步创建viewer, 相同参数 options的优化级高于url
Parameters:
Name | Type | Description |
---|---|---|
container |
String | 用于显示场景的div的ID |
config_url |
String | 保存初始化参数的json对应的url |
custom_options |
Object | 初始化参数,优先级高于config_url中的参数 |
Returns:
- Type
- Promise
createModel(cfg, viewer) → {Object}
创建模型
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cfg |
Object | 模型配置 Properties
|
||||||||||||||||||||||||||||||||||||||||
viewer |
viewer | 视图 |
Returns:
模型对象
- Type
- Object
createNeonLightEffect(viewer, options)
创建霓虹灯特效
Example
zz3d.createNeonLightEffect(zmap.viewer, {
color: Cesium.Color.fromCssColorString("#9b08fd"),
speed: 200.0,
glow: 0.8,
radius: 500,
position: [113.31884845793489, 23.10462510426179, 0],
});
Parameters:
Name | Type | Description |
---|---|---|
viewer |
viewer | |
options |
options |
createProSnowStage()
雪增强后处理
createRainStage()
雨后处理
createWaterPrimitive(polygon, optsopt) → {Primitive}
创建水面Primitive
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
polygon |
Geometry | 水面实体对象 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
opts |
Object |
<optional> |
{}
|
带有以下属性的对象: Properties
|
Returns:
返回创建好的primitive
- Type
- Primitive
currentTime()
取当前时间,用于getValue传参
D2R(degrees) → {Number}
度转弧度
Parameters:
Name | Type | Description |
---|---|---|
degrees |
Number |
Returns:
- Type
- Number
downloadBase64Image(name, base64)
下载导出图片
Parameters:
Name | Type | Description |
---|---|---|
name |
String | 图片文件名称,不需要后缀名 |
base64 |
String | 图片文件名称,不需要后缀名 |
downloadFile(fileName, string)
下载保存文件
Parameters:
Name | Type | Description |
---|---|---|
fileName |
String | 文件名,包含后缀 |
string |
String | 文件内容 |
extend2Earth(positionLC, matrix, ray, ellipsoid) → {Cesium.Cartesian3}
求地球交点
Parameters:
Name | Type | Description |
---|---|---|
positionLC |
* | |
matrix |
* | |
ray |
* | |
ellipsoid |
* |
Returns:
- Type
- Cesium.Cartesian3
filterMapList(mapData, zzapi, SESSION, options)
加工数据
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mapData |
Object | 地图数据 |
||||||||||||
zzapi |
Object | |||||||||||||
SESSION |
String | |||||||||||||
options |
Object |
Properties
|
Returns:
FlowDigitalMaterial(options)
数字流
Parameters:
Name | Type | Description |
---|---|---|
options |
* |
formatArea(val, unit) → {Sting}
计算面积后,格式化显示面积值, 可指定单位
Parameters:
Name | Type | Description |
---|---|---|
val |
* | 要格式的值 |
unit |
* | unit支持:m、km、mu、ha 默认自动判断 m 或 km |
Returns:
格式后的值
- Type
- Sting
formatDegree(value) → {String}
格式化经度/纬度,返回度分秒字符串
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 经纬度值 |
Returns:
格式化后的格式 123° 123 '3244''
- Type
- String
formatLength(val, unit) → {Sting}
计算长度后,格式化显示长度值, 可指定单位
Parameters:
Name | Type | Description |
---|---|---|
val |
* | |
unit |
* | unit支持:m、km、mile、zhang 默认自动判断 m 或 km |
Returns:
格式后的值
- Type
- Sting
generateUniqueId()
生成uuid的函数
Returns:
String
(async) getAllServeLayerList(operationallayersCfg) → {Promise}
获取服务数据
Example
[{
url: 'http://127.0.0.1:18080',
resourceId: ['Library://示例数据/地图/示例数据.MapDefinition', 'Library://中国天地图/地图/中国天地图.MapDefinition'],
type: 'WiseMap',
userName: 'Administrator',
password: 'admin',
options:{
key:{
createRunTimeParam:{}
}
}
},
{
name: 'ARCGIS服务',
resourceId: 'http://192.168.15.2:6080/arcgis/rest/services//MyMapService052402/MapServer',
type: 'ArcgisServe',
},
{
name: 'OGC-WMS服务',
resourceId: 'http://localhost:18080/WiseMap/mapagent/mapagent.fcgi?SERVICENAME=zz&service=wms&request=GetCapabilities',
type: 'WiseMapWms'
},
{
name: 'OGC-WMTS服务',
resourceId: 'http://localhost:18080/WiseMap/rest/v2/WiseMapWmts/1.0.0/zz/WMTSCapabilities.xml',
type: 'WiseMapWmts'
},
{
name: 'OGC-WFS服务',
resourceId: 'http://localhost:18080/WiseMap/mapagent/mapagent.fcgi?SERVICENAME=zz&service=wfs&request=GetCapabilities',
type: 'WFS'
},
{
name: 'W3DS服务',
resourceId: 'http://localhost:18080/WiseMap/rest/v2/W3DS/1.0.0/zz/W3DSCapabilities.json',
type: 'WiseMapW3ds'
},
{
name: 'WMVTS服务',
resourceId: 'http://localhost:18080/WiseMap/rest/v2/WMVTS/1.0.0/zz/WMVTSCapabilities.json',
type: 'WiseMapWmvts'
}]
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operationallayersCfg |
Array |
Properties
|
Returns:
- Type
- Promise
getAngle(firstPoint, endPoints) → {Number}
求地表方位角,返回:0-360度
Parameters:
Name | Type | Description |
---|---|---|
firstPoint |
Cesium.Cartesian3 | 第一个点 |
endPoints |
Cesium.Cartesian3 | 最后点 |
Returns:
bearing 方位角
- Type
- Number
getAngle2Vector(vec1, vec2) → {Number}
二维向量,从vec1逆时针旋转到vec2的角度
Parameters:
Name | Type | Description |
---|---|---|
vec1 |
Cesium.Cartesian2 | |
vec2 |
Cesium.Cartesian2 |
Returns:
弧度值
- Type
- Number
getArea(positions, noAdd) → {Object}
计算地表投影平面面积,单位:平方米
Parameters:
Name | Type | Description |
---|---|---|
positions |
Array | 位置信息传Cesium.Cartesian3数组 |
noAdd |
Boolean | 是否追加 |
Returns:
area 面积信息
- Type
- Object
getAreaOfTriangle(pos1, pos2, pos3) → {Number}
计算三角形空间面积
Parameters:
Name | Type | Description |
---|---|---|
pos1 |
Cesium.Cartesian3 | 点1 |
pos2 |
Cesium.Cartesian3 | 点2 |
pos3 |
Cesium.Cartesian3 | 点3 |
Returns:
计算面积
- Type
- Number
getAreaOfTriangle(pos1, pos2, pos3) → {Number}
计算三角形的面积
Parameters:
Name | Type | Description |
---|---|---|
pos1 |
Cesium.Cartesian3 | |
pos2 |
Cesium.Cartesian3 | |
pos3 |
Cesium.Cartesian3 |
Returns:
三角形的面积
- Type
- Number
getAttrVal(attr) → {*}
/简化Cesium内的属性,去掉getValue等,取最简的键值对。方便popup、tooltip等使用
Parameters:
Name | Type | Description |
---|---|---|
attr |
* | 属性值 |
Returns:
属性值
- Type
- *
getAuthEnticate(param) → {Promise}
获取身份验证
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
param |
Object |
Properties
|
Returns:
Administrator Author Viewer
- Type
- Promise
getCenter(tileset, transform) → {Object}
获取模型的中心点信息
Parameters:
Name | Type | Description |
---|---|---|
tileset |
Object | 模型 |
transform |
Cesium.Matrix4 | 模型矩阵 |
Returns:
- Type
- Object
getClampArea(positions, options) → {Number}
计算贴地面积
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
positions |
Array | 点组信息 |
||||||||||||||||||||
options |
Object |
Properties
|
Returns:
area 面积
- Type
- Number
getClampLength(positions, options)
计算计算地表贴地距离,单位:米
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
positions |
Cesium.Cartesian3 | 位置信息 |
||||||||||||||||||||
options |
Object |
Properties
|
getEllipseOuterPositions(opts) → {Cesium.Cartesian3|LngLatPoin}
获取圆(或椭圆)边线上的坐标点数组
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object |
Properties
|
Returns:
边线上的坐标点数组
- Type
- Cesium.Cartesian3 | LngLatPoin
getEntityByProperty(fieldName, value) → {Array}
根据指定属性来获取对应的entity 因为属性值可以重复 因此返回的是个数组
Parameters:
Name | Type | Description |
---|---|---|
fieldName |
String | 属性名称 |
value |
String | Number | 属性值 |
Returns:
entity数组
- Type
- Array
getExplorerInfo() → {Object}
获取浏览器类型及版本
Returns:
浏览器类型及版本
- Type
- Object
getFlatHeight(positionsIn, globeHeight, inverseMat, splitNum) → {Number}
获取压平高度
Parameters:
Name | Type | Description |
---|---|---|
positionsIn |
Object | 坐标信息 |
globeHeight |
Number | 高度 |
inverseMat |
Cesium.Matrix4 | 切割类的矩阵 |
splitNum |
Number | 分割个数 |
Returns:
flatHeight 压平高度
- Type
- Number
getGranularity(positions, count)
求Rectangle范围内 按count等比插值的granularity值
Parameters:
Name | Type | Description |
---|---|---|
positions |
Array | 数组 |
count |
Number | 个数 |
getHeadingPitchRoll(entity, time) → {HeadingPitchRoll}
获取动态模型的当前hpr角度
Parameters:
Name | Type | Description |
---|---|---|
entity |
Object | 实体 |
time |
Date | 时间 |
Returns:
- Type
- HeadingPitchRoll
getHeadingPitchRollByMatrix(matrix, ellipsoid, fixedFrameTransform, result) → {HeadingPitchRoll}
根据模型的matrix矩阵求方位角
Parameters:
Name | Type | Description |
---|---|---|
matrix |
Cesium.Matrix4 | 模型矩阵 |
ellipsoid |
* | |
fixedFrameTransform |
* | |
result |
* |
Returns:
- Type
- HeadingPitchRoll
getHeadingPitchRollByMatrixOld(position, matrix, ellipsoid, fixedFrameTransform) → {HeadingPitchRoll}
根据模型的matrix矩阵求方位角
Parameters:
Name | Type | Description |
---|---|---|
position |
* | |
matrix |
* | |
ellipsoid |
* | |
fixedFrameTransform |
* |
Returns:
- Type
- HeadingPitchRoll
getHeadingPitchRollByOrientation(position, orientation, ellipsoid, fixedFrameTransform) → {HeadingPitchRoll}
根据模型的orientation求方位角
Parameters:
Name | Type | Description |
---|---|---|
position |
* | |
orientation |
* | |
ellipsoid |
* | |
fixedFrameTransform |
* |
Returns:
- Type
- HeadingPitchRoll
getHeadingPitchRollForLine(localStart, localEnd, ellipsoid, fixedFrameTransform) → {HeadingPitchRoll}
求localStart点到localEnd点的方向
Parameters:
Name | Type | Description |
---|---|---|
localStart |
* | |
localEnd |
* | |
ellipsoid |
* | |
fixedFrameTransform |
* |
Returns:
- Type
- HeadingPitchRoll
getHeightRange(positionsIn, scene, has3dtiles, splitNum, asyn, callback) → {Object}
计算面内最大、最小高度值
Parameters:
Name | Type | Description |
---|---|---|
positionsIn |
Array | 数组 |
scene |
scene | 场景 |
has3dtiles |
Boolean | 是否有3dtiles 默认true |
splitNum |
Number | 插值采样系数 值越大采样越密集 结果越准确 耗时越长 默认值10 |
asyn |
Boolean | 是否异步计算 异步计算不会卡界面 但总耗时会增加 默认false |
callback |
function | 异步计算完成后执行的回调函数 函数接收参数为{maxHeight:XXX,minHeight:XXX} |
Returns:
- Type
- Object
getLength(positions) → {Number}
计算空间距离,单位:米
Parameters:
Name | Type | Description |
---|---|---|
positions |
Cesium.Cartesian3 | 坐标位置信息 |
Returns:
- Type
- Number
getOffsetLine(positions, offset) → {Array}
计算平行线,offset正负决定方向(单位米)
Parameters:
Name | Type | Description |
---|---|---|
positions |
* | |
offset |
* |
Returns:
- Type
- Array
getOnLinePointByLen(p1, p2, len, addBS) → {Cesium.Matrix4}
求p1指向p2方向线上,距离p1指定len长度的新的点 ,addBS:true时为距离p2
Parameters:
Name | Type | Description |
---|---|---|
p1 |
* | |
p2 |
* | |
len |
* | |
addBS |
* |
Returns:
- Type
- Cesium.Matrix4
getPopup(cfg, attr, title) → {*}
获取Popup或Tooltip格式化字符串
Parameters:
Name | Type | Description |
---|---|---|
cfg |
* | 格式的配置 ,可以是数组,可以是html,亦或是函数 |
attr |
* | 属性值 |
title |
* | 标题 |
Returns:
返回页面或者false
- Type
- *
getPopupForConfig(cfg, attr) → {*}
根据config配置规则获取popup使用的html字符串
Parameters:
Name | Type | Description |
---|---|---|
cfg |
* | 格式的配置 ,可以是数组,可以是html,亦或是函数 |
attr |
* | 属性值 |
Returns:
返回页面或者false
- Type
- *
getPositionTranslation(position, offest, degree, type, fixedFrameTransform) → {Cartesian3}
获取点的offest平移矩阵后点
Parameters:
Name | Type | Description |
---|---|---|
position |
* | |
offest |
* | |
degree |
* | |
type |
* | |
fixedFrameTransform |
* |
Returns:
- Type
- Cartesian3
getProxyUrl(config)
判断url加上配置的代理
Parameters:
Name | Type | Description |
---|---|---|
config |
* | 配置文件 |
getRayEarthPosition(position, orientation, _reverse, ellipsoid) → {Cesium.Cartesian3}
求点按orientation方向射向地球与地球的交点
Parameters:
Name | Type | Description |
---|---|---|
position |
* | |
orientation |
* | |
_reverse |
* | |
ellipsoid |
* |
Returns:
- Type
- Cesium.Cartesian3
getRayEarthPositionByMatrix(_matrix, _reverse, ellipsoid) → {Cesium.Cartesian3}
求矩阵射向地球与地球的交点
Parameters:
Name | Type | Description |
---|---|---|
_matrix |
* | |
_reverse |
* | |
ellipsoid |
* |
Returns:
- Type
- Cesium.Cartesian3
getRequest() → {Object}
获取当前页面的url中的?传入参数对象集合
Returns:
参数名与参数值的键值对
- Type
- Object
getRequestByName(name) → {Object}
获取当前页面的url中的?传入的指定参数值
Parameters:
Name | Type | Description |
---|---|---|
name |
String | 指定参数名称 |
Returns:
获取到的参数值
- Type
- Object
getRotateCenterPoint(center, point1, angle) → {Cesium.Cartesian3}
获取点point1绕点center的地面法向量旋转顺时针angle角度后新坐标
Parameters:
Name | Type | Description |
---|---|---|
center |
* | |
point1 |
* | |
angle |
* |
Returns:
- Type
- Cesium.Cartesian3
getSiteInfo(param) → {Promise}
获取站定信息
Parameters:
Name | Type | Description |
---|---|---|
param |
Object |
Returns:
{
"SiteInformation": {
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"@xsi:noNamespaceSchemaLocation": "SiteInformation-2.2.0.xsd",
"Server": {
"DisplayName": null,
"IpAddress": "127.0.0.1",
"OperatingSystem": {
"AvailablePhysicalMemory": 2147483647,//可用物理内存
"AvailableVirtualMemory": 2147483647, //可用虚拟内存
"TotalPhysicalMemory": 2147483647, //总物理内存
"TotalVirtualMemory": 2147483647, //总虚拟内存
"Version": "Microsoft WindowsProfessional (Build 9200)" //系统版本
},
"Statistics": {
"ActiveConnections": 11, //活动连接
"AdminOperationsQueueCount": 0, //管理操作队列计数
"AverageOperationTime": 0, //平均运行时间
"CacheDroppedEntries": 0,
"CacheSize": 3,
"ClientOperationsQueueCount": 0,//客户端操作队列计数
"CpuUtilization": 0,//cpu利用率
"SiteOperationsQueueCount": 0,//站点操作队列计数
"TotalConnections": 20,//连接总数
"TotalOperationTime": 3,//总运行时间
"TotalOperationsProcessed": 4717,//已处理擦操作总数
"TotalOperationsReceived": 4718,//接收的操作总数
"Uptime": 6809,//正常运行时间
"VirtualMemory": 196141056,
"WorkingSet": 136757248
},
"Status": "Online",//状态
"Version": "6.0.0.0"//版本号
}
}
}
- Type
- Promise
getSlope(options)
求多个点的 坡度坡向
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
getTooltipForConfig(cfg, attr) → {*}
据config配置规则获取tooltip使用的html字符串
Parameters:
Name | Type | Description |
---|---|---|
cfg |
* | 格式的配置 ,可以是数组,可以是html,亦或是函数 |
attr |
* | 属性值 |
Returns:
返回页面或者false
- Type
- *
getVectorAngle(vec2) → {Number}
得到二维向量的角度
从x+轴到二维向量的角度
Parameters:
Name | Type | Description |
---|---|---|
vec2 |
Cesium.Cartesian2 |
Returns:
弧度值
- Type
- Number
hasTerrainProvider(viewer) → {Boolean}
判断是否有地形
Parameters:
Name | Type | Description |
---|---|---|
viewer |
Viewer |
Returns:
若有返回true 否则返回false
- Type
- Boolean
highlightEntity(entitys, opts) → {Object}
定时闪烁高亮Entity(点、线、面)
Parameters:
Name | Type | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
entitys |
* | 闪烁高亮Entity(点、线、面) |
|||||||||||||||||||||||||
opts |
Object |
Properties
|
Returns:
- Type
- Object
interPolygon(opts) → {Boolean}
面内进行贴地(或贴模型)插值, 返回三角网等计算结果
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object |
Properties
|
Returns:
- Type
- Boolean
isElectron() → {Boolean}
判断所在环境是不是 electron
Returns:
是否为electron
- Type
- Boolean
isNumber(obj) → {Boolean}
判断对象是否为Number类型
Parameters:
Name | Type | Description |
---|---|---|
obj |
* |
Returns:
是否为Number类型
- Type
- Boolean
isObject(obj) → {Boolean}
判断对象是否为Object类型
Parameters:
Name | Type | Description |
---|---|---|
obj |
* |
Returns:
是否为Object类型
- Type
- Boolean
isPCBroswer() → {Boolen}
是否PC 浏览器
Returns:
- Type
- Boolen
isPointInTriangle(pts, pt) → {boolean}
判断点是否在三角形内
Parameters:
Name | Type | Description |
---|---|---|
pts |
Array.<Cesium.Cartesian2> | |
pt |
Cesium.Cartesian2 |
Returns:
- Type
- boolean
isString(str) → {Boolean}
判断对象是否为String类型
Parameters:
Name | Type | Description |
---|---|---|
str |
* |
Returns:
是否为String类型
- Type
- Boolean
line2Bezier(_positions_draw, closure) → {Array}
把一条线变成bezier曲线
Parameters:
Name | Type | Description |
---|---|---|
_positions_draw |
Array.<points> | |
closure |
Boolean | 是否闭合 |
Returns:
- Type
- Array
loopArrayForFun(ArrOrObj, calback) → {function}
多个实体进行高亮显示
Example
loopArrayForFun(ArrOrObj, function (entity) {
drawControl.deleteEntity(entity);
});
Parameters:
Name | Type | Description |
---|---|---|
ArrOrObj |
Array | 高亮对象 |
calback |
function | 回调函数 |
Returns:
- Type
- function
move(entity, options)
移动模型
Parameters:
Name | Type | Description |
---|---|---|
entity |
Object | 实体 |
options |
Object | 实体移动参数 |
msg(msg)
弹出消息
Parameters:
Name | Type | Description |
---|---|---|
msg |
String | 消息内容 |
pick3DTileset(scene, positions) → {Object}
获取坐标点处的3dtiles模型,用于计算贴地时进行判断(和视角有关系,不一定精确)
Parameters:
Name | Type | Description |
---|---|---|
scene |
Object | 场景信息 |
positions |
Cesium.Cartesian3 | 点信息 |
Returns:
- Type
- Object
PolyGradientMaterialProperty(color, alphaPoweropt, diffusePoweropt)
渐变色材质
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
color |
Color | 颜色 |
||
alphaPower |
Number |
<optional> |
1.5
|
alpha值增益系数 |
diffusePower |
Number |
<optional> |
1.6
|
漫反射增益系数 |
R2D(radians) → {Number}
弧度转度
Parameters:
Name | Type | Description |
---|---|---|
radians |
Number |
Returns:
- Type
- Number
register(type, layerClass)
注册拓展类 eg: zz3d.draw.register()
Parameters:
Name | Type | Description |
---|---|---|
type |
String | 类型 |
layerClass |
Object | 拓展类 |
removeShpEnt(viewer, idOrShpPath, entArr)
从场景中移除通过shp加载的实体
Parameters:
Name | Type | Description |
---|---|---|
viewer |
Viewer | 目标场景 |
idOrShpPath |
String | id或者shp路径 |
entArr |
Array | 要移除的实体 不传参数时全部移除 |
rotateVec2(vec2, angle) → {Cesium.Cartesian2}
二维向量旋转
Parameters:
Name | Type | Description |
---|---|---|
vec2 |
Cesium.Cartesian2 | 原始的二维向量 |
angle |
Number | 旋转角度(弧度) |
Returns:
旋转后得到的向量
- Type
- Cesium.Cartesian2
SamplePositions()
采样点
setEnablePickFeature(enable)
设置是否允许pick
Parameters:
Name | Type | Description |
---|---|---|
enable |
Boolean | 是否向服务端发送pick属性请求 仅对MapGuide相关服务有效 |
setMaxPickFeature(num)
设置最大求交数量
Parameters:
Name | Type | Description |
---|---|---|
num |
Number | 最大求交数,为负值时能交几个交几个 |
shp2geojson(shpPath, callback, bLoad, viewer, style, bFlyToopt)
shp转geojson 可以选择是否加载到场景
style格式如下
style = {
pointColor:new Cesium.Color(0,1,0,1), //点颜色
pointSize:3, //点大小
fill:new Cesium.Color(0,0,1,0.5), //面颜色
strokeWidth:2, //线宽
strokeColor:new Cesium.Color(1,0,0,1),//线颜色
}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
shpPath |
String | 目标文件路径 |
||
callback |
function | 处理完成后的回调函数,参数为(geojson,ents) 若bLoad为false则ents为undefined |
||
bLoad |
Boolean | 是否要加载到场景 |
||
viewer |
Viewer | 目标场景 |
||
style |
Object | 显示样式 |
||
bFlyTo |
Boolean |
<optional> |
true
|
加载完是否定位 |
shpBuffer2geojson(id, shpBuffer, prjStr, dbfBuffer, callback, bLoad, viewer, style, bFlyToopt)
shpBuffer转geojson 可以选择是否加载到场景
style格式如下
style = {
pointColor:new Cesium.Color(0,1,0,1), //点颜色
pointSize:3, //点大小
fill:new Cesium.Color(0,0,1,0.5), //面颜色
strokeWidth:2, //线宽
strokeColor:new Cesium.Color(1,0,0,1),//线颜色
}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
String | 唯一标识 若需要加载到场景 则删除时以此为依据 |
||
shpBuffer |
ArrayBuffer | .shp文件对应的ArrayBuffer |
||
prjStr |
String | .prj文件对应的字符串 |
||
dbfBuffer |
ArrayBuffer | .dbf文件对应的ArrayBuffer |
||
callback |
function | 处理完成后的回调函数,参数为(geojson,ents) 若bLoad为false则ents为undefined |
||
bLoad |
Boolean | 是否要加载到场景 |
||
viewer |
Viewer | 目标场景 |
||
style |
Object | 显示样式 |
||
bFlyTo |
Boolean |
<optional> |
true
|
加载完是否定位 |
template(str, data)
popup的字符串模板
Parameters:
Name | Type | Description |
---|---|---|
str |
* | 内容 |
data |
Object | 数据 |
unHighlightEntity(flashingEntity)
取消定时闪烁高亮Entity(点、线、面)
Parameters:
Name | Type | Description |
---|---|---|
flashingEntity |
* | 闪烁高亮Entity |
updateAxis(matrix, axis) → {Cesium.Matrix4}
如果可以修改模型json源文件,可以在json文件里面加了一行来修正:"gltfUpAxis" : "Z",
Parameters:
Name | Type | Description |
---|---|---|
matrix |
Cesium.Matrix4 | |
axis |
Cesium.Axis | 方向 |
Returns:
- Type
- Cesium.Matrix4
updateLayerHeight(bClampToGround, height)
更新图层贴地状态和高度 设置贴地时高度参数会被弃用
Parameters:
Name | Type | Description |
---|---|---|
bClampToGround |
Boolean | calbakc参数传数据数组 |
height |
Number | 回调方法 |
updateMatrix(tileset, opts) → {Cesium.Matrix4}
变换模型位置等
Parameters:
Name | Type | Description |
---|---|---|
tileset |
Object | 模型 |
opts |
Object | 模型参数 |
Returns:
- Type
- Cesium.Matrix4
updateVolume(resultInter, cutHeight) → {Object}
根据 基准面高度 重新计算填挖方体积
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
resultInter |
Object |
Properties
|
||||||||||||||||||||
cutHeight |
Number | 基准面高度 |
Returns:
- Type
- Object
updateVolumeByMinHeight(resultInter) → {Object}
根据 最低底面高度 重新计算填挖方体积
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
resultInter |
Object |
Properties
|
Returns:
- Type
- Object
webglreport() → {Boolen}
检测浏览器webgl支持
Returns:
支持情况
- Type
- Boolen
zzAssign(target, src)
把src中的属性递归的复制到target中
Parameters:
Name | Type | Description |
---|---|---|
target |
Object | |
src |
Object |
Type Definitions
analyType
分析类型.
ViewShed 视域分析. 对应分析类为ViewShed3DEx
BufferTurf 缓冲区分析 对应分析类为BufferTurfEx
ContourLine 等高线 对应分析类为ContourLine
MeasureVolume 方量分析 对应分析类为MeasureVolume
FloodByEntity 用polygon模拟淹没分析 对应分析类为FloodByEntityEx
Sightline 视点分析 对应分析类为SightlineEx
MeasureSection 剖面分析 对应分析类为MeasureSection
Slope 坡度分析 对应分析类为Slope
Skyline 天际线分析 对应分析类为Skyline
TilesContour 3DTiles图层等高线分析 对应类为TilesContour
Type:
- "ViewShed" | "BufferTurf" | "ContourLine" | "MeasureVolume" | "FloodByEntity" | "Sightline" | "MeasureSection" | "Slope" | "Skyline" | "TilesContour"