Skip to content

Commit ac9f5a1

Browse files
committed
2 parents bdb5f8f + 3adaf10 commit ac9f5a1

File tree

5 files changed

+18
-13
lines changed

5 files changed

+18
-13
lines changed

src/openlayers/mapping/WebMap.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3203,7 +3203,9 @@ export class WebMap extends Observable {
32033203
segmentCount = themeSetting.segmentCount || this.defaultParameters.themeSetting.segmentCount,
32043204
customSettings = themeSetting.customSettings,
32053205
minR = parameters.themeSetting.minRadius,
3206-
maxR = parameters.themeSetting.maxRadius;
3206+
maxR = parameters.themeSetting.maxRadius,
3207+
fillColor = style.fillColor,
3208+
colors = parameters.themeSetting.colors;
32073209
features.forEach(feature => {
32083210
let attributes = feature.get('attributes'),
32093211
value = attributes[themeField];
@@ -3235,19 +3237,22 @@ export class WebMap extends Observable {
32353237
let len = segements.length,
32363238
incrementR = (maxR - minR) / (len - 1), // 半径增量
32373239
start, end, radius = Number(((maxR + minR) / 2).toFixed(2));
3238-
for (let i = 0; i < len - 1; i++) {
3239-
start = Number(segements[i].toFixed(2));
3240-
end = Number(segements[i + 1].toFixed(2));
3240+
// 获取颜色
3241+
let rangeColors = colors ? ColorsPickerUtil.getGradientColors(colors, len, 'RANGE') : [];
3242+
for (let j = 0; j < len - 1; j++) {
3243+
start = Number(segements[j].toFixed(2));
3244+
end = Number(segements[j + 1].toFixed(2));
32413245
// 这里特殊处理以下分段值相同的情况(即所有字段值相同)
3242-
radius = start === end ? radius : minR + Math.round(incrementR * i);
3246+
radius = start === end ? radius : minR + Math.round(incrementR * j);
32433247
// 最后一个分段时将end+0.01,避免取不到最大值
3244-
end = i === len - 2 ? end + 0.01 : end;
3248+
end = j === len - 2 ? end + 0.01 : end;
32453249
// 处理自定义 半径
3246-
radius = customSettings[i] && customSettings[i].radius ? customSettings[i].radius : radius;
3250+
radius = customSettings[j] && customSettings[j].radius ? customSettings[j].radius : radius;
32473251
// 转化成 ol 样式
32483252
style.radius = radius;
3253+
style.fillColor = customSettings[j] && customSettings[j].color ? customSettings[j].color : rangeColors[j] || fillColor;
32493254
let olStyle = StyleUtils.getOpenlayersStyle(style, featureType, true);
3250-
styleGroup.push({ olStyle: olStyle, radius, start, end });
3255+
styleGroup.push({ olStyle: olStyle, radius, start, end, fillColor: style.fillColor });
32513256
}
32523257
return styleGroup;
32533258
} else {

test/leaflet/components/clientcomputation/ClientComputationViewSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import { ClientComputationLayer } from '../../../../src/leaflet/components/clientcomputation/clientComputationLayer';
2+
import { ClientComputationLayer } from '../../../../src/leaflet/components/clientcomputation/ClientComputationLayer';
33
import { ClientComputationView } from '../../../../src/leaflet/components/clientcomputation/ClientComputationView'
44
import { FetchRequest } from '../../../../src/common/util/FetchRequest';
55
import { QueryBySQLService } from '../../../../src/common/iServer/QueryBySQLService';

test/leaflet/overlay/mapv/MapVRendererSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MapVRenderer } from '../../../../src/leaflet/overlay/mapV/MapVRenderer';
1+
import { MapVRenderer } from '../../../../src/leaflet/overlay/mapv/MapVRenderer';
22
import { mapVLayer } from '../../../../src/leaflet/overlay/MapVLayer';
33
import { utilCityCenter, DataSet } from 'mapv';
44

test/test-main-classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*classic -- overlay*/
2-
import './classic/overlay/mapVLayerSpec.js';
2+
import './classic/overlay/MapVLayerSpec.js';
33

44
/**classic --services**/
55
import './classic/services/AddressMatchServiceSpec.js';

test/test-main-leaflet.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import './leaflet/overlay/graphic/CloverStyleSpec';
2222
import './leaflet/overlay/GraphThemeLayerSpec.js';
2323
import './leaflet/overlay/HeatMapLayerSpec.js';
2424
import './leaflet/overlay/LabelThemeLayerSpec.js';
25-
import './leaflet/overlay/mapVLayerSpec.js';
25+
import './leaflet/overlay/MapVLayerSpec.js';
2626
import './leaflet/overlay/RangeThemeLayerSpec.js';
2727
import './leaflet/overlay/RankSymbolThemeLayerSpec.js';
2828
import './leaflet/overlay/TileVectorLayerSpec.js';
@@ -75,5 +75,5 @@ import './leaflet/components/distributedanalysis/DistributedAnalysisViewSpec.js'
7575
import './leaflet/components/clientcomputation/ClientComputationViewSpec.js';
7676
import './leaflet/components/search/SearchViewSpec.js';
7777
import './leaflet/components/dataflow/DataFlowViewSpec.js';
78-
import './leaflet/overlay/DataFlowlayerSpec.js';
78+
import './leaflet/overlay/DataFlowLayerSpec.js';
7979

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