ScaleWMTSLayer
Extends:
L.TileLayer → ScaleWMTSLayer
Example:
var url = "http://127.0.0.1:8699/KQGis/rest/services/china3857google/MapServer/WMTS";
// 设置resolutions
var res = [];
for (var i = 0; i < 22; i++) {
res.push(156543.03392828687 / (Math.pow(2, i)));
}
var crs = new L.Proj.CRS("EPSG:3857",
{
origin: [-20037508.342787, 20037508.342787],
resolutions: res,
bounds: L.bounds([-20037508.342787, -20037508.342787], [20037508.342787, 20037508.342787])
});
// 初始化地图
var map = L.map('map', {
center: [30.47, 114.34],
zoom: 4,
maxZoom: 22,
crs: crs
});
L.kqmap.mapping.scaleWMTSLayer('http://127.0.0.1:8699/KQGis/rest/services/china3857custom2/MapServer/WMTS', {
scales: [400000000.00000000,200000000.00000000,100000000.00000000,50000000.00000000,25000000.00000000,12500000.00000000,6250000.00000000,3125000.00000000,1562500.00000000,781250.00000000,195312.50000000,97656.25000000,48828.12500000,24414.06250000,12207.03125000,6103.51562500,3051.75781300],
layer: 1,
tilematrixSet: 'GoogleMapsCompatible',
opacity: 0.5
}).addTo(map);
Constructor Summary
Public Constructor | ||
public |
|
Method Summary
Public Methods | ||
public |
addToMapView(mapview: MapView): Null 添加到mapview |
|
public |
createTile(coords: *, done: *): * |
|
public |
getTileUrl(tilesInfo: *, tileIndex: *): * |
|
public |
removeFromMapView(): Null 从地图中移除 |
|
public |
toString(): * |
Public Constructors
public constructor() source
Public Methods
public addToMapView(mapview: MapView): Null source
添加到mapview
Params:
Name | Type | Attribute | Description |
mapview | MapView | mapview对象 |
Return:
Null |
public createTile(coords: *, done: *): * source
Params:
Name | Type | Attribute | Description |
coords | * | ||
done | * |
Return:
* |
public getTileUrl(tilesInfo: *, tileIndex: *): * source
Params:
Name | Type | Attribute | Description |
tilesInfo | * | ||
tileIndex | * |
Return:
* |