@@ -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 {
0 commit comments