code: function(layerArray, layer) {
          if (layer.layersContext) {
              for (var i=0, len = layer.layersContext.length; i<len; i++) {
                  var l = layer.layersContext[i];
                  layerArray.push(l);
                  if (l.layersContext) {
                      this.processLayer(layerArray, l);
                  }
              }
          }
      }
docs: Method: processLayer
  Recursive function to get back a flat list of layers from the hierarchic
  layer structure.
  
  Parameters:
  layerArray - {Array({Object})} Array of layerContext objects
  layer - {Object} layerContext object