@@ -3174,7 +3174,9 @@ export class WebMap extends Observable {
31743174 segmentCount = themeSetting . segmentCount || this . defaultParameters . themeSetting . segmentCount ,
31753175 customSettings = themeSetting . customSettings ,
31763176 minR = parameters . themeSetting . minRadius ,
3177- maxR = parameters . themeSetting . maxRadius ;
3177+ maxR = parameters . themeSetting . maxRadius ,
3178+ fillColor = style . fillColor ,
3179+ colors = parameters . themeSetting . colors ;
31783180 features . forEach ( feature => {
31793181 let attributes = feature . get ( 'attributes' ) ,
31803182 value = attributes [ themeField ] ;
@@ -3206,19 +3208,22 @@ export class WebMap extends Observable {
32063208 let len = segements . length ,
32073209 incrementR = ( maxR - minR ) / ( len - 1 ) , // 半径增量
32083210 start , end , radius = Number ( ( ( maxR + minR ) / 2 ) . toFixed ( 2 ) ) ;
3209- for ( let i = 0 ; i < len - 1 ; i ++ ) {
3210- start = Number ( segements [ i ] . toFixed ( 2 ) ) ;
3211- end = Number ( segements [ i + 1 ] . toFixed ( 2 ) ) ;
3211+ // 获取颜色
3212+ let rangeColors = colors ? ColorsPickerUtil . getGradientColors ( colors , len , 'RANGE' ) : [ ] ;
3213+ for ( let j = 0 ; j < len - 1 ; j ++ ) {
3214+ start = Number ( segements [ j ] . toFixed ( 2 ) ) ;
3215+ end = Number ( segements [ j + 1 ] . toFixed ( 2 ) ) ;
32123216 // 这里特殊处理以下分段值相同的情况(即所有字段值相同)
3213- radius = start === end ? radius : minR + Math . round ( incrementR * i ) ;
3217+ radius = start === end ? radius : minR + Math . round ( incrementR * j ) ;
32143218 // 最后一个分段时将end+0.01,避免取不到最大值
3215- end = i === len - 2 ? end + 0.01 : end ;
3219+ end = j === len - 2 ? end + 0.01 : end ;
32163220 // 处理自定义 半径
3217- radius = customSettings [ i ] && customSettings [ i ] . radius ? customSettings [ i ] . radius : radius ;
3221+ radius = customSettings [ j ] && customSettings [ j ] . radius ? customSettings [ j ] . radius : radius ;
32183222 // 转化成 ol 样式
32193223 style . radius = radius ;
3224+ style . fillColor = customSettings [ j ] && customSettings [ j ] . color ? customSettings [ j ] . color : rangeColors [ j ] || fillColor ;
32203225 let olStyle = StyleUtils . getOpenlayersStyle ( style , featureType , true ) ;
3221- styleGroup . push ( { olStyle : olStyle , radius, start, end } ) ;
3226+ styleGroup . push ( { olStyle : olStyle , radius, start, end, fillColor : style . fillColor } ) ;
32223227 }
32233228 return styleGroup ;
32243229 } else {
0 commit comments