WMTSLayerOptions

WMTSLayer构造函数配置参数

interface WMTSLayerOptions {
    boundary?: string[];
    cacheSize?: number;
    dataType?: string;
    extent?: number[];
    extentCRSIsWGS84?: boolean;
    height?: number;
    maxZoom?: number;
    minZoom?: number;
    opacity?: number;
    params?: Record<string, string>;
    png8?: boolean;
    reproject?: boolean;
    reprojectSourceCRS?: string;
    retry?: boolean;
    retryTime?: number;
    spanLevel?: number;
    thumbChildDepth?: number;
    thumbParentDepth?: number;
    tileLoadFunction?: (tile: HTMLImageElement, url: string) => void;
    transform?: { source?: string; target?: string };
    url?: string;
    useThumbData?: boolean;
    xTemplate?: (x: number, y: number, z: number) => string | number;
    yTemplate?: (x: number, y: number, z: number) => string | number;
    zIndex?: number;
    zTemplate?: (x: number, y: number, z: number) => string | number;
}

属性

设置图层掩膜。可通过BMapGL.Boundary()获取行政区域的坐标数据

瓦片缓存数量

数据类型

设置图层加载数据的四至范围,输入的范围数值为EPSG:3857坐标[minX,minY,maxX,maxY]

标记参数extent数组数据是否为EPSG:4326坐标。如果设置为true,参数extent数值需要是EPSG:4326坐标,默认值:false

瓦片高度

设置图层显示的最大缩放等级

设置图层显示的最小缩放等级

图层透明度,取值范围0 - 1,默认值:1

WMTS请求参数,如Layer、Style、TileMatrixSet等。 默认包含:Service=WMTS, Request=GetTile, Version=1.0.0, Format=image/png, TileMatrixSet=GoogleMapsCompatible。 用户参数优先级高于默认值。 瓦片坐标参数TileMatrix/TileCol/TileRow可通过此参数自定义格式(如 'EPSG:3857:[z]'),默认使用 [z]/[x]/[y] 占位符。

是否使用PNG8格式,默认值:false

是否进行坐标重投影,默认值:false

重投影源坐标系

瓦片加载失败时是否重试,默认值:false

重试次数

跨层缩略瓦片的跨度等级

向下查找缩略瓦片的层数

向上查找缩略瓦片的层数

自定义瓦片加载函数

坐标系转换配置,source 为瓦片源坐标系,target 为目标坐标系

WMTS服务地址

缩放图层时,是否使用跨图层的瓦片进行平滑切换,默认值:false

通过输入的网格x、y、z参数计算[x]具体返回值

通过输入的网格x、y、z参数计算[y]具体返回值

图层层叠顺序

通过输入的网格x、y、z参数计算[z]具体返回值