File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -3164,7 +3164,7 @@ export class WebMap extends Observable {
3164
3164
3165
3165
//生成styleGroup
3166
3166
let styleGroup = [ ] ;
3167
- const usedColors = this . getCustomSettingColors ( customSettings , names , featureType ) . map ( item => item . toLowerCase ( ) ) ;
3167
+ const usedColors = this . getCustomSettingColors ( customSettings , featureType ) . map ( item => item . toLowerCase ( ) ) ;
3168
3168
const curentColors = this . getUniqueColors ( themeSetting . colors || this . defaultParameters . themeSetting . colors , names . length + Object . keys ( customSettings ) . length ) . map ( item => item . toLowerCase ( ) ) ;
3169
3169
const newColors = difference ( curentColors , usedColors ) ;
3170
3170
for ( let index = 0 ; index < names . length ; index ++ ) {
@@ -3222,6 +3222,11 @@ export class WebMap extends Observable {
3222
3222
const keys = Object . keys ( customSettings ) ;
3223
3223
const colors = [ ] ;
3224
3224
keys . forEach ( key => {
3225
+ //兼容之前自定义只存储一个color
3226
+ if ( Util . isString ( customSettings [ key ] ) ) {
3227
+ colors . push ( customSettings [ key ] ) ;
3228
+ return ;
3229
+ }
3225
3230
if ( featureType === "LINE" ) {
3226
3231
colors . push ( customSettings [ key ] . strokeColor ) ;
3227
3232
} else {
Original file line number Diff line number Diff line change @@ -338,7 +338,7 @@ describe('openlayers_WebMap', () => {
338
338
]
339
339
}
340
340
const res = await datavizWebmap . getUniqueStyleGroup ( parameters , [ { get : ( ) => ( { 'UserID' : 30 , 'UserID' : 0 } ) } ] ) ;
341
- expect ( res . length ) . toBe ( 2 ) ;
341
+ expect ( res . length ) . toBe ( 1 ) ;
342
342
done ( ) ;
343
343
}
344
344
} ) ;
You can’t perform that action at this time.
0 commit comments