Class: AddressMatchService

AddressMatchService

地址匹配服务类。此类提供了地址的正向匹配和反向匹配功能,正向匹配即通过地点名称关键词查找地址位置,反向匹配即根据位置坐标查询地点。

new AddressMatchService(url, options)

Usage
import { AddressMatchService } from '@supermapgis/iclient-leaflet';

new AddressMatchService(url, options);
<script type="text/javascript" src="https://iclient.supermap.io/dist/leaflet/iclient-leaflet.js"></script>
<script>
  new L.supermap.AddressMatchService({paramsNames});
  // 弃用的写法

  L.supermap.addressMatchService(url, options);
</script>
leaflet/services/AddressMatchService.js, line 8
Name Type Description
url string

地址匹配服务地址,如 http://{ip}:{port}/iserver/services/addressmatch-Address/restjsr/v1/address 。

options Object

参数。

Name Type Description
proxy string 可选

服务代理地址。

withCredentials boolean 可选

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

crossOrigin boolean 可选

是否允许跨域请求。

headers Object 可选

请求头。

Example
new AddressMatchService(url,options)
     .code(function(result){
         //doSomething
     })

Extends

AddressMatchService -> ServiceBase -> L.Evented

Events

inherited destroy

leaflet/services/ServiceBase.js, line 58

资源释放成功后触发。

Properties:
Name Type Description
this ServiceBase

this 对象。

inherited initialized

leaflet/services/ServiceBase.js, line 45

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

Properties:
Name Type Description
this ServiceBase

this 对象。

Methods

code(params, callback){Promise}

leaflet/services/AddressMatchService.js, line 42

获取正向地址匹配结果。

Name Type Description
params GeoCodingParameter

正向匹配参数。

callback RequestCallback 可选

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

Returns:
Type Description
Promise Promise 对象。

decode(params, callback){Promise}

leaflet/services/AddressMatchService.js, line 53

获取反向地址匹配结果。

Name Type Description
params GeoDecodingParameter

反向匹配参数。

callback RequestCallback 可选

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

Returns:
Type Description
Promise Promise 对象。

inherited destroy()

leaflet/services/ServiceBase.js, line 53

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