@poor-knight/cesium-utils 0.5.5 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,6 +10,7 @@ import { Point } from 'geojson';
10
10
  import { Popup } from 'cesium-extends';
11
11
  import { Viewer } from 'cesium';
12
12
  import { WebMapServiceImageryProvider } from 'cesium';
13
+ import { WebMapTileServiceImageryProvider } from 'cesium';
13
14
 
14
15
  declare type Cartesian3Like = Cesium.Cartesian3 | {
15
16
  x: number;
@@ -350,4 +351,72 @@ export declare class WmsLayerController extends EventEmitter<{
350
351
  private destroyHandler;
351
352
  }
352
353
 
354
+ declare interface WmtsCapabilities {
355
+ Capabilities: {
356
+ Contents: {
357
+ Layer: {
358
+ Format: string[];
359
+ InfoFormat: string[];
360
+ Style: {
361
+ 'ows:Identifier': string;
362
+ };
363
+ TileMatrixSetLink: {
364
+ TileMatrixSet: string;
365
+ TileMatrixSetLimits: {
366
+ TileMatrixLimits: {
367
+ TileMatrix: number;
368
+ MinTileRow: number;
369
+ MaxTileRow: number;
370
+ MinTileCol: number;
371
+ MaxTileCol: number;
372
+ }[];
373
+ };
374
+ }[];
375
+ 'ows:Identifier': string;
376
+ 'ows:WGS84BoundingBox': {
377
+ 'ows:LowerCorner': string;
378
+ 'ows:UpperCorner': string;
379
+ };
380
+ }[];
381
+ };
382
+ };
383
+ }
384
+
385
+ /**
386
+ * WMTS 图层
387
+ * 使用 Cesium 的 WebMapTileServiceImageryProvider 创建并管理多个 WMTS 影像图层,
388
+ * 通过 key 与 zIndex 控制显隐与叠加顺序。
389
+ */
390
+ export declare class WmtsLayer implements Layer {
391
+ private ctrl;
392
+ key: string;
393
+ options: Partial<WebMapTileServiceImageryProvider.ConstructorOptions> & Pick<WebMapTileServiceImageryProvider.ConstructorOptions, 'layer'>;
394
+ /** 图层的层级,数值越小,图层越靠下,仅在同一 WmtsLayerController 实例范围内生效 */
395
+ zIndex: number;
396
+ constructor(ctrl: WmtsLayerController, key: string, options: Partial<WebMapTileServiceImageryProvider.ConstructorOptions> & Pick<WebMapTileServiceImageryProvider.ConstructorOptions, 'layer'>,
397
+ /** 图层的层级,数值越小,图层越靠下,仅在同一 WmtsLayerController 实例范围内生效 */
398
+ zIndex?: number);
399
+ show(viewer: Viewer): void;
400
+ hide(viewer: Viewer): void;
401
+ }
402
+
403
+ /** WMTS 图层控制器 */
404
+ export declare class WmtsLayerController extends EventEmitter<'init' | 'initFail'> {
405
+ /** 不包含 layer 与 style 的基础构造参数,由每个 WmtsLayer 实例提供其自身的 layer 与 style */
406
+ private args;
407
+ Capabilities?: WmtsCapabilities;
408
+ ready: Promise<void>;
409
+ constructor(
410
+ /** 不包含 layer 与 style 的基础构造参数,由每个 WmtsLayer 实例提供其自身的 layer 与 style */
411
+ args: Omit<WebMapTileServiceImageryProvider.ConstructorOptions, 'layer' | 'style'>);
412
+ private layerMap;
413
+ private showLayers;
414
+ private imgLayerMap;
415
+ registerLayer(layer: WmtsLayer): void;
416
+ showLayer(viewer: Viewer, key: string): void;
417
+ hideLayer(viewer: Viewer, key: string): void;
418
+ /** 根据 showLayers 刷新 WMTS 图层叠加顺序 */
419
+ private update;
420
+ }
421
+
353
422
  export { }