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 @@ -3167,7 +3167,7 @@ export class WebMap extends Observable {
31673167
31683168 //生成styleGroup
31693169 let styleGroup = [ ] ;
3170- const usedColors = this . getCustomSettingColors ( customSettings , names , featureType ) . map ( item => item . toLowerCase ( ) ) ;
3170+ const usedColors = this . getCustomSettingColors ( customSettings , featureType ) . map ( item => item . toLowerCase ( ) ) ;
31713171 const curentColors = this . getUniqueColors ( themeSetting . colors || this . defaultParameters . themeSetting . colors , names . length + Object . keys ( customSettings ) . length ) . map ( item => item . toLowerCase ( ) ) ;
31723172 const newColors = difference ( curentColors , usedColors ) ;
31733173 for ( let index = 0 ; index < names . length ; index ++ ) {
@@ -3225,6 +3225,11 @@ export class WebMap extends Observable {
32253225 const keys = Object . keys ( customSettings ) ;
32263226 const colors = [ ] ;
32273227 keys . forEach ( key => {
3228+ //兼容之前自定义只存储一个color
3229+ if ( Util . isString ( customSettings [ key ] ) ) {
3230+ colors . push ( customSettings [ key ] ) ;
3231+ return ;
3232+ }
32283233 if ( featureType === "LINE" ) {
32293234 colors . push ( customSettings [ key ] . strokeColor ) ;
32303235 } else {
Original file line number Diff line number Diff line change @@ -338,7 +338,7 @@ describe('openlayers_WebMap', () => {
338338 ]
339339 }
340340 const res = await datavizWebmap . getUniqueStyleGroup ( parameters , [ { get : ( ) => ( { 'UserID' : 30 , 'UserID' : 0 } ) } ] ) ;
341- expect ( res . length ) . toBe ( 2 ) ;
341+ expect ( res . length ) . toBe ( 1 ) ;
342342 done ( ) ;
343343 }
344344 } ) ;
You can’t perform that action at this time.
0 commit comments