Class: FieldService

FieldService

字段服务类。提供方法:查询字段信息、查询字段统计信息等。

new FieldService(url, options)

Usage
import { FieldService } from '@supermapgis/iclient-mapboxgl';

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

数据服务地址,如 http://{ip}:{port}/iserver/services/data-world/rest/data 。

options Object

参数。

Name Type Description
proxy string 可选

服务代理地址。

withCredentials boolean 可选

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

crossOrigin boolean 可选

是否允许跨域请求。

headers Object 可选

请求头。

Example
new FieldService(url).getFields(function(result){
    //doSomething
});

Extends

FieldService -> ServiceBase

Events

inherited initialized

mapboxgl/services/ServiceBase.js, line 32

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

Properties:
Name Type Description
this Object

this 对象。

Methods

getFields(params, callback){Promise}

mapboxgl/services/FieldService.js, line 32

字段查询服务。

Name Type Description
params FieldParameters

字段信息查询参数类。

callback RequestCallback 可选

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

Returns:
Type Description
Promise Promise 对象。

getFieldStatisticsInfo(params, callback)

mapboxgl/services/FieldService.js, line 43

字段统计服务。

Name Type Description
params FieldStatisticsParameters

字段统计信息查询参数类。

callback RequestCallback

回调函数。