ImageryLayer 影像图层
影像图层用于加载和管理影像数据。
演练场
引入
ts
import { ImageryLayer } from "@m-tech/gis-core";
new ImageryLayer(options);入参
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| options | Object | - | 图层可选参数 |
| options.id | String | - | 图层唯一标识 |
| options.imageryProviderType | ImageryProviderType | - | 影像图层服务类型 |
| options.imageryOptions | Object | - | 图层服务参数 |
| options.imageryOptions.type | ImageryType | - | 影像图层类型 |
| options.imageryOptions.url | String | - | 影像图层服务地址 |
| options.imageryOptions.maximumLevel | number | - | 最大级别 |
| options.imageryOptions.minimumLevel | number | - | 最小级别 |
| options.imageryOptions.rectangle | Cesium.Rectangle | - | 矩形范围 |
属性
| 属性 | 类型 | 读/写 | 描述 |
|---|---|---|---|
| id | string | 读写 | 图层唯一标识 |
| show | boolean | 读写 | 图层是否可见 |
| attr | Object | 读写 | 自定义属性 |
示例
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);