Global

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
Name Type Description
entitys Object
scale Object
speed Object
time Object
foornAimation Object

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
Name Type Attributes Default Description
scene Cesium.Scene <optional>

三维地图场景对象,一般用map.scene或viewer.scene

positions Array <optional>

坐标数组

callback interPolygon_callback <optional>

异步计算高度完成后 的回调方法

splitNum Number <optional>
10

可选插值数,横纵等比分割的网格个数

asyn Boolean <optional>
false

可选是否进行异步精确计算

has3dtiles Boolean <optional>
auto

可选是否在3dtiles模型上分析(模型分析较慢,按需开启),默认内部根据点的位置自动判断(但可能不准)

objectsToExclude Array.<Object> <optional>
null

可选贴模型分析时,排除的不进行贴模型计算的模型对象,可以是: primitives, entities, 或 3D Tiles features

onlyPoint Boolean <optional>
false

可选truea时,返回结果中只返回点,不返回三角

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

条件 默认模糊查询
包含: 'like',
不包含: 'not like',
等于: '=',
不等于: '!=',
大于: '>',
大于等于: '>=',
小于: '<',
小于等于: '<='

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
Name Type Attributes Description
name String <optional>

可合并图层图层的名称,不可合并图层父文件夹的名称

url String <optional>

仅WiseMap服务需要,值为WiseMap服务地址

resourceId Array <optional>

仅WiseMap服务需要为数组,值为MapDefinition,其他为String 服务地址

type String <optional>

WiseMap,ArcgisServe,WiseMapWms,WiseMapWmts,WiseMapW3ds,WiseMapWmvts,WiseMapWfs

userName String <optional>

仅WiseMap服务需要

password String <optional>

仅WiseMap服务需要

viewer Object

场景

createImageryProvider(item, serverURL) → {Object}

创建地图影像图层

Parameters:
Name Type Description
item Object

图层相关参数,含有以下属性:

Properties
Name Type Attributes Description
url String <optional>

图层URL

type String <optional>

图层类型

crs String <optional>

图层坐标系 eg:"4326"/"4490"/"wgs84"

boundingBox String <optional>

图层范围 eg:{xMin:xxx,yMin:xxx,xMax:xxx,yMax:xxx} 单位角度

serverURL String

若该参数有效,则会用该参数替换其他URL中的“serverURL”字段

Returns:

图层对象

Type
Object

createLayer(item, viewer, serverURL) → {Object}

创建图层

Parameters:
Name Type Description
item Object

图层相关参数,含有以下必须属性:

Properties
Name Type Attributes Description
url String <optional>

图层URL

type String <optional>

图层类型

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
Name Type Attributes Description
url String <optional>

地图配置文件对应的URL地址

success function <optional>

地图创建并初始化成功后执行的回调函数 参数为(viewer,config)

id String <optional>

地图容器对应的dom ID

data Object <optional>

用来配置地图的各个参数 支持viewer构造函数的所有参数 若有URL则会优先使用URL请求下来的配置

Properties
Name Type Attributes Description
basemaps Array <optional>

影像数组 详情参考配置清单

baseterrains Array <optional>

地形数组 详情参考配置清单

center Object <optional>

定位点 eg:{heading: 359.7,pitch: -36.5,roll: 360,x: 112.706222,y: 32.976245,z: 133663.65}

contextmenu Boolean <optional>

是否允许右键菜单

loadImageRequireMode Boolean <optional>

加载影像是否按需加载 按需加载会跳过中间不显示的级别直接请求显示的瓦片影像

location Object <optional>

左下角定位信息 eg:{fps: true, format: '

经度:{x}
纬度:{y}
视高:{height}米
', crs: ''}

maxzoom Number <optional>

允许缩放的最大距离

minzoom Number <optional>

允许缩放的最小距离

geocoder Boolean <optional>

添加自定义高德搜索栏

mouseZoom Boolean <optional>

允许鼠标缩放

navigation Object <optional>

比例尺显示信息

operationallayers Array <optional>

所有图层信息

renderLayers Array <optional>

初始化时添加的图层

requestWebgl2 Boolean <optional>

是否开启WEBGL2.0

terrainHeightOffset Number <optional>

地形抬高

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
Name Type Attributes Description
x Number <optional>

x坐标

y Number <optional>

y坐标

z Number <optional>

z坐标

heading Number <optional>

heading 方向角度值,绕垂直于地心的轴旋转角度, 0至360

pitch Number <optional>

pitch 俯仰角度值,绕纬度线旋转角度, 0至360

roll Number <optional>

roll 翻滚角度值,绕经度线旋转角度, 0至360

name String <optional>

名称

tooltip String <optional>

提示信息

popup function <optional>

弹出信息

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
Name Type Attributes Default Description
id String <optional>
'water'

实体ID

normalMap String <optional>

水正常扰动的法线图URL

frequency Number <optional>
8000

控制波数的数字

animationSpeed Number <optional>
0.03

控制水的动画速度的数字

amplitude Number <optional>
5

控制水波振幅的数字

specularIntensity Number <optional>
0.8

控制镜面反射强度的数字

baseWaterColor String <optional>
"#123e59"

基础颜色的水

blendColor String <optional>
"#123e59"

从水中混合到非水域时使用的颜色对象

opacity Number <optional>

不透明度

clampToGround Boolean <optional>

是否贴地

classificationType ClassificationType <optional>

投射类型

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
Name Type Attributes Description
load3D Boolean <optional>

数据加载方式 默认true

mergeLayer Boolean <optional>

二维图层合并 默认true

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
Name Type Attributes Description
url String <optional>

仅WiseMap服务需要,值为WiseMap服务地址

resourceId Array <optional>

仅WiseMap服务需要为数组,值为MapDefinition,其他为String 服务地址

type String <optional>

WiseMap,ArcgisServe,WiseMapWms,WiseMapWmts,WiseMapW3ds,WiseMapWmvts,WiseMapWfs

userName String <optional>

仅WiseMap服务需要

password String <optional>

仅WiseMap服务需要

options String <optional>

其他参数

Properties
Name Type Attributes Description
key String <optional>

key为MapDefinition

Properties
Name Type Attributes Description
createRunTimeParam String <optional>

createRunTime后端接口附件参数 会自动追加到参数最后并覆盖

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
Name Type Attributes Description
USERNAME String <optional>

用户名

PASSWORD String <optional>

密码

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
Name Type Attributes Description
scene Number <optional>

当前场景

splitNum Number <optional>

分段数量

has3dtiles Boolean <optional>

是否贴地

calback function <optional>

计算完后的回调函数

Returns:

area 面积

Type
Number

getClampLength(positions, options)

计算计算地表贴地距离,单位:米

Parameters:
Name Type Description
positions Cesium.Cartesian3

位置信息

options Object
Properties
Name Type Attributes Description
scene Number <optional>

当前场景

splitNum Number <optional>

分段数量

has3dtiles Boolean <optional>

是否贴地

calback function <optional>

计算完后的回调函数

getEllipseOuterPositions(opts) → {Cesium.Cartesian3|LngLatPoin}

获取圆(或椭圆)边线上的坐标点数组

Parameters:
Name Type Description
opts Object
Properties
Name Type Attributes Description
position Cesium.Cartesian3 | LngLatPoin <optional>

圆的中心坐标

radius Number <optional>

如是圆时,半径(单位:米)

semiMajorAxis Number <optional>

椭圆时的 长半轴半径(单位:米)

semiMinorAxis Number <optional>

椭圆时的 短半轴半径(单位:米)

count Number <optional>

象限内点的数量,返回的总数为 count*4

granularity Number <optional>

granularity值,与count二选一

rotation Number <optional>

可选旋转的角度

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
Name Type Attributes Description
viewer Object <optional>

当前场景

positions Array <optional>

位置信息

radius Number <optional>

缓冲半径(影响坡度坡向的精度)

count Number <optional>

缓冲的数量(影响坡度坡向的精度)会求周边(count*4)个点

has3dtiles Boolean <optional>

是否贴地

calbakStep function <optional>

计算完后的回调函数

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
Name Type Attributes Default Description
maxAlpha Number <optional>
0.3

高亮透明度

time Number <optional>
10

播放时长

color Cesium.Color <optional>
Cesium.Color.YELLOW

高亮颜色

onEnd function <optional>

结束事件

Returns:
Type
Object

interPolygon(opts) → {Boolean}

面内进行贴地(或贴模型)插值, 返回三角网等计算结果

Parameters:
Name Type Description
opts Object
Properties
Name Type Attributes Default Description
scene Cesium.Scene <optional>

三维地图场景对象,一般用map.scene或viewer.scene

positions Array <optional>

坐标数组

calback interPolygon_callback <optional>

异步计算高度完成后 的回调方法

splitNum Number <optional>
10

可选插值数,横纵等比分割的网格个数

asyn Boolean <optional>
false

可选是否进行异步精确计算

has3dtiles Boolean <optional>
auto

可选是否在3dtiles模型上分析(模型分析较慢,按需开启),默认内部根据点的位置自动判断(但可能不准)

objectsToExclude Array.<Object> <optional>
null

可选贴模型分析时,排除的不进行贴模型计算的模型对象,可以是: primitives, entities, 或 3D Tiles features

onlyPoint Boolean <optional>
false

可选truea时,返回结果中只返回点,不返回三角

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
Name Type Attributes Description
minHeight Number <optional>

最低高度

list Array <optional>

点数组

totalArea Number <optional>

总面积

totalVolume Number <optional>

总体积

cutHeight Number

基准面高度

Returns:
Type
Object

updateVolumeByMinHeight(resultInter) → {Object}

根据 最低底面高度 重新计算填挖方体积

Parameters:
Name Type Description
resultInter Object
Properties
Name Type Attributes Description
minHeight Number <optional>

最低高度

list Array <optional>

点数组

totalArea Number <optional>

总面积

totalVolume Number <optional>

总体积

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"