new QueryService(url, options)
Usage
import { QueryService } from '@supermapgis/iclient-ol';
new QueryService(url, options);<script type="text/javascript" src="https://iclient.supermap.io/dist/openlayers/iclient-ol.js"></script>
<script>
new ol.supermap.QueryService({paramsNames});
</script>
openlayers/services/QueryService.js, line 11
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
string |
地图服务地址,如 http://{ip}:{port}/iserver/services/map-world/rest/maps/World 。 |
|||||||||||||||
options |
Object |
参数。
|
Example
new QueryService(url)
.queryByBounds(param,function(result){
//doSomething
})
Extends
QueryService
-> ServiceBase
-> ol.Observable
Methods
-
queryByBounds(params, callback, resultFormat){Promise}
openlayers/services/QueryService.js, line 38 -
范围查询。查询指定矩形范围内的要素,以及外接矩形与指定范围相交的几何对象。
Name Type Default Description paramsQueryByBoundsParameters 范围查询参数类。
callbackRequestCallback 可选 回调函数,该参数未传时可通过返回的 promise 获取结果。
resultFormatDataFormat DataFormat.GEOJSON 可选 返回结果类型。
Returns:
Type Description Promise Promise 对象。 -
queryByDistance(params, callback, resultFormat){Promise}
openlayers/services/QueryService.js, line 51 -
地图距离查询服务。
Name Type Default Description paramsQueryByDistanceParameters 距离查询参数类。
callbackRequestCallback 可选 回调函数,该参数未传时可通过返回的 promise 获取结果。
resultFormatDataFormat DataFormat.GEOJSON 可选 返回结果类型。
Returns:
Type Description Promise Promise 对象。 -
queryByGeometry(params, callback, resultFormat){Promise}
openlayers/services/QueryService.js, line 77 -
空间查询。查询与指定的几何对象符合某种空间关系和查询条件的要素。
Name Type Default Description paramsQueryByGeometryParameters 空间查询参数类。
callbackRequestCallback 可选 回调函数,该参数未传时可通过返回的 promise 获取结果。
resultFormatDataFormat DataFormat.GEOJSON 可选 返回结果类型。
Returns:
Type Description Promise Promise 对象。 -
queryBySQL(params, callback, resultFormat){Promise}
openlayers/services/QueryService.js, line 64 -
地图 SQL 查询服务。
Name Type Default Description paramsQueryBySQLParameters SQL 查询参数类。
callbackRequestCallback 可选 回调函数,该参数未传时可通过返回的 promise 获取结果。
resultFormatDataFormat DataFormat.GEOJSON 可选 返回结果类型。
Returns:
Type Description Promise Promise 对象。