Class: MapService

MapService

地图信息服务类。通过该类可以获得地图的基本信息、投影信息、切片列表信息等等。

new MapService(url, options)

Usage
import { MapService } from '@supermapgis/iclient-ol';

new MapService(url, options);
<script type="text/javascript" src="https://iclient.supermap.io/dist/openlayers/iclient-ol.js"></script>
<script>
  new ol.supermap.MapService({paramsNames});
</script>
openlayers/services/MapService.js, line 8
Name Type Description
url string

地图服务地址,如 http://{ip}:{port}/iserver/services/map-world/rest/maps/World 。

options Object

参数。

Name Type Description
proxy string 可选

服务代理地址。

withCredentials boolean 可选

请求是否携带凭据。默认情况下,仅同源请求包含凭据。

crossOrigin boolean 可选

是否允许跨域请求。

headers Object 可选

请求头。

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

API Relations

Returned by: createMapService , MapService.getTilesets.

Extends

MapService -> ServiceBase -> ol.Observable

Methods

getMapInfo(callback){Promise}

openlayers/services/MapService.js, line 31

地图信息查询服务。

Name Type Description
callback RequestCallback 可选

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

Returns:
Type Description
Promise Promise 对象。

getTilesets(callback){MapService}

openlayers/services/MapService.js, line 68

切片列表信息查询服务。

Name Type Description
callback RequestCallback 可选

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

Returns:
Name Type Description
获取服务信息。 MapService
Promise Promise 对象。

getWKT(callback){Promise}

openlayers/services/MapService.js, line 49

获取WKT。

Name Type Description
callback RequestCallback 可选

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

Returns:
Type Description
Promise Promise 对象。