Skip to content

Commit 9126609

Browse files
【update】Aggregations聚合参数对象化 review by songym
1 parent 950d245 commit 9126609

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3598
-2531
lines changed

examples/component/components_coordinate_conversion_vue.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@
2929

3030
<script>
3131
new Vue({
32-
el: '#main',
33-
created() {
34-
SuperMap.Components.setTheme('dark');
35-
}
32+
el: '#main'
3633
});
3734
</script>
3835
</body>

examples/component/components_timeline_cloud.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,14 @@
9797
server-url="https://www.supermapol.com"
9898
:map-id="235407763"
9999
:tianditu-key="tiandituKey"
100+
:map-options="mapOptions"
100101
:loading="loading"
101102
@load="load"
102103
></sm-web-map>
103104
<sm-time-line
104105
ref="timeLine"
105106
:data="data"
106-
:play-interval="1000"
107+
:play-interval="800"
107108
:next-enable="nextEnable"
108109
:label="label"
109110
@timelinechanged="timelineChanged"
@@ -207,7 +208,11 @@
207208
'T202007210500',
208209
'T202007210600',
209210
'T202007210700'
210-
]
211+
],
212+
mapOptions: {
213+
style: { version: 8, sources: {}, layers: [] },
214+
zoom: 4.6
215+
}
211216
};
212217
},
213218
computed: {

examples/component/components_timeline_supermap.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
mapOptions: {
123123
style: { version: 8, sources: {}, layers: [] },
124124
center: [104.0924, 30.5217],
125-
zoom: 17,
125+
zoom: 18,
126126
bearing: 0,
127127
pitch: 0,
128128
tileSize: 1024,
Loading

src/common/REST.js

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,33 +1253,36 @@ export {
12531253
}
12541254

12551255
/**
1256-
* @enum AggregationType
1256+
* @enum BucketAggType
12571257
* @memberOf SuperMap
1258-
* @description 聚合查询枚举类,该类定义了Es数据服务中聚合查询模式常量
1258+
* @description 格网聚合查询枚举类,该类定义了Elasticsearch数据服务中聚合查询模式常量
12591259
* @type {string}
12601260
*/
1261-
var AggregationType = SuperMap.AggregationType = {
1262-
/** 格网聚合类型。 */
1263-
GEOHASH_GRID: "geohash_grid",
1264-
/** 过滤聚合类型。 */
1265-
FILTER: "filter"
1261+
var BucketAggType = SuperMap.BucketAggType = {
1262+
/** 格网聚合类型 */
1263+
GEOHASH_GRID: "geohash_grid"
12661264
};
12671265
export {
1268-
AggregationType
1266+
BucketAggType
12691267
}
1270-
12711268
/**
1272-
* @enum AggregationType
1269+
* @enum MetricsAggType
12731270
* @memberOf SuperMap
1274-
* @description 聚合查询中filter查询枚举类
1271+
* @description 指标聚合类型枚举类,该类定义了Elasticsearch数据服务中聚合查询模式常量
12751272
* @type {string}
12761273
*/
1277-
var AggregationQueryBuilderType = SuperMap.AggregationQueryBuilderType = {
1278-
/** 范围查询。 */
1279-
GEO_BOUNDING_BOX: "geo_bounding_box"
1280-
}
1274+
var MetricsAggType = SuperMap.MetricsAggType = {
1275+
/** 平均值聚合类型 */
1276+
AVG:'avg',
1277+
/** 最大值聚合类型 */
1278+
MAX:'max',
1279+
/** 最小值聚合类型 */
1280+
MIN:'min',
1281+
/** 求和聚合类型 */
1282+
SUM:'sum'
1283+
};
12811284
export {
1282-
AggregationQueryBuilderType
1285+
MetricsAggType
12831286
}
12841287

12851288
/**

src/common/iServer/AggQueryBuilderParameter.js

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
22
* This program are made available under the terms of the Apache License, Version 2.0
33
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
4-
import {SuperMap} from '../SuperMap';
5-
import {Util} from '../commontypes/Util';
4+
import { SuperMap } from '../SuperMap';
5+
import { Util } from '../commontypes/Util';
66

77
/**
88
* @class SuperMap.AggregationParameter
99
* @classdesc 聚合查询参数设置,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
1010
* @category iServer Data FeatureResults
1111
* @param {Object} options - 初始化参数。
1212
* @param {string} options.aggName - 聚合名称。
13-
* @param {SuperMap.AggregationType} options.aggType - 聚合类型设置。
1413
* @param {string} options.aggFieldName - 聚合字段。
15-
* @param {SuperMap.AggregationParameter} options.subAgg - 子聚合类。
16-
*
1714
*/
1815
export class AggregationParameter {
1916
constructor(options) {
@@ -22,23 +19,13 @@ export class AggregationParameter {
2219
* @description 聚合名称。
2320
*/
2421
this.aggName = null;
25-
/**
26-
* @member {SuperMap.AggregationType} SuperMap.AggregationParameter.prototype.aggType
27-
* @description 聚合类型设置类。
28-
*/
29-
this.aggType = null;
3022
/**
3123
* @member {string} SuperMap.AggregationParameter.prototype.aggFieldName
3224
* @description 聚合字段。
3325
*/
3426
this.aggFieldName = null;
35-
/**
36-
* @member {SuperMap.AggregationParameter} SuperMap.AggregationParameter.prototype.subAgg
37-
* @description 子聚合。
38-
*/
39-
this.subAgg = null;
4027

41-
this.CLASS_NAME = "SuperMap.AggregationParameter";
28+
this.CLASS_NAME = 'SuperMap.AggregationParameter';
4229
Util.extend(this, options);
4330
}
4431

@@ -47,10 +34,7 @@ export class AggregationParameter {
4734
me.aggName = null;
4835
me.aggFieldName = null;
4936
me.aggType = null;
50-
if (me.subAgg) {
51-
me.subAgg = null;
52-
}
5337
}
5438
}
5539

56-
SuperMap.AggregationParameter = AggregationParameter;
40+
SuperMap.AggregationParameter = AggregationParameter;
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
2+
* This program are made available under the terms of the Apache License, Version 2.0
3+
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
4+
import { SuperMap } from '../SuperMap';
5+
import { Util } from '../commontypes/Util';
6+
import { AggregationParameter } from './AggregationParameter';
7+
8+
/**
9+
* @class SuperMap.BucketAggParameter
10+
* @classdesc 子聚合类查询参数设置,该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
11+
* @category iServer Data FeatureResults
12+
* @param {Object} options - 初始化参数。
13+
* @param {Array.<SuperMap.MetricsAggParameter>} options.subAggs - 子聚合类集合。
14+
*
15+
*/
16+
export class BucketAggParameter extends AggregationParameter {
17+
constructor(options) {
18+
super();
19+
/**
20+
* @member {Array.<SuperMap.MetricsAggParameter>} SuperMap.BucketAggParameter.prototype.subAggs
21+
* @description 子聚合类集合。
22+
*/
23+
this.subAggs = null;
24+
this.aggType = null;
25+
26+
this.CLASS_NAME = 'SuperMap.BucketAggParameter';
27+
Util.extend(this, options);
28+
}
29+
30+
destroy() {
31+
var me = this;
32+
if (me.subAggs) {
33+
me.subAggs = null;
34+
}
35+
}
36+
}
37+
38+
SuperMap.BucketAggParameter = BucketAggParameter;

src/common/iServer/FilterAggParameter.js

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

src/common/iServer/GeoBoundingBoxQueryBuilderParameter.js

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

0 commit comments

Comments
 (0)