import OverlayAnalysis from 'kqwebmap-project/src_en/query/OverlayAnalysis.js'
OverlayAnalysis
Overlay analysis of the specific layers from the server.
Example:
var overlay_analysis = KQ.Query.OverlayAnalysis.getInstance();
console.log(overlay_analysis);
try {
var options = {
url: 'http://172.16.1.157:8699/KQGis/rest/services/zy',
layerId: 145,
pageSize: '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: '',
};
overlay_analysis.queryAsync(options,
function query_good () {
console.log('query_good');
var data = overlay_analysis.data();
console.log('overlay analysis data.length:' + data.length);
data.forEach(function (d) {
console.log(d.properties);
})
},
function query_error () {
console.log('query_error');
});
}
catch (e) {
console.log('catch error:' + e);
}
Static Method Summary
Static Public Methods | ||
public static |
Get instance object (Singleton mode) |
Method Summary
Public Methods | ||
public |
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> Overlay analysis of the specific layers from the server. |
Static Public Methods
Public Methods
public queryAsync(options: Object, function_good: function(): null, function_error: function(): null): Promise<TResult> source
Overlay analysis of the specific layers from the server.
Params:
Name | Type | Attribute | Description |
options | Object | Overlay analysis 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 | The fields of result |
|
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. |