AnsweredAssumed Answered

How To Reference Group Layer

Question asked by lloydbronn on Mar 30, 2017
Latest reply on May 9, 2017 by lloydbronn

I'm trying to create and if/else loop for three sublayers in a group layer. If it's the group layer (0) then the sublayers have certain labels. If it's group layer (4) then the sublayers have other labels, etc. 

 

Here's what I've tried. I've also tried arrays [0] instead of '0'.

if(identifyParams.layerIds === '0'){
                              
                              if(layerName === '10% Damage Risk'){
                                   layerLabel = '24 Hour Forecast';
                                   label = "10% Damage Risk";
                                   }
                                   
                              else if(layerName === '90% Apple Damage Risk'){
                                   layerLabel = '24 Hour Forecast';
                                   label = "90% Apple Damage Risk";
                                   }
                                   
                              else if(layerName === 'Overall Damage Risk'){
                                   layerLabel = '24 Hour Forecast';
                                   label = "Possible Damage";
                                   }
                                   
                              }
if(identifyParams.layerIds === '4'){
                              
                              if(layerName === '10% Damage Risk'){
                                   layerLabel = '48 Hour Forecast';
                                   label = "10% Damage Risk";
                                   }
                                   
                              else if(layerName === '90% Apple Damage Risk'){
                                   layerLabel = '48 Hour Forecast';
                                   label = "90% Apple Damage Risk";
                                   }
                                   
                              else if(layerName === 'Overall Damage Risk'){
                                   layerLabel = '48 Hour Forecast';
                                   label = "Possible Damage";
                                   }
                                   
                              }

 

I've also tried, but it didn't work. 

if(layerName === '24 Hour Forecast')

Outcomes