Skip to content

Commit d6053bc

Browse files
committed
【update】1)提交webmap接口文件
2)webmap单元测试文件 3)webmap使用到的图标文件 (reviewed by songym)
1 parent 8496f10 commit d6053bc

21 files changed

+90271
-98186
lines changed

dist/openlayers/iclient9-openlayers-es6.js

Lines changed: 12069 additions & 16009 deletions
Large diffs are not rendered by default.

dist/openlayers/iclient9-openlayers.css

Lines changed: 225 additions & 1997 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/openlayers/iclient9-openlayers.js

Lines changed: 72783 additions & 76204 deletions
Large diffs are not rendered by default.

dist/openlayers/iclient9-openlayers.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/openlayers/iclient9-openlayers.min.js

Lines changed: 100 additions & 1452 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/openlayers/include-openlayers.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@
7272
}
7373
if (!inArray(excludes, 'iclient9-openlayers')) {
7474
if (supportES6()) {
75-
inputScript("../../dist/openlayers/iclient9-openlayers-es6.min.js");
75+
// inputScript("../../dist/openlayers/iclient9-openlayers-es6.min.js");
76+
inputScript("../../dist/openlayers/iclient9-openlayers.js");
7677
} else {
7778
inputScript("../../dist/openlayers/iclient9-openlayers.min.js");
7879
}
@@ -99,6 +100,15 @@
99100
inputCSS("http://iclient.supermap.io/libs/openlayers/plugins/ol-layerswitcher/2.0.0/ol-layerswitcher.css");
100101
inputScript("http://iclient.supermap.io/libs/openlayers/plugins/ol-layerswitcher/2.0.0/ol-layerswitcher.js");
101102
}
103+
if (inArray(includes, 'jsonsql')) {
104+
inputScript("http://iclient.supermap.io/web/libs/jsonsql/jsonsql.js");
105+
}
106+
if (inArray(includes, 'geostats')) {
107+
inputScript("http://iclient.supermap.io/web/libs/geostats/geostats.js");
108+
}
109+
if (inArray(includes, 'canvg')) {
110+
inputScript("http://iclient.supermap.io/web/libs/canvg/canvg.min.js");
111+
}
102112

103113
}
104114

src/openlayers/core/ArrayStatistic.js

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
export class ArrayStatistic {
2+
3+
// geostatsInstance: null,
4+
5+
/**
6+
* 初始化插件实例
7+
*/
8+
static newInstance() {
9+
// if(!this.geostatsInstance) {
10+
// // this.geostatsInstance = new geostats();
11+
// // }
12+
if(!this.geostatsInstance) {
13+
14+
this.geostatsInstance = new window.geostats();
15+
}
16+
return this.geostatsInstance;
17+
}
18+
19+
/**
20+
* 设置需要被处理的数组
21+
*
22+
* @param array
23+
*/
24+
static getInstance(array) {
25+
let instance = this.newInstance();
26+
instance.setSerie(array);
27+
return instance;
28+
}
29+
30+
/**
31+
* 获取数组统计的值
32+
*
33+
* @param array 需要统计的数组
34+
* @param type 统计方法
35+
*/
36+
static getArrayStatistic(array, type){
37+
if(!array.length) {
38+
return 0;
39+
}
40+
if(type === "Sum" || type === "求和"){
41+
return this.getSum(array);
42+
} else if(type === "Maximum" || type === "最大值"){
43+
return this.getMax(array);
44+
} else if(type === "Minimum" || type === "最小值"){
45+
return this.getMin(array);
46+
} else if(type === "Average" || type === "平均值"){
47+
return this.getMean(array);
48+
} else if(type === "Median" || type === "中位数"){
49+
return this.getMedian(array);
50+
} else if(type === "times" || type === "计数"){
51+
return this.getTimes(array);
52+
}
53+
}
54+
55+
/**
56+
* 获取数组分段后的数值
57+
*
58+
* @param array 需要分段的数组
59+
* @param type 分段方法
60+
* @param segNum 分段个数
61+
*/
62+
static getArraySegments(array, type, segNum) {
63+
if(type === "offset") {
64+
return this.getEqInterval(array, segNum);
65+
} else if(type === "jenks") {
66+
return this.getJenks(array, segNum);
67+
} else if(type === "square") {
68+
// 数据都必须 >= 0
69+
let minValue = this.getMin(array);
70+
if(minValue >= 0){
71+
return this.getSqrtInterval(array, segNum);
72+
}else {
73+
//console.log('数据都必须 >= 0');
74+
// Util.showMessage(Language.hasNegValue + Language.noSupportRange, 'ERROR');
75+
return false;
76+
}
77+
78+
} else if(type === "logarithm") {
79+
// 数据都必须 > 0
80+
let minValue = this.getMin(array);
81+
if(minValue > 0){
82+
return this.getGeometricProgression(array, segNum);
83+
}else {
84+
//console.log('数据都必须 > 0');
85+
// Util.showMessage(Language.hasZeroNegValue + Language.noSupportRange, 'ERROR');
86+
return false;
87+
}
88+
}
89+
}
90+
91+
/**
92+
* 求和
93+
* @param array
94+
* @returns {number}
95+
*/
96+
static getSum(array){
97+
return this.getInstance(array).sum();
98+
}
99+
100+
/**
101+
* 最小值
102+
* @param array
103+
* @returns {*}
104+
*/
105+
static getMax(array){
106+
return this.getInstance(array).max();
107+
}
108+
109+
/**
110+
* 最大值
111+
* @param array
112+
* @returns {*}
113+
*/
114+
static getMin(array){
115+
return this.getInstance(array).min();
116+
}
117+
118+
/**
119+
* 求平均
120+
* @param array
121+
* @returns {number}
122+
*/
123+
static getMean(array){
124+
return this.getInstance(array).mean();
125+
}
126+
127+
/**
128+
* 求中位数
129+
*
130+
* @param array
131+
* @returns {number}
132+
*/
133+
static getMedian(array) {
134+
return this.getInstance(array).median();
135+
}
136+
137+
/**
138+
* 计数
139+
*
140+
* @param array
141+
* @returns {number}
142+
*/
143+
static getTimes(array) {
144+
return array.length;
145+
}
146+
147+
/**
148+
* 等距分段法
149+
*
150+
* @param array
151+
* @param segNum
152+
*/
153+
static getEqInterval(array, segNum) {
154+
return this.getInstance(array).getClassEqInterval(segNum);
155+
}
156+
157+
/**
158+
* 自然断裂法
159+
*
160+
* @param array
161+
* @param segNum
162+
*/
163+
static getJenks(array, segNum) {
164+
return this.getInstance(array).getClassJenks(segNum);
165+
}
166+
167+
/**
168+
* 平方根分段法
169+
*
170+
* @param array
171+
* @param segNum
172+
*/
173+
static getSqrtInterval(array, segNum) {
174+
array = array.map(function(value) {
175+
return Math.sqrt(value);
176+
});
177+
let breaks = this.getInstance(array).getClassEqInterval(segNum);
178+
return (
179+
breaks.map(function(value) {
180+
return value * value;
181+
})
182+
)
183+
}
184+
185+
/**
186+
* 对数分段法
187+
*
188+
* @param array
189+
* @param segNum
190+
*/
191+
static getGeometricProgression(array, segNum) {
192+
return this.getInstance(array).getClassGeometricProgression(segNum);
193+
}
194+
195+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy