MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / queryFeatureBySQL

Function queryFeatureBySQL

src/openlayers/mapping/webmap/Util.js:22–59  ·  view source on GitHub ↗
(
  url,
  layerName,
  attributeFilter,
  fields,
  epsgCode,
  processCompleted,
  processFaild,
  startRecord,
  recordLength,
  onlyAttribute
)

Source from the content-addressed store, hash-verified

20 getFeatureBySQLWithConcurrent(url, datasetNames, processCompleted, processFaild, serviceOptions, targetEpsgCode, restDataSingleRequestCount);
21}
22export function queryFeatureBySQL(
23 url,
24 layerName,
25 attributeFilter,
26 fields,
27 epsgCode,
28 processCompleted,
29 processFaild,
30 startRecord,
31 recordLength,
32 onlyAttribute
33) {
34 const queryParam = new FilterParameter({
35 name: layerName,
36 attributeFilter: attributeFilter
37 });
38 if (fields) {
39 queryParam.fields = fields;
40 }
41 const params = {
42 queryParams: [queryParam]
43 };
44 if (onlyAttribute) {
45 params.queryOption = QueryOption.ATTRIBUTE;
46 }
47 startRecord && (params.startRecord = startRecord);
48 recordLength && (params.expectCount = recordLength);
49 if (epsgCode) {
50 params.prjCoordSys = {
51 epsgCode: epsgCode
52 };
53 }
54 const queryBySQLParams = new QueryBySQLParameters(params);
55 const queryBySQLService = new QueryService(url);
56 queryBySQLService.queryBySQL(queryBySQLParams, function (data) {
57 data.type === 'processCompleted' ? processCompleted(data) : processFaild(data);
58 });
59}
60
61export function getFeatureBySQLWithConcurrent(
62 url,

Callers 2

addLayersMethod · 0.90
getFeaturesMethod · 0.90

Calls 1

queryBySQLMethod · 0.95

Tested by

no test coverage detected