Skip to content

Commit f6b683c

Browse files
committed
2 parents b0baa4a + 991656f commit f6b683c

File tree

9 files changed

+39
-97
lines changed

9 files changed

+39
-97
lines changed

examples/ol3/02_getFeatureByBounds.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
map.addLayer(vectorLayer);
4242

4343
var getFeaturesService = new ol.supermap.GetFeaturesService(url);
44-
getFeaturesService.getFeaturesByBoundsService({
44+
getFeaturesService.getFeaturesByBounds({
4545
dataSetNames: ["World:Countries"],
4646
bounds: polygon.getExtent(),
4747
spatialQueryMode: "INTERSECT"

examples/ol3/02_getFeatureByBuffer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
map.addLayer(vectorLayer);
4343

4444
var getFeaturesService = new ol.supermap.GetFeaturesService(url);
45-
getFeaturesService.getFeaturesByBufferService({
45+
getFeaturesService.getFeaturesByBuffer({
4646
dataSetNames: ["World:Capitals"],
4747
bufferDistance: 10,
4848
geometry: polygon

examples/ol3/02_getFeatureByGeometry.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
});
5252
map.addLayer(resultLayer);
5353
});
54-
getFeaturesService.getFeaturesByGeometryService({
54+
getFeaturesService.getFeaturesByGeometry({
5555
dataSetNames: ["World:Countries"],
5656
geometry: polygon,
5757
spatialQueryMode: "INTERSECT"

examples/ol3/02_getFeatureByIDs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
function query() {
2626
clearLayer();
2727
var getFeaturesService = new ol.supermap.GetFeaturesService(url);
28-
getFeaturesService.getFeaturesByIDsService({
28+
getFeaturesService.getFeaturesByIDs({
2929
IDs: [1, 247],
3030
dataSetNames: ["World:Countries"]
3131
});

examples/ol3/02_getFeatureBySQL.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
});
3434
map.addLayer(resultLayer);
3535
});
36-
getFeaturesService.getFeaturesBySQLService({
36+
getFeaturesService.getFeaturesBySQL({
3737
name: "Countries@World",
3838
attributeFilter: "SMID = 1",
3939
dataSetNames: ["World:Countries"]

src/OL3/SuperMap/iServer/FieldStatisticService.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,17 @@
22
* Class: FieldStatisticService
33
* 字段查询服务类
44
*/
5-
require('./FieldsServiceBase');
5+
require('./ServiceBase');
66
require('../../../Core/iServer/FieldStatisticService');
77

88
ol.supermap.FieldStatisticService = function (url, options) {
9-
ol.supermap.FieldsServiceBase.call(this, url, options);
10-
this.options.fieldName = options.fieldName;
9+
ol.supermap.ServiceBase.call(this, url, options);
1110
this.currentStatisticResult = {fieldName: options.fieldName};
12-
this.options.statisticMode = options.statisticMode;
1311
if (!options.statisticMode || (typeof options.statisticMode !== "Array")) {
1412
this.options.statisticMode = SuperMap.REST.StatisticMode;
1513
}
1614
}
17-
ol.inherits(ol.supermap.FieldStatisticService, ol.supermap.FieldsServiceBase);
15+
ol.inherits(ol.supermap.FieldStatisticService, ol.supermap.ServiceBase);
1816

1917

2018
ol.supermap.FieldStatisticService.prototype.getFieldStatisticInfo = function () {

src/OL3/SuperMap/iServer/FieldsServiceBase.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/OL3/SuperMap/iServer/GetFeaturesService.js

Lines changed: 28 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,9 @@ ol.inherits(ol.supermap.GetFeaturesService, ol.supermap.ServiceBase);
1919
* 数据集ID查询服务
2020
* @param params
2121
*/
22-
ol.supermap.GetFeaturesService.prototype.getFeaturesByIDsService = function (params) {
22+
ol.supermap.GetFeaturesService.prototype.getFeaturesByIDs = function (params) {
2323
var me = this, param = me._processParams(params);
24-
var getFeaturesByIDsParameters = new SuperMap.REST.GetFeaturesByIDsParameters({
25-
returnContent: param.returnContent,
26-
datasetNames: param.dataSetNames,
27-
fromIndex: param.fromIndex,
28-
toIndex: param.toIndex,
29-
IDs: param.IDs
30-
});
24+
var getFeaturesByIDsParameters = new SuperMap.REST.GetFeaturesByIDsParameters(param);
3125
var getFeaturesByIDsService = new SuperMap.REST.GetFeaturesByIDsService(me.options.url, {
3226
eventListeners: {
3327
scope: me,
@@ -43,25 +37,9 @@ ol.supermap.GetFeaturesService.prototype.getFeaturesByIDsService = function (par
4337
* 数据集Bounds查询服务
4438
* @param params
4539
*/
46-
ol.supermap.GetFeaturesService.prototype.getFeaturesByBoundsService = function (params) {
47-
var me = this, param = me._processParams(params), bounds = params.bounds, spatialQueryMode;
48-
bounds = new SuperMap.Bounds(
49-
params.bounds[0],
50-
params.bounds[1],
51-
params.bounds[2],
52-
params.bounds[3]
53-
);
54-
spatialQueryMode = (param.spatialQueryMode) ? param.spatialQueryMode : SuperMap.REST.SpatialQueryMode.CONTAIN;
55-
var getFeaturesByBoundsParameters = new SuperMap.REST.GetFeaturesByBoundsParameters({
56-
bounds: bounds,
57-
spatialQueryMode: spatialQueryMode,
58-
datasetNames: param.dataSetNames,
59-
60-
returnContent: param.returnContent,
61-
fromIndex: param.fromIndex,
62-
toIndex: param.toIndex
63-
64-
});
40+
ol.supermap.GetFeaturesService.prototype.getFeaturesByBounds = function (params) {
41+
var me = this, param = me._processParams(params);
42+
var getFeaturesByBoundsParameters = new SuperMap.REST.GetFeaturesByBoundsParameters(param);
6543
var getFeaturesByBoundsService = new SuperMap.REST.GetFeaturesByBoundsService(me.options.url, {
6644
eventListeners: {
6745
scope: me,
@@ -76,20 +54,9 @@ ol.supermap.GetFeaturesService.prototype.getFeaturesByBoundsService = function (
7654
* 数据集Buffer查询服务
7755
* @param params
7856
*/
79-
ol.supermap.GetFeaturesService.prototype.getFeaturesByBufferService = function (params) {
80-
var me = this, geometry, param = me._processParams(params);
81-
if (param && param.geometry && param.geometry instanceof ol.geom.Geometry) {
82-
geometry = ol.supermap.Util.toSuperMapGeometry(JSON.parse((new ol.format.GeoJSON()).writeGeometry(param.geometry)));
83-
}
84-
var getFeatureByBufferParameter = new SuperMap.REST.GetFeaturesByBufferParameters({
85-
geometry: geometry,
86-
bufferDistance: param.bufferDistance,
87-
datasetNames: param.dataSetNames,
88-
89-
returnContent: param.returnContent,
90-
fromIndex: param.fromIndex,
91-
toIndex: param.toIndex
92-
});
57+
ol.supermap.GetFeaturesService.prototype.getFeaturesByBuffer = function (params) {
58+
var me = this, param = me._processParams(params);
59+
var getFeatureByBufferParameter = new SuperMap.REST.GetFeaturesByBufferParameters(param);
9360
var getFeatureService = new SuperMap.REST.GetFeaturesByBufferService(me.options.url, {
9461
eventListeners: {
9562
scope: me,
@@ -104,20 +71,10 @@ ol.supermap.GetFeaturesService.prototype.getFeaturesByBufferService = function (
10471
* 数据集SQL查询服务
10572
* @param params
10673
*/
107-
ol.supermap.GetFeaturesService.prototype.getFeaturesBySQLService = function (params) {
74+
ol.supermap.GetFeaturesService.prototype.getFeaturesBySQL = function (params) {
10875
var me = this, param = me._processParams(params);
109-
var getFeatureParam = new SuperMap.REST.FilterParameter({
110-
name: param.name,
111-
attributeFilter: param.attributeFilter
112-
});
113-
var getFeatureBySQLParams = new SuperMap.REST.GetFeaturesBySQLParameters({
114-
queryParameter: getFeatureParam,
115-
datasetNames: param.dataSetNames,
116-
117-
returnContent: param.returnContent,
118-
fromIndex: param.fromIndex,
119-
toIndex: param.fromIndex
120-
});
76+
param.queryParameter = new SuperMap.REST.FilterParameter(param);
77+
var getFeatureBySQLParams = new SuperMap.REST.GetFeaturesBySQLParameters(param);
12178
var getFeatureBySQLService = new SuperMap.REST.GetFeaturesBySQLService(me.options.url, {
12279
eventListeners: {
12380
scope: me,
@@ -133,21 +90,9 @@ ol.supermap.GetFeaturesService.prototype.getFeaturesBySQLService = function (par
13390
* 数据集几何查询服务类
13491
* @param params
13592
*/
136-
ol.supermap.GetFeaturesService.prototype.getFeaturesByGeometryService = function (params) {
137-
var me = this, geometry, spatialQueryMode, param = me._processParams(params);
138-
if (param && param.geometry && param.geometry instanceof ol.geom.Geometry) {
139-
geometry = ol.supermap.Util.toSuperMapGeometry(JSON.parse((new ol.format.GeoJSON()).writeGeometry(param.geometry)));
140-
}
141-
spatialQueryMode = (param.spatialQueryMode) ? param.spatialQueryMode : SuperMap.REST.SpatialQueryMode.CONTAIN;
142-
var getFeaturesByGeometryParameters = new SuperMap.REST.GetFeaturesByGeometryParameters({
143-
spatialQueryMode: spatialQueryMode,
144-
geometry: geometry,
145-
datasetNames: param.dataSetNames,
146-
147-
returnContent: param.returnContent,
148-
fromIndex: param.fromIndex,
149-
toIndex: param.toIndex
150-
});
93+
ol.supermap.GetFeaturesService.prototype.getFeaturesByGeometry = function (params) {
94+
var me = this, param = me._processParams(params);
95+
var getFeaturesByGeometryParameters = new SuperMap.REST.GetFeaturesByGeometryParameters(param);
15196
var getFeaturesByGeometryService = new SuperMap.REST.GetFeaturesByGeometryService(me.options.url, {
15297
eventListeners: {
15398
scope: me,
@@ -158,14 +103,27 @@ ol.supermap.GetFeaturesService.prototype.getFeaturesByGeometryService = function
158103
getFeaturesByGeometryService.processAsync(getFeaturesByGeometryParameters);
159104
return me;
160105
};
106+
161107
ol.supermap.GetFeaturesService.prototype._processParams = function (params) {
162108
if (!params) {
163109
return {};
164110
}
165111
params.returnContent = (params.returnContent == null) ? true : params.returnContent;
112+
params.datasetNames = params.dataSetNames;
166113
params.fromIndex = params.fromIndex ? params.fromIndex : 0;
167114
params.toIndex = params.fromIndex ? params.fromIndex : -1;
115+
if (params.bounds) {
116+
params.bounds = new SuperMap.Bounds(
117+
params.bounds[0],
118+
params.bounds[1],
119+
params.bounds[2],
120+
params.bounds[3]
121+
);
122+
}
123+
if (params.geometry) {
124+
params.geometry = ol.supermap.Util.toSuperMapGeometry(JSON.parse((new ol.format.GeoJSON()).writeGeometry(params.geometry)));
125+
}
168126
return params;
169-
};
127+
}
170128

171129
module.exports = ol.supermap.GetFeaturesService;

src/OL3/SuperMap/iServer/GetFieldsService.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
* Class: GetFieldsService
33
* 字段查询服务类
44
*/
5-
require('./FieldsServiceBase');
5+
require('./ServiceBase');
66
require('../../../Core/iServer/GetFieldsService');
77

88
ol.supermap.GetFieldsService = function (url, options) {
9-
ol.supermap.FieldsServiceBase.call(this, url, options);
9+
ol.supermap.ServiceBase.call(this, url, options);
1010
}
11-
ol.inherits(ol.supermap.GetFieldsService, ol.supermap.FieldsServiceBase);
11+
ol.inherits(ol.supermap.GetFieldsService, ol.supermap.ServiceBase);
1212

1313
ol.supermap.GetFieldsService.prototype.getFields = function () {
1414
var me = this, getFieldsService;

0 commit comments

Comments
 (0)