Skip to content

ImageryLayer 影像图层

影像图层用于加载和管理影像数据。

演练场

引入

ts
import { ImageryLayer } from "@m-tech/gis-core";

new ImageryLayer(options);

入参

参数类型默认值描述
optionsObject-图层可选参数
options.idString-图层唯一标识
options.imageryProviderTypeImageryProviderType-影像图层服务类型
options.imageryOptionsObject-图层服务参数
options.imageryOptions.typeImageryType-影像图层类型
options.imageryOptions.urlString-影像图层服务地址
options.imageryOptions.maximumLevelnumber-最大级别
options.imageryOptions.minimumLevelnumber-最小级别
options.imageryOptions.rectangleCesium.Rectangle-矩形范围

属性

属性类型读/写描述
idstring读写图层唯一标识
showboolean读写图层是否可见
attrObject读写自定义属性

示例

ts
import {
  ImageryLayer,
  ImageryProviderType,
  ImageryType,
} from "@m-tech/gis-core";

// 加载公网地图供应商影像
new ImageryLayer({
  imageryProviderType: ImageryProviderType.TMap, // 天地图
  imageryOptions: {
    type: ImageryType.IMG_C, // 卫星影像图层
  },
}).addToViewer(viewer);

// 加载离线影像
const layer = new ImageryLayer({
  imageryProviderType: ImageryProviderType.XYZ,
  imageryOptions: {
    url: "http://localhost:8888/tiles/{z}/{x}/{y}.png",
    maximumLevel: 18,
    minimumLevel: 1,
  },
});
layer.addToViewer(viewer);

MGis 地理三维库