Reference Source
public class | source

InfoQuery

Query information of the specific layers in the particular range.

See:

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

Get instance object (Singleton mode)

Method Summary

Public Methods
public

data(): Object[]

Get data

public

Get last error message

public

Whether server return error

public

queryAsync(options: Object, function_good: function(): null, function_error: function(): null): Promise<TResult>

Query information from the server.

Static Public Methods

public static getInstance(): InfoQuery source

Get instance object (Singleton mode)

Return:

InfoQuery

Public Methods

public data(): Object[] source

Get data

Return:

Object[]

public errorMsg(): String source

Get last error message

Return:

String

public isLastError(): Boolean source

Whether server return error

Return:

Boolean

public queryAsync(options: Object, function_good: function(): null, function_error: function(): null): Promise<TResult> source

Query information from the server.

Params:

NameTypeAttributeDescription
options Object

query options

options.url String

Service url

options.startindex Number

Start index of result

options.layerId String

Layer id of querying

options.reqcount Number

Upper limit of result

options.geoSRS String

Reference system of the input coordinate

options.outSRS String

Reference system of the output coordinate

options.geometry String

The coordinates of the query range

options.fields String

fields for return, return all fields by default

options.where String

Query sql condition

function_good function(): null

The function will run after querying successfully.

function_error function(): null

The function will run after querying unsuccessfully.

Return:

Promise<TResult>