getLayersArray(array) {
    array = array !== undefined ? array : [];
    this.getLayers().forEach(function (layer) {
      layer.getLayersArray(array);
    });
    return array;
  }
@param {Array<import("./Layer.js").default>} [array] Array of layers (to be modified in place).
@return {Array<import("./Layer.js").default>} Array of layers.
@override