$(function () {
var config = {
URL: 'http://localhost:8090/iserver/services/data-DynamicData/rest/data',
SQL_WHERE: '1=1',
LayerData: 'DynamicData',//数据源
LayerName: 'Point'//查询的图层名
}
var R = new RequestIserverData(config)
R.querySpatialData()
})
class RequestIserverData {
constructor(config) {
this.URL = config.URL,
this.SQL_WHERE = config.SQL_WHERE,
this.LayerData = config.LayerData,
this.LayerName = config.LayerName
}
queryData() {
$.ajax({
url: 'http://localhost:8090/iserver/services/data-DynamicData/rest/data/datasources/DynamicData/datasets/Point.rjson',
type: "get",
dataType: "json",
async: false,
success(data) {
},
})
}
querySpatialData () {
var that = this
$.ajax({
url: that.URL+"/featureResults.json?returnContent=true&resultFormat=GEOJSON",
dataType: "json",
type: "POST",
contentType: "application/x-www-form-urlencoded;charset=UTF-8",
data: JSON.stringify({
"maxFeatures": "-1",
"getFeatureMode": "SQL",
"datasetNames": [that.LayerData+':'+that.LayerName],
"queryParameter": {
"attributeFilter": that.SQL_WHERE,
"returnCountOnly": "true"
},
"resultFormat": "GEOJSON"
}),
async: false,
success(serviceResult) {
var serviceResult = new SuperMap3D.GeoJSON().toGeoJSON(serviceResult.features);
var data = serviceResult.features
},
})
}
}
07-01
1483
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-11
369
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-13
1269
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-27
1730
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)