Skip to content

Commit fcbc1fe

Browse files
committed
支持图层过滤
1 parent 42762c1 commit fcbc1fe

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/cesiumjs/layer/TilesLayer.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ export default class TilesLayer extends BaseLayer {
7373
* @param {Number} [optionsParam.rowNum=1] 瓦片初始级的列数 默认为1
7474
* @param {Number} [optionsParam.maxLevel=19] 瓦片最大显示级数 默认为19
7575
* @param {String} [optionsParam.proxy] 转发代理
76+
* @param {Array} [options.gdbps] gdbps地址数组
77+
* @param {String} [options.layers] layers参数,用于过滤图层
78+
*
7679
* @returns {ImageryLayer} 瓦片对象
7780
* @example
7881
* 如果裁瓦片的时候是按照经纬度裁剪的瓦片则只设置最大级数即可
@@ -91,6 +94,12 @@ export default class TilesLayer extends BaseLayer {
9194
append2DDocTile(url, optionsParam) {
9295
// 中地新版正常二维瓦片
9396
const options = Cesium.defaultValue(optionsParam, {});
97+
98+
if (Cesium.defined(options.gdbps) && Cesium.defined(options.layers)) {
99+
// eslint-disable-next-line no-console
100+
console.log('不能同时定义 gdbps 和 layers');
101+
}
102+
94103
options.url = url;
95104
const mapGis2DDocTile = this.viewer.imageryLayers.addImageryProvider(new Cesium.MapGIS2DDocMapProvider(options));
96105
return mapGis2DDocTile;

0 commit comments

Comments
 (0)