new LayerInfoService(url, options)
Usage
import { LayerInfoService } from '@supermapgis/iclient-leaflet';
new LayerInfoService(url, options);<script type="text/javascript" src="https://iclient.supermap.io/dist/leaflet/iclient-leaflet.js"></script>
<script>
new L.supermap.LayerInfoService({paramsNames});
// 弃用的写法
L.supermap.layerInfoService(url, options);
</script>
leaflet/services/LayerInfoService.js, line 8
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
string |
地图服务地址,如 http://{ip}:{port}/iserver/services/map-world/rest/maps/World 。 |
|||||||||||||||
options |
Object |
参数。
|
Example
new LayerInfoService(url).getLayersInfo(function(result){
//doSomething
})
Extends
LayerInfoService
-> ServiceBase
-> L.Evented
Events
-
inherited destroy
leaflet/services/ServiceBase.js, line 58 -
资源释放成功后触发。
Properties:
Name Type Description thisServiceBase this 对象。
-
inherited initialized
leaflet/services/ServiceBase.js, line 45 -
构造函数构造成功后触发。
Properties:
Name Type Description thisServiceBase this 对象。
Methods
-
inherited destroy()
leaflet/services/ServiceBase.js, line 53 -
释放资源,将引用的资源属性置空。
-
getLayersInfo(callback){Promise}
leaflet/services/LayerInfoService.js, line 34 -
获取图层信息。
Name Type Description callbackRequestCallback 可选 回调函数,该参数未传时可通过返回的 promise 获取结果。
Returns:
Type Description Promise Promise 对象。 -
getLayersLegendInfo(callback){Promise}
leaflet/services/LayerInfoService.js, line 44 -
获取地图的图例信息。
Name Type Description callbackRequestCallback 可选 回调函数,该参数未传时可通过返回的 promise 获取结果。
- Version:
- 11.1.1
Returns:
Type Description Promise Promise 对象。 -
setLayerInfo(params, callback){Promise}
leaflet/services/LayerInfoService.js, line 55 -
设置图层信息服务。可以实现临时图层中子图层的修改。
Name Type Description paramsSetLayerInfoParameters 设置图层信息参数类。
callbackRequestCallback 可选 回调函数,该参数未传时可通过返回的 promise 获取结果。
Returns:
Type Description Promise Promise 对象。 -
setLayersInfo(params, callback){Promise}
leaflet/services/LayerInfoService.js, line 67 -
设置图层信息。可以实现创建新的临时图层和修改现有的临时图层。
Name Type Description paramsSetLayersInfoParameters 设置图层信息参数类。
callbackRequestCallback 可选 回调函数,该参数未传时可通过返回的 promise 获取结果。
Returns:
Type Description Promise Promise 对象。 -
setLayerStatus(params, callback){Promise}
leaflet/services/LayerInfoService.js, line 79 -
负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
Name Type Description paramsSetLayerStatusParameters 子图层显示控制参数类。
callbackRequestCallback 可选 回调函数,该参数未传时可通过返回的 promise 获取结果。
Returns:
Type Description Promise Promise 对象。