API (v2.0.0) - Giro3D
    Preparing search index...

    Interface for any object that can contain layers.

    interface HasLayers {
        hasLayers: true;
        get layerCount(): number;
        forEachLayer(callback: (layer: Layer) => void): void;
        getLayers(
            predicate?: (arg0: Layer) => boolean,
        ): Layer<LayerEvents, LayerUserData>[];
    }

    Implemented by

    Index

    Properties

    Accessors

    Methods

    Properties

    hasLayers: true

    Read-only flag to check if a given object is of type HasLayers.

    Accessors

    • get layerCount(): number

      Returns the number of layers currently in this object.

      Returns number

    Methods

    • Applies the callback to each layer in the object.

      Parameters

      • callback: (layer: Layer) => void

      Returns void

    • Returns a new array containing the layers in this object. Optionally, the predicate can be used to filter out unwanted layers.

      // Get all layers from the object.
      const allLayers = obj.getLayers();

      // Get all color layers from the object.
      const colorLayers = obj.getLayers((layer) => layer.isColorLayer);

      Parameters

      • Optionalpredicate: (arg0: Layer) => boolean

      Returns Layer<LayerEvents, LayerUserData>[]