MapGISMapServerImageryProvider

new Cesium.MapGISMapServerImageryProvider(options, sceneIndex, layerIndex)

MapGIS地图文档
Name Type Default Description
options Object 包含以下属性
Name Type Description
url String 服务地址 eg:http://localhost:6163/igs/rest/mrms/docs/地图文档名
sceneIndex Number optional 三维地图文档图层所在场景索引,当加载三维地图文档时为必需参数
layerIndex Number optional 三维地图文档图层索引,当加载三维地图文档时为必需参数
options.httpMethod String optional Http请求方式,"GET"、"POST",默认为GET请求
options.headers Object optional HTTP请求头,传入方式见下方示例,请严格按照HTTP请求头属性填写,可传入请求方式为POST时的编码方式,默认方式为"text/plain",请注意IGS.NET版本服务目前只支持"text/plain"的编码方式
options.enablePickFeatures Boolean false optional 是否启用瓦片要素获取
options.tileWidth Number 256 optional 瓦片宽度
options.tileHeight Number 256 optional 瓦片高度
options.minimumLevel Number 0 optional 瓦片最小级别
options.maximumLevel Number 0 optional 瓦片最大级别
options.colNum Number 2 optional 瓦片初始级的列数 默认为2
options.rowNum Number 1 optional 瓦片初始级的列数 默认为1
options.gdbps Array optional gdbps地址数组
options.layers String optional layers参数,用于过滤图层
options.filters String optional 用户指定的图层过滤条件,它由多个键值对组成,值为过滤条件。1:ID>4,3:ID>1
options.tilingScheme Object optional 服务的平铺方案:经纬度GeographicTilingScheme,web墨卡托WebMercatorTilingScheme
options.mapgisOffset String optional 瓦片错级参数,默认为0
options.proxy String optional 转发代理
options.rectangle Object Rectangle.fromDegrees(-180, -90, 180, 90) optional 指定瓦片加载范围,默认Rectangle.fromDegrees(-180, -90, 180, 90),Rectangle
options.extensions Array optional 扩展参数,需要确保服务端支持
options.dynamicLayers Array optional 设置动态图层信息
options.build2DImageResource function optional 重载build2DImageResource方法,来重载瓦片的请求逻辑
Examples:
// options.headers 参数为HTTP请求头,请严格按照HTTP请求头属性填写
       var options = {
                         headers: {
                               'Content-Type': 'text/plain',
                               'Accept-Language': 'zh-cn,zh;q=0.5'
                            }
                     };
// options.extensions 参数为自定义扩展参数,需要确保服务端支持此类参数生效
       var options = {
                         extensions: [   { key: 'token', value: 'tokentokentokentoken' },
                                         { key: 'filters', value: '1:ID>4,3:ID>1' },
                                         { key: 'proj', value: 'Web墨卡托_WGS1984' }
                                     ]
                     };
       //二维地图文档加载
       var mapGIS2DLayer = viewer.scene.layers.appendImageryLayer('http://localhost:6163/igs/rest/mrms/docs/二维矢量',otherOptions);
       //三维地图文档加载
       var mapGIS3DLayer = viewer.scene.layers.appendImageryLayer('http://54.222.218.173:6163/igs/rest/g3d/lcmap/',0,0,otherOptions);

Methods

getTileCredits(x, y, level)Object

Name Type Description
x Number
y Number
level Number
Returns:
凭证对象(暂时不需要)

pickFeatures(imageryProvider, x, y, level, longitude, latitude)Object

获取瓦片内要素
Name Type Description
imageryProvider Object
x Number
y Number
level Number
longitude Number
latitude Number
Returns:
瓦片内要素的JSON对象

requestImage(imageryProvider, x, y, level, request)Object

请求瓦片
Name Type Description
imageryProvider Object
x Number
y Number
level Number
request Object
Returns:
瓦片的Resource对象