查阅Cesium API

创建添加影像图层。

参数描述:
名称 类型 描述
Viewer Viewer Cesium的viewer对象。
Author:
  • 金磊、张丹钊、张恒、薛鹏

方法

加载ArcGis影像图层

createArcGisImageryLayer(name, option, GroupID, index, checked, disFnc)ImageryLayer

调用方法:
var dx = {
        url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",
        enablePickFeatures: false
    };
    sgworld.Creator.createArcGisImageryLayer("ARCGIS", dx, "0", undefined, true, "");
参数描述:
名称 类型 描述
name String 名称
option Object 参数
名称 类型 默认值 描述
id String 可选 id
url String 地址
alpha Number 1 可选 透明度
Level String | Number 可选 显示级别,如18,或"5,18"
usePreCachedTilesIfAvailable Boolean 可选 是否使用服务的内置的切片方案,偏移纠正需要使用如下自定义的方案
tilingScheme Cesium.TilingScheme 可选 切片方式
GroupID String 可选 父节点id
index Number 可选 影像优先级
checked Boolean 是否勾选
disFnc function 可选 回调函数
返回:
返回ImageryLayer对象
全球格网

createImageryLayerGrid(option)ImageryLayer

调用方法:
sgworld.Creator.createImageryLayerGrid();
参数描述:
名称 类型 描述
option Cesium.GridImageryProvider.ConstructorOptions 可选 参数
返回:
加载影像图层

createImageryProvider(name, type, option, GroupID, index, checked, disFnc)ImageryLayer

调用方法:
sgworld.Creator.createImageryProvider("百度", "BaiduMap", {}, "0", undefined, true, "");
参数描述:
名称 类型 描述
name String 名称
type String 类型【arcgis|geoserver|wms|cesiumBlack|tms|skymap|goglemap|BingMap|OpenStreetMap|MapBox|BaiduMap】
option Object 参数
名称 类型 默认值 描述
id String 可选 id
url String 可选 地址
alpha Number 1 可选 透明度
Level String | Number 可选 显示级别,如18,或"5,18""
GroupID String 可选 父节点id
index Number 可选 影像优先级
checked Boolean 是否勾选
disFnc function 可选 回调函数
返回:
返回ImageryLayer对象
加载矢量

createMVTWithStyle(对象)

参数描述:
名称 类型 描述
对象 object
添加天地图

createPolylineImageryProviderer(b)

参数描述:
名称 类型 描述
b bollean true|false
创建指定的URL模板的影像图层

createUrlTemplateImageryProvider(name, option, GroupID, index, checked, disFnc)ImageryLayer

调用方法:
var urls = "http://183.162.245.49:3301/gisserver/tmsserver/earth_tms"
    layer = sgworld.Creator.createUrlTemplateImageryProvider('tms服务', {
        url: urls + "/{z}/{x}/{reverseY}.jpeg",
    }, '0', undefined, true, "");
参数描述:
名称 类型 描述
name String 名称
option Object | Cesium.UrlTemplateImageryProvider.ConstructorOptions 参数
名称 类型 默认值 描述
id String 可选 id
url String 地址
alpha Number 1 可选 透明度
tilingScheme Cesium.TilingScheme 可选 切片方式
Level String | Number 可选 显示级别,如18,或"5,18""
GroupID String 可选
index Number 可选 影像优先级
checked Boolean 是否勾选
disFnc function 可选 回调函数
返回:
返回ImageryLayer对象
创建imagelayer图层

createWebMapServerImageLayer(name, option, GroupID, Description)

参数描述:
名称 类型 描述
name String
option object | String { url: "", //Resource | String The URL of the WMS service. The URL supports the same keywords as the UrlTemplateImageryProvider. layers: "", //The layers to include, separated by commas. parameters: { service: 'WMS', format: 'image/png', transparent: true, },// Object WebMapServiceImageryProvider.DefaultParameters optional Additional parameters to pass to the WMS server in the GetMap URL. //getFeatureInfoParameters Object WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters optional Additional parameters to pass to the WMS server in the GetFeatureInfo URL. enablePickFeatures: true,// optional If true, WebMapServiceImageryProvider#pickFeatures will invoke the GetFeatureInfo operation on the WMS server and return the features included in the response. If false, WebMapServiceImageryProvider#pickFeatures will immediately return undefined (indicating no pickable features) without communicating with the server. Set this property to false if you know your WMS server does not support GetFeatureInfo or if you don't want this provider's features to be pickable. Note that this can be dynamically overridden by modifying the WebMapServiceImageryProvider#enablePickFeatures property. //getFeatureInfoFormats Array. WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats optional The formats in which to try WMS GetFeatureInfo requests. rectangle: this._cesium.Rectangle.MAX_VALUE,// optional The rectangle of the layer. //tilingScheme : new this._cesium.GeographicTilingScheme(),// optional The tiling scheme to use to divide the world into tiles. //ellipsoid Ellipsoid optional The ellipsoid. If the tilingScheme is specified, this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither parameter is specified, the WGS84 ellipsoid is used. tileWidth: 256,// optional The width of each tile in pixels. tileHeight: 256,// optional The height of each tile in pixels. minimumLevel: 0,// optional The minimum level-of-detail supported by the imagery provider. Take care when specifying this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely to result in rendering problems. maximumLevel: undefined,// optional The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. If not specified, there is no limit. crs: "",// optional CRS specification, for use with WMS specification >= 1.3.0. srs: "",// optional SRS specification, for use with WMS specification 1.1.0 or 1.1.1 credit: "", //optional A credit for the data source, which is displayed on the canvas. subdomains: "",// | Array. 'abc' optional The subdomains to use for the {s} placeholder in the URL template. If this parameter is a single string, each character in the string is a subdomain. If it is an array, each element in the array is a subdomain. //clock Clock optional A Clock instance that is used when determining the value for the time dimension. Required when options.times is specified. //times TimeIntervalCollection optional TimeIntervalCollection with its data property being an object containing time dynamic dimension and their values. }
GroupID String
Description String
创建WMTS影像图层

createWebMapTileServerImageLayer(name, option, GroupID, index, checked, disFnc)ImageryLayer

调用方法:
let dx = {
        url: 'http://183.162.245.49:8099/geoserver/gwc/service/wmts?layer=topp:states&TileMatrixSet={TileMatrixSet}&TileMatrix={TileMatrixSet}:{TileMatrix}&&TileRow={TileRow}&TileCol={TileCol}&format=image/png&request=GetTile',
        tileMatrixSetID: 'EPSG:4326',
        tilingScheme: new Cesium.GeographicTilingScheme()
    };
    var imageProvider = sgworld.Creator.createWebMapTileServerImageLayer("Geoserver-WMTS", dx, "0", undefined, true, "");
参数描述:
名称 类型 描述
name String 名称
option Object | Cesium.WebMapTileServiceImageryProvider.ConstructorOptions 参数
名称 类型 默认值 描述
id String 可选 id
url String 地址
alpha Number 1 可选 透明度
tilingScheme Cesium.TilingScheme 可选 切片方式
Level String | Number 可选 显示级别,如18,或"5,18""
GroupID String 可选
index Number 可选 影像优先级
checked Boolean 是否勾选
disFnc function 可选 回调函数
返回:
返回ImageryLayer对象
获取影像图层的显示与隐藏
Image导出工程数据
获取层级
获取影像图层的显示与隐藏

getVisibility()

设置影像图层的显示与隐藏

setVisibility(b)

参数描述:
名称 类型 描述
b bollean true|false