Class: ChartService

ChartService

海图服务类。海图是一种以海洋水域及沿岸地物为主要绘制对象的地图,为航海的安全性提供必备的数据基础。
此类提供方法:获取海图物标信息、查询海图服务。海图物标信息指的是描述各产品规范的物标的基本信息,包括物标的名称、类型及与该物标相关的属性等。

new ChartService(url, options)

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

// ES6 Import
import { ChartService } from '@supermapgis/iclient-leaflet';

new ChartService(url, options);

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

服务地址。

options Object

参数。

Name Type Default Description
proxy string 可选

服务代理地址。

withCredentials boolean false 可选

请求是否携带 cookie。

crossOrigin boolean 可选

是否允许跨域请求。

headers Object 可选

请求头。

fieldNameFormatter function 可选

对查询返回结果的字段名进行自定义。

Example
new ChartService(url,{
   fieldNameFormatter: function(fieldName){
     return fieldName + 'test'
   }
}).queryChart(param,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

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

getChartAcronymClassify(callback){Promise}

leaflet/services/ChartService.js, line 65

获取海图产品规范物标分组信息服务。

Name Type Description
callback RequestCallback 可选

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

Version:
  • 11.2.0
Returns:
Type Description
Promise Promise 对象。

getChartFeatureInfo(callback){Promise}

leaflet/services/ChartService.js, line 55

获取海图物标信息。

Name Type Description
callback RequestCallback 可选

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

Returns:
Type Description
Promise Promise 对象。

queryChart(params, callback, resultFormat){Promise}

leaflet/services/ChartService.js, line 42

查询海图服务。

Name Type Default Description
params ChartQueryParameters

海图查询参数类。

callback RequestCallback 可选

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

resultFormat DataFormat DataFormat.GEOJSON 可选

返回结果类型。

Returns:
Type Description
Promise Promise 对象。