File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -245,18 +245,19 @@ export class AppreciableLayerBase extends Events {
245245 return fields ;
246246 }
247247
248- _findLayerCatalog ( layerCatalogs , id ) {
249- let matchData ;
250- for ( const data of layerCatalogs ) {
251- if ( data . id === id ) {
252- matchData = data ;
253- break ;
248+ _findLayerCatalog ( layerCatalogs , targetId ) {
249+ for ( const layer of layerCatalogs ) {
250+ if ( layer . id === targetId ) {
251+ return layer ;
254252 }
255- if ( data . type === 'group' ) {
256- matchData = this . _findLayerCatalog ( data . children , id ) ;
253+ if ( layer . children && layer . children . length > 0 ) {
254+ const found = this . _findLayerCatalog ( layer . children , targetId ) ;
255+ if ( found ) {
256+ return found ;
257+ }
257258 }
258259 }
259- return matchData ;
260+ return null ;
260261 }
261262
262263 _getLayerVisibleId ( layer ) {
You can’t perform that action at this time.
0 commit comments