L.KQMap.Mapping.WMSLayer(url, options)
leaflet/mapping/TileLayer.WMS.js, line 10
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
string |
wms 服务地址。 |
||||||||||||||||||||||||
options |
Object |
wms 图层可选参数。
|
Example
var url = "http://172.16.1.155:8699/KQGis/rest/services/jiyuan/MapServer/WMS";
// 设置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])
})
});
// 添加wms图层
L.kqmap.mapping.wmsLayer(url,
{
layers: 1,
style: "default",
}
).addTo(map);
Extends
- L.TileLayer.WMS
Methods
-
getTileUrl(coords){string}
leaflet/mapping/TileLayer.WMS.js, line 62 -
根据行列号获取瓦片的地址。
Name Type Description coords
Object 行列号。
Returns:
Type Description string 瓦片的地址。