成员变量
# constant InitializeOptionsType
使用initializeOption接口获取的option对应的实例化对象类型
属性:
| Name | Type | Description |
|---|---|---|
MapGISM3DSet |
String | MapGISM3DSet:M3D对象 |
MapGISTerrainProvider |
String | MapGISTerrainProvider:MapGIS地形对象 |
MapGISDynamicLabelCollection |
String | 注记图层对象:该功能待重构,枚举标签暂时使用label替代 |
MapGISMapServerImageryProvider |
String | MapGISMapServerImageryProvider:覆盖物图层IGS 2.0 SceneServer |
UrlTemplateImageryProvider |
String | UrlTemplateImageryProvider:覆盖物图层IGS 1.0 g3d |
# reduceArray
- Version:
- 1.7.1
- License:
- when.js - https://github.com/cujojs/when MIT License (c) copyright B Cavalier & J Hann A lightweight CommonJS Promises/A and when() implementation when is part of the cujo.js family of libraries (http://cujojs.com/) Licensed under the MIT License at: http://www.opensource.org/licenses/mit-license.php
# translucent
When true or a function that returns true,
the geometry is expected to appear translucent.
- Default Value:
- undefined
# type
The material type. Can be an existing type or a new type. If no type is specified in fabric, type is a GUID.
- Default Value:
- undefined
方法
# _renderLabelInDecentralize(polyline3D, collection, startRate, endRate, textArr, id, options)
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
polyline3D |
* | 线几何计算类 |
collection |
* | 注记容器 |
startRate |
* | 开始分段 |
endRate |
* | 结束分段 |
textArr |
* | 文字分段数组 |
id |
* | 注记id |
options |
* | 注记选项 |
# addBillboardPrimitive(graphic, position, success)
添加BillboardPrimitive对象,如果设置除绝对高度以外的高程模式,则进行高程采样
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
graphic |
SimpleMarkerGraphic | PictureMarkerGraphic | 要采样的绘制对象 |
position |
Cesium.Cartographic | 要采样的点坐标数组 |
success |
function | 几何添加完毕回调 |
# addMapRefLayer(mapRefOption, sublayerView)
添加覆盖物图层
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
mapRefOption |
Object | 覆盖物图层构造参数 |
sublayerView |
IGSSceneSubLayerView | Cesium的view对象 |
覆盖物图层innerLayer对象
# addPointPrimitive(graphic, position, success)
添加PointPrimitive对象,如果设置除绝对高度以外的高程模式,则进行高程采样
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
graphic |
SimpleMarkerGraphic | PictureMarkerGraphic | 要采样的绘制对象 |
position |
Cesium.Cartographic | 要采样的点坐标数组 |
success |
function | 几何添加完毕回调 |
# any(promisesOrValues, onFulfilledopt, nullable, onRejectedopt, nullable, onProgressopt, nullable)
Initiates a competitive race, returning a promise that will resolve when any one of the supplied promisesOrValues has resolved or will reject when all promisesOrValues have rejected.
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
promisesOrValues |
Array | Promise | array of anything, may contain a mix
of |
onFulfilled |
function | resolution handler |
onRejected |
function | rejection handler |
onProgress |
function | progress handler |
promise that will resolve to the value that resolved first, or will reject with an array of all rejected inputs.
# buildModuleUrl(relativeUrl)
Given a relative URL under the MapGIS base URL, returns an absolute URL.
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
relativeUrl |
String | The relative path. |
The absolutely URL representation of the provided path.
# chain(promiseOrValue, resolver, resolveValueopt)
Ensure that resolution of promiseOrValue will trigger resolver with the value or reason of promiseOrValue, or instead with resolveValue if it is provided.
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
promiseOrValue |
||
resolver |
Object | |
resolve |
function | |
reject |
function | |
resolveValue |
* |
# convertCommonRendererToM3DRenderer(renderer)
将common层的renderer转为MapGISM3DSet需要的renderer
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
renderer |
Object | common层的renderer的对象 |
MapGISM3DSet需要的renderer
# convertPictureMarkerSymbolToGraphicStyle(type, paintStyle, symbol)
转换点符号为Cesium Graphics样式
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
type |
String | 几何样式 |
paintStyle |
* | graphics样式 |
symbol |
* | 符号 |
# convertShadeToGLSL100(input, isFragmentShader)
将GLSL 300转换为GLSL 100,该方法目前仅对一些常见的用例进行转换
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
input |
String | GLSL 300版本的Shader代码 |
isFragmentShader |
Boolean | 是否是片元着色器的Shader代码 |
转换后的Shader代码
# convertSimpleFillSymbolToGraphicStyle(type, paintStyle, symbol)
转换填充符号为Cesium Graphics样式
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
type |
String | 几何样式 |
paintStyle |
* | graphics样式 |
symbol |
* | 符号 |
# convertSimpleLineSymbolToGraphicStyle(type, paintStyle, symbol)
转换简单线符号为Cesium Graphics样式
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
type |
String | 几何样式 |
paintStyle |
* | graphics样式 |
symbol |
* | 符号 |
# convertSimpleMarkerSymbolToGraphicStyle(type, paintStyle, symbol)
转换点符号为Cesium Graphics样式
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
type |
String | 几何样式 |
paintStyle |
* | graphics样式 |
symbol |
* | 符号 |
# createBaseLineMaterial(color, type)
通过颜色和线(虚线)类型创建材质,是一个基本的颜色填充线
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
color |
Object | Cesium的颜色对象 |
type |
String | 线类型 |
创建好的cesium的线材质对象
# createBillboard(symbolLayer, position, options)
通过点坐标构造一个billboard的初始化参数
参数:
| 名称 | 类型 | 默认值 | 描述 |
|---|---|---|---|
symbolLayer |
IconSymbol3DLayer | 三维图标图层 |
|
position |
Array.<Number> | 经纬度坐标,[longitude,latitude,height] |
|
options |
Object | 额外参数 |
|
image |
Object | billboard的图片url |
|
show |
Boolean | true | 是否显示 |
layerOpacity |
Number | 1 | 图层透明度 |
graphic |
BaseGraphic | 三维的几何对象 |
billboard构造参数
# createObject3DAppearance(symbolLayer, options)
通过ObjectSymbol3DLayer来构造外观对象
参数:
| 名称 | 类型 | 默认值 | 描述 |
|---|---|---|---|
symbolLayer |
ObjectSymbol3DLayer | 三维对象图层 |
|
options |
Object | 额外参数 |
|
layerOpacity |
Number | 1 | 额外参数 |
三维的外观对象
# defer()
Creates a new, Deferred with fully isolated resolver and promise parts, either or both of which may be given out safely to consumers. The Deferred itself has the full API: resolve, reject, progress, and then. The resolver has resolve, reject, and progress. The promise only has then.
# demodernizeShader(gl, input, isFragmentShader)
将GLSL 300转换为GLSL 100,该方法目前仅对一些常见的用例进行转换
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
gl |
WebGLRenderingContext | WebGLRenderingContext对象 |
input |
String | GLSL 300版本的Shader代码 |
isFragmentShader |
Boolean | 是否是片元着色器的Shader代码 |
转换后的Shader代码
# getBillboardAnchor(anchor)
根据三维Billboard符号的锚点生成Cesium的锚点
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
anchor |
AnchorType | 三维Billboard符号的锚点 |
Cesium的锚点
# getBillboardAndLabelSample(graphic, position)
获取BillboardAndLabel的高程模式和更新高程后的点坐标
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
graphic |
BaseGraphic | 三维几何对象 |
position |
Array.<Number> | 经纬度坐标,[longitude,latitude,height] |
高程模式和更新高程后的点坐标
# getBillboardOptionsFromPictureMarkerSymbol(symbol)
通过符号来构造一个entity的billboard构造参数
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
symbol |
Symbol | 符号对象 |
entity的点构造参数
# getBillboardOptionsFromSimpleMarkerSymbol(symbol)
通过符号来构造一个entity的billboard构造参数
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
symbol |
Symbol | 符号对象 |
entity的点构造参数
# getClassificationTyp(elevationMode)
通过ElevationMode的值来获取Cesium的ClassificationTyp值
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
elevationMode |
ElevationMode | 高度模式 |
Cesium的ClassificationTyp值
# getExcludePrimitivesInModelSample(viewer)
获取在模型采样中,要排除的primitives
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
viewer |
Cesium.Viewer | 场景视图对象 |
要排除的primitives
# getFeatureBySymbolLayer(symbolLayer, type, position, graphic)
根据三维符号图层来创建一个要素对象
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
symbolLayer |
Symbol3DLayer | 三维符号图层对象 |
type |
SymbolType | 符号类型 |
position |
Cesium.Cartographic | 点坐标 |
graphic |
BaseGraphic | 三维几何对象 |
要素对象
# getLayerByUrl(url, LayerConstructor)
通过url构造Common的图层对象
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
url |
String | 服务基地址 |
LayerConstructor |
Layer | 图层构造函数 |
构造好的图层对象
# getLayerToUse(layers, level, x, y)
根据级数、行号和列号来筛选可用的地形图层
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
layers |
Array.<Object> | 地形图层数组 |
level |
Number | 级数 |
x |
Number | 行号 |
y |
Number | 列号 |
可用的地形图层
# getMapGISM3DSetRenderer(renderer)
将common层的renderer转为MapGISM3DSet需要的renderer,renderer可以为数组,格式为[{layerID:'', renderer: {}}]
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
renderer |
Object | Array.<Object> | common层的renderer的对象 |
MapGISM3DSet需要的renderer
# getMapRefOptions(subLayer)
获取覆盖物图层构造参数
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
subLayer |
IGSSceneSubLayer | 场景图层子图层对象 |
覆盖物图层构造参数
# getOpacityExpression(opacity)
获取Cesium.Cesium3DTileStyle的透明度表达式字符串
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
opacity |
Number | 透明度,0到1之间的值 |
透明度表达式字符串
# getPointOptionsFromSimpleMarkerSymbol(symbol)
通过符号来构造一个entity的点构造参数
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
symbol |
Symbol | 符号对象 |
entity的点构造参数
# getProviderExtent(layer, tilingSchemeRectangle)
获取provider的范围,并将范围统一成4326坐标系
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
layer |
Object | 基本图层对象 |
tilingSchemeRectangle |
Object | 瓦片平铺规则的矩形范围 |
cesium中provider的范围
# getTerrainAndModelHeight(terrainHeight, modelHeight)
从地形高程采样和模型高程采样中获取最高高度
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
terrainHeight |
Number | 地形采样高度 |
modelHeight |
Number | 模型采样高度 |
最高高度
# getTilingScheme(spatialReference, extent, tileInfo, axisDirection)
从SpatialReference中获取TilingScheme对象给cesium使用
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
spatialReference |
SpatialReference | 坐标系对象 |
extent |
Extent | 坐标系对象 |
tileInfo |
TileInfo | 坐标系对象 |
axisDirection |
Object | 坐标系对象 |
TilingScheme对象
# getWebglVersion(gl)
获取WebGL的版本
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
gl |
WebGLRenderingContext | WebGLRenderingContext对象 |
0:WebGL不支持或非WebGL对象;1:WebGL 1.0;2:WebGL 2.0;
# initResourceByUrl(url, options)
通过url构造Cesium.Resource对象,请求参数的优先级:?号后的参数<resource.queryParameters<外部传入的请求参数
参数:
| 名称 | 类型 | 默认值 | 描述 |
|---|---|---|---|
url |
Cesium.Resource | String | url对象 |
|
options |
Object | 额外构造参数 |
|
headers |
Object | {} | 请求头参数 |
queryParameters |
Object | {} | 请求参数对象,格式为{ key1: value1, key2: value2,... } |
enableMatchString |
Boolean | true | 是否开启基地址模版字符串匹配 |
构造好的Cesium.Resource对象
# isGeographic(projection)
判断projection对象投影是否是地理经纬度坐标系
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
projection |
* |
示例
isGeographic = Cesium.isGeographic(projection);
# isPromise(promiseOrValue)
Determines if promiseOrValue is a promise or not. Uses the feature test from http://wiki.commonjs.org/wiki/Promises/A to determine if promiseOrValue is a promise.
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
promiseOrValue |
* | anything |
true if promiseOrValue is a Promise
# join()
Joins multiple promises into a single returned promise.
a promise that will fulfill when all the input promises have fulfilled, or will reject when any one of the input promises rejects.
# map(promise, mapFunc)
Traditional map function, similar to Array.prototype.map(), but allows
input to contain Promises and/or values, and mapFunc may return
either a value or a Promise
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
promise |
Array | Promise | array of anything, may contain a mix
of |
mapFunc |
function | mapping function mapFunc(value) which may return
either a |
# prepareFontStyle(fontStyle)
https://developer.mozilla.org/en-US/docs/Web/CSS/font-style
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
fontStyle |
CSS font style.
# prepareFontWeight(fontWeight)
https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
fontWeight |
CSS font weight.
# processQueue(queue, value)
Apply all functions in queue to value
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
queue |
Array | array of functions to execute |
value |
* | argument passed to each function |
# redefineAspectArrowMaterial(options)
重新注册AspectArrowMaterial材质,主动调用才会注册,如果已经注册了,则不会重新注册
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
options |
Object | 初始化参数 |
webGLRenderingContext |
WebGLRenderingContext | webgl对象,根据其不版本来判断是否将GLSL 300语法转换为GLSL 100语法,如果不设置该值,则直接将GLSL 300语法转换为GLSL 100语法 |
# redefinePolylineTrailLink(options)
重新注册PolylineTrailLink材质,主动调用才会注册,如果已经注册了,则不会重新注册
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
options |
Object | 初始化参数 |
webGLRenderingContext |
WebGLRenderingContext | webgl对象,根据其不版本来判断是否将GLSL 300语法转换为GLSL 100语法,如果不设置该值,则直接将GLSL 300语法转换为GLSL 100语法 |
# redefineTextImageMaterial(options)
重新注册TextImageMaterial材质,主动调用才会注册,如果已经注册了,则不会重新注册
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
options |
Object | 初始化参数 |
webGLRenderingContext |
WebGLRenderingContext | webgl对象,根据其不版本来判断是否将GLSL 300语法转换为GLSL 100语法,如果不设置该值,则直接将GLSL 300语法转换为GLSL 100语法 |
# redefineWebMapTileServiceImageryProviderPrototype()
重写cesium对象WebMapTileServiceImageryProvider中的方法
# reduce(promise, reduceFunc)
Traditional reduce function, similar to Array.prototype.reduce(), but
input may contain promises and/or values, and reduceFunc
may return either a value or a promise, and initialValue may
be a promise for the starting value.
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
promise |
Array | Promise | array or promise for an array of anything, may contain a mix of promises and values. |
reduceFunc |
function | reduce function reduce(currentValue, nextValue, index, total), where total is the total number of items being reduced, and will be the same in each call to reduceFunc. |
that will resolve to the final reduced value
# reject(promiseOrValue)
Returns a rejected promise for the supplied promiseOrValue. The returned promise will be rejected with:
- promiseOrValue, if it is a value, or
- if promiseOrValue is a promise
- promiseOrValue's value after it is fulfilled
- promiseOrValue's reason after it is rejected
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
promiseOrValue |
* | the rejected value of the returned |
# resolve(promiseOrValue)
Returns promiseOrValue if promiseOrValue is a Promise, a new Promise if
promiseOrValue is a foreign promise, or a new, already-fulfilled Promise
whose value is promiseOrValue if promiseOrValue is an immediate value.
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
promiseOrValue |
* |
# samplePointsPromise(graphic, samplePositions, callback)
通过异步方式,获取Point更新高程后的点坐标,当地形深度检测关闭时,使用此方法
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
graphic |
BaseGraphic | 三维几何对象 |
samplePositions |
Array.<Cesium.Cartographic> | 要采样的点坐标数组 |
callback |
function | 采样完成后的回调函数 |
更新高程后的点坐标
# sampleScene(viewer, samplePositions, objectsToExclude, elevationInfo, callback)
输入一组Cartographic坐标点,进行场景(地形和模型)高程采样,异步函数 必须要传入一个外部设置地形 不受深度检测的影响
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
viewer |
Cesium.Viewer | Cesium的场景视图对象 |
samplePositions |
Array.<Cesium.Cartographic> | 要采样的点坐标数组 |
objectsToExclude |
Array.<Cesium.Primitive> | 要排除采样的primitive |
elevationInfo |
ElevationInfo | 高程采样信息 |
callback |
function | 采样后的回调函数,callback(Array<Cesium.Cartographic>) |
# sampleTerrain(viewer, samplePositions, elevationInfo, callback)
输入一组Cartographic坐标点,进行地形高程采样,异步函数, 当使用默认地形时,仍可进行高程采样 不受深度检测的影响
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
viewer |
Cesium.Viewer | Cesium的场景对象 |
samplePositions |
Array.<Cesium.Cartographic> | 要采样的点坐标数组 |
elevationInfo |
ElevationInfo | 高程采样信息 |
callback |
function | 采样后的回调函数,callback(Array<Cesium.Cartographic>) |
# some(promisesOrValues, howMany, onFulfilledopt, nullable, onRejectedopt, nullable, onProgressopt, nullable)
Initiates a competitive race, returning a promise that will resolve when howMany of the supplied promisesOrValues have resolved, or will reject when it becomes impossible for howMany to resolve, for example, when (promisesOrValues.length - howMany) + 1 input promises reject.
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
promisesOrValues |
Array | array of anything, may contain a mix of promises and values |
howMany |
number | number of promisesOrValues to resolve |
onFulfilled |
function | resolution handler |
onRejected |
function | rejection handler |
onProgress |
function | progress handler |
promise that will resolve to an array of howMany values that resolved first, or will reject with an array of (promisesOrValues.length - howMany) + 1 rejection reasons.
# toLabelClass(defaultLabelClass, text, overWrite, properties)
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
defaultLabelClass |
LabelClass | |
text |
* | |
overWrite |
LabelClass | null | 覆盖属性 |
properties |
要素属性 |
# when(promiseOrValue, onFulfilledopt, nullable, onRejectedopt, nullable, onProgressopt, nullable)
Register an observer for a promise or immediate value.
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
promiseOrValue |
* | |
onFulfilled |
function | callback to be called when promiseOrValue is successfully fulfilled. If promiseOrValue is an immediate value, callback will be invoked immediately. |
onRejected |
function | callback to be called when promiseOrValue is rejected. |
onProgress |
function | callback to be called when progress updates are issued for promiseOrValue. |
# zoomToM3DLayer(boundingSphere, options, innerView)
根据M3D的外包盒进行跳转
参数:
| 名称 | 类型 | 描述 |
|---|---|---|
boundingSphere |
Object | M3D的外包球 |
options |
Object | 跳转参数 |
innerView |
View | Cesium的View对象 |
