LegendQuery
Legend Query information of the specific layers from the server.
Example:
var legend_query = KQ.Query.LegendQuery.getInstance();
console.log(legend_query);
try {
var options = {
url: 'http://172.16.1.157:8699/KQGis/rest/services/zy',
layerId: 137,
};
legend_query.queryAsync(options,
function query_good () {
console.log('query_good');
var data = legend_query.data();
console.log('legend query 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> Legend Query information from the server. |
Static Public Methods
Public Methods
public queryAsync(options: Object, function_good: function(): null, function_error: function(): null): Promise<TResult> source
Legend Query information from the server.
Params:
Name | Type | Attribute | Description |
options | Object | Legend Query options |
|
options.url | String | Service url |
|
options.layerId | String | Layer id of legend query |
|
options.bbox | String | The range of layer for legend query |
|
function_good | function(): null | The function will run after querying successfully. |
|
function_error | function(): null | The function will run after querying unsuccessfully. |