Class: WMTSLayer

WMTSLayer

wmts 图层类。

L.KQMap.Mapping.WMTSLayer(url, options, maxZoom)

leaflet/mapping/TileLayer.WMTS.js, line 10
Name Type Default Description
url string

wmts 服务地址。

options Object

wmts 图层可选参数。

Name Type Description
layer string

图层名称。

style Object 可选

图层样式。

maxZoom Number

图层最大的比例尺。

options.format string 'image/png' 可选

wmts 图像格式。

options.tileSize number | L.Point '256' 可选

瓦片大小。

options.tilematrixSet Object 可选

瓦片矩阵集。

options.version string '1.0.0' 可选

版本信息。

options.attribution string 可选

版权信息。

Example
var url = "http://127.0.0.1:8699/KQGis/rest/services/jiyuan1/MapServer/WMTS";

 // 设置resolutions
 var res = [];
 for (var i = 0; i < 18; i++) {
    res.push(156542.726903 / (Math.pow(2, i)));
  }

 // 初始化地图
 var map = L.map('map', {
    center: [35.09, 112.39],
    zoom: 11,
    crs: new L.Proj.CRS("EPSG:3857",
        {
          origin: [-2.0037508342789244E7, 2.0037508342789244E7],
          resolutions: res,
          bounds: L.bounds([-2.0037508342789244E7, -2.0037508342789244E7], [2.0037508342789244E7, 2.0037508342789244E7])
        })
  });

 // 添加wmts图层
 L.kqmap.mapping.wmtsLayer(url,
 {
   layer: 1,
   style: "default",
   tilematrixSet: "default028mm",
   format: "image/png",
 }
 ).addTo(map);

Extends

Methods

getTileUrl(coords){string}

leaflet/mapping/TileLayer.WMTS.js, line 73

根据行列号获取瓦片的地址。

Name Type Description
coords Object

行列号。

Returns:
Type Description
string 瓦片的地址。