InfoQuery
在框选的范围内对指定图层进行信息查询
Example:
var infoQuery = KQ.Query.InfoQuery.getInstance();
var options = {
url: 'http://172.16.1.157:8699/KQGis/rest/services/zy',
layerId: 145,
reqcount: '200',
sr: '',
geometry: '{"type":"Polygon","coordinates":[[[104.94105475249448,29.97276304931208],[104.94105475249448,30.028839993667194],[105.00551176529433,30.028839993667194],[105.00551176529433,29.97276304931208],[104.94105475249448,29.97276304931208]]]}',
fields: 'OBJECTID,XZBM,BSM,YSDM,JXLX,JXXZ,JXSM,BGRQ',
f: 'json',
where: '',
};
infoQuery.queryAsync(options,
function query_good () {
console.log('query_good');
},
function query_error () {
console.log('query_error');
});
Static Method Summary
Static Public Methods | ||
public static |
获取实例对象 (单例模式) |
Method Summary
Public Methods | ||
public |
获取数据 |
|
public |
获取最后的错误信息 |
|
public |
服务器是否返回了错误 |
|
public |
queryAsync(options: Object, function_good: function(): null, function_error: function(): null): Promise<TResult> 在框选的范围内对指定图层进行信息查询 |
Public Methods
public queryAsync(options: Object, function_good: function(): null, function_error: function(): null): Promise<TResult> source
在框选的范围内对指定图层进行信息查询
Params:
Name | Type | Attribute | Description |
options | Object | 信息查询的配置参数 |
|
options.url | String | 服务器的url地址 |
|
options.startindex | Number | 请求返回结果的起始索引 |
|
options.layerId | String | 信息查询的图层ID |
|
options.reqcount | Number | 请求返回结果的最大记录数 |
|
options.geoSRS | String | 传入图形的空间参考 |
|
options.outSRS | String | 输出结果图形的空间参考 |
|
options.geometry | String | 查询范围的坐标 |
|
options.fields | String | 需要返回的字段,默认为返回所有字段 |
|
options.where | String | 查询条件,sql语句中的where子句 |
|
function_good | function(): null | 查询成功后执行的函数 |
|
function_error | function(): null | 查询失败后执行的函数 |