Class: measureService

L.supermap.measureService

量算服务类。

L.supermap.measureService(url, options)

leaflet/services/MeasureService.js, line 10
Name Type Description
url string

服务访问的地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World。

options Object

参数。

Name Type Default Description
proxy string 可选

服务代理地址。

serverType SuperMap.ServerType SuperMap.ServerType.ISERVER 可选

服务来源 iServer|iPortal|online。

withCredentials boolean false 可选

请求是否携带 cookie。

Example
用法:
L.supermap.measureService(url).measureDistance({
    geometry:xxx
},function(result){
    //doSomething
})

Extends

Events

inherited destroy

leaflet/services/ServiceBase.js, line 51

资源释放成功后触发。

Properties:
Name Type Description
this L.supermap.ServiceBase

this 对象。

inherited initialized

leaflet/services/ServiceBase.js, line 38

构造函数构造成功后触发。

Properties:
Name Type Description
this L.supermap.ServiceBase

this 对象。

Methods

L.supermap.measureService.measure(type, params, callback)

leaflet/services/MeasureService.js, line 57
Name Type Default Description
type SuperMap.MeasureMode SuperMap.MeasureMode.DISTANCE 可选

量算模式。

params SuperMap.MeasureParameters

测量相关参数类。

callback RequestCallback

回调函数。

inherited destroy()

leaflet/services/ServiceBase.js, line 46

释放资源,将引用的资源属性置空。

measureArea(params, callback)

leaflet/services/MeasureService.js, line 46

测面积。

Name Type Description
params SuperMap.MeasureParameters

测量相关参数类。

callback RequestCallback

回调函数。

measureDistance(params, callback)

leaflet/services/MeasureService.js, line 35

测距。

Name Type Description
params SuperMap.MeasureParameters

测量相关参数类。

callback RequestCallback

回调函数。