类名 MapGISMapServerSingleImageryProvider

# new MapGISMapServerSingleImageryProvider(options)

IGS地图服务一张图出图接入类

参数:

名称 类型 默认值 描述
options Object

初始化时的构造参数

viewer Cesium.Viewer

cesium视图对象

url Cesium.Resource | String null

服务的基地址,支持url字符串和Cesium.Resource两种类型,当类型为Cesium.Resource时,支持传入额外请求参数、请求头参数等,具体请参考Cesium.Resource
格式如下:
1、动态出图:
1.1、IGS1.0服务基地址: http://{ip}:{port}/igs/rest/mrms/docs/{folder}:{serviceName}
1.2、IGS2.0服务基地址: http://{ip}:{port}/igs/rest/services/{folder}/{serviceName}/MapServer
2、场景覆盖物图层:
2.1、IGS1.0服务基地址: http://{ip}:{port}/igs/rest/g3d/{folder}:{serviceName}
2.2、IGS2.0服务基地址: http://{ip}:{port}/igs/rest/services/{folder}/{serviceName}/SceneServer
3、gdbp出图:
3.1、IGS1.0服务基地址: http://{ip}:{port}/igs/rest/mrms/layers 3.2、IGS2.0服务基地址: http://{ip}:{port}/igs/rest/services/system/ResourceServer

layers String null

要显示的子图层id,多个子图层以逗号分隔,'layer1,layer2,...',如果要显示所有层,则请传一个空字符串

tilingScheme Cesium.TilingScheme | CustomTilingScheme Cesium.GeographicTilingScheme

瓦片的平铺方案,详见Cesium.TilingScheme

rectangle Cesium.Rectangle Cesium.Rectangle.MAX_VALUE

地图图层显示范围,超出范围不会额外请求瓦片,详见Cesium.Rectangle

spatialReference SpatialReference new SpatialReference({ wkid: 4326 })

图层空间参考系

httpMethod String 'GET'

HTTP请求方式,"GET"、"POST",默认为GET请求

minimumLevel number 0

图层最小请求瓦片级别,小于该级别不再请求瓦片

maximumLevel number 20

图层最大请求瓦片级别,大于该级别不再请求瓦片

gdbps Array []

gdbps地址数组

filters String null

用户指定的图层过滤条件,它由多个键值对组成,值为过滤条件

proxy String null

转发代理

dynamicLayers String null

动态图层信息

build2DImageResource function null

重载build2DImageResource方法,来重载瓦片的请求逻辑

clientId String getGUID()

客户端id,用户的唯一标识;在地图服务中,调用接口时如果修改了地图的状态,包括设置动态投影、设置图层显示隐藏等,为了提升并发性能,服务端会根据clientId来生成临时地图,最佳做法是一个浏览器生成一个固定的唯一值;建议普通用户不要传该参数,webclient会根据当前浏览器生成一个固定的唯一值

isAntialiasing Boolean | undefined null

返回的图片时,是否开启服务端抗锯齿功能;启用抗锯齿功能后,显示效果会更清晰,但会导致出图速度变慢,true表示开启抗锯齿,false表示关闭抗锯齿,如果没有设置,则默认应用地图文档(MapX)上的设置参数

layerIndex String 0

场景服务-覆盖物出图时指定的图层下标

方法

# async fromUrl(url, options)

参数:

名称 类型 描述
url Cesium.Resource | String

服务的基地址,支持url字符串和Cesium.Resource两种类型,当类型为Cesium.Resource时,支持传入额外请求参数、请求头参数等,具体请参考Cesium.Resource

options Object

实例化对象时提供的额外配置参数,若该对象中包含构造参数则会覆盖对应的构造参数

初始化完毕的MapGISMapServerSingleImageryProvider对象

zondy.cesium.MapGISMapServerSingleImageryProvider
示例

通过ArcGIS地图服务的url获取MapGISMapServerSingleImageryProvider对象

// ES5引入方式
const { MapGISMapServerSingleImageryProvider } = zondy.cesium
// ES6引入方式
import { MapGISMapServerSingleImageryProvider } from "@mapgis/webclient-cesium-plugin"

const url = 'http://webclient.smaryun.com:8089/igs/rest/services/Map/湖北省4326/MapServer'
const addImageryProvider = async (url) => {
  const imageryProvider = await MapGISMapServerSingleImageryProvider.fromUrl(url)
  viewer.imageryLayers.addImageryProvider(imageryProvider)
}
addImageryProvider(url)
构造函数
成员变量
方法
事件