Class: MapService

MapService

地图信息服务类。

new MapService(url, options)

Usage
// 浏览器
<script type="text/javascript" src="https://iclient.supermap.io/dist/leaflet/iclient-leaflet.js"></script>
<script>
  new L.supermap.MapService(url, options);
  
  // 弃用的写法
  L.supermap.mapService(url, options);
  
</script>

// ES6 Import
import { MapService } from '@supermap/iclient-leaflet';

new MapService(url, options);

leaflet/services/MapService.js, line 11
Name Type Description
url string

服务地址。

options Object

参数。

Name Type Default Description
proxy string 可选

服务代理地址。

withCredentials boolean false 可选

请求是否携带 cookie。

crossOrigin boolean 可选

是否允许跨域请求。

headers Object 可选

请求头。

Example
new MapService(url)
 .getMapInfo(function(result){
    //doSomething
})

Extends

Events

inherited destroy

leaflet/services/ServiceBase.js, line 52

资源释放成功后触发。

Properties:
Name Type Description
this ServiceBase

this 对象。

inherited initialized

leaflet/services/ServiceBase.js, line 39

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

Properties:
Name Type Description
this ServiceBase

this 对象。

Methods

inherited destroy()

leaflet/services/ServiceBase.js, line 47

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

getMapInfo(callback){Promise}

leaflet/services/MapService.js, line 46

获取地图信息。

Name Type Description
callback RequestCallback 可选

回调函数,该参数未传时可通过返回的 promise 获取结果。

Returns:
Type Description
Promise Promise 对象。

getTilesets(callback){Promise}

leaflet/services/MapService.js, line 83

获取切片列表信息。

Name Type Description
callback RequestCallback 可选

回调函数,该参数未传时可通过返回的 promise 获取结果。

Returns:
Type Description
Promise Promise 对象。

getWKT(callback){Promise}

leaflet/services/MapService.js, line 64

获取WKT。

Name Type Description
callback RequestCallback 可选

回调函数,该参数未传时可通过返回的 promise 获取结果。

Returns:
Type Description
Promise Promise 对象。