Classdesc

Abstract base class; normally only used for creating subclasses and not instantiated in apps. A visual representation of raster or vector map data. Layers group together those properties that pertain to how the data is to be displayed, irrespective of the source of that data.

Layers are usually added to a map with ol.Map#addLayer. Components like ol.interaction.Select use unmanaged layers internally. These unmanaged layers are associated with the map using ol.layer.Layer#setMap instead.

A generic change event is fired when the state of the source changes.

Fires

ol.render.Event

Param: options

Layer options.

Api

stable

Hierarchy

Constructors

  • Parameters

    Returns Layer

    Classdesc

    Abstract base class; normally only used for creating subclasses and not instantiated in apps. A visual representation of raster or vector map data. Layers group together those properties that pertain to how the data is to be displayed, irrespective of the source of that data.

    Layers are usually added to a map with ol.Map#addLayer. Components like ol.interaction.Select use unmanaged layers internally. These unmanaged layers are associated with the map using ol.layer.Layer#setMap instead.

    A generic change event is fired when the state of the source changes.

    Fires

    ol.render.Event

    Api

    stable

Methods

  • Increases the revision counter and dispatches a 'change' event.

    Returns void

    Api

  • Dispatches an event and calls all listeners listening for events of this type. The event parameter can either be a string or an Object with a type property.

    Parameters

    Returns void

    Function

    Api

  • Gets a value.

    Parameters

    • key: string

      Key name.

    Returns any

    Value.

    Api

    stable

  • Return the extent of the layer or undefined if it will be visible regardless of extent.

    Returns Extent

    The layer extent.

    Observable

    Api

    stable

  • Get a list of object property names.

    Returns string[]

    List of property names.

    Api

    stable

  • Return the maximum resolution of the layer.

    Returns number

    The maximum resolution of the layer.

    Observable

    Api

    stable

  • Return the minimum resolution of the layer.

    Returns number

    The minimum resolution of the layer.

    Observable

    Api

    stable

  • Return the opacity of the layer (between 0 and 1).

    Returns number

    The opacity of the layer.

    Observable

    Api

    stable

  • Get an object of all property names and values.

    Returns {
        [k: string]: any;
    }

    Object.

    • [k: string]: any

    Api

    stable

  • Get the version number for this object. Each time the object is modified, its version number will be incremented.

    Returns number

    Revision.

    Api

  • Get the layer source.

    Returns Source

    The layer source (or null if not yet set).

    Observable

    Api

    stable

  • Return the visibility of the layer (true or false).

    Returns boolean

    The visibility of the layer.

    Observable

    Api

    stable

  • Return the Z-index of the layer, which is used to order layers before rendering. The default Z-index is 0.

    Returns number

    The Z-index of the layer.

    Observable

    Api

  • Listen for a certain type of event.

    Parameters

    • type: string | string[]

      The event type or array of event types.

    • listener: Function

      The listener function.

    • Optional opt_this: Object

      The object to use as this in listener.

    Returns Object | Object[]

    Unique key for the listener. If called with an array of event types as the first argument, the return will be an array of keys.

    Api

    stable

  • Listen once for a certain type of event.

    Parameters

    • type: string | string[]

      The event type or array of event types.

    • listener: Function

      The listener function.

    • Optional opt_this: Object

      The object to use as this in listener.

    Returns Object | Object[]

    Unique key for the listener. If called with an array of event types as the first argument, the return will be an array of keys.

    Api

    stable

  • Sets a value.

    Parameters

    • key: string

      Key name.

    • value: any

      Value.

    • Optional opt_silent: boolean

      Update without triggering an event.

    Returns void

    Api

    stable

  • Set the extent at which the layer is visible. If undefined, the layer will be visible at all extents.

    Parameters

    • extent: Extent

      The extent of the layer.

    Returns void

    Observable

    Api

    stable

  • Sets the layer to be rendered on top of other layers on a map. The map will not manage this layer in its layers collection, and the callback in ol.Map#forEachLayerAtPixel will receive null as layer. This is useful for temporary layers. To remove an unmanaged layer from the map, use #setMap(null).

    To add the layer to a map and have it managed by the map, use ol.Map#addLayer instead.

    Parameters

    Returns void

    Api

  • Set the maximum resolution at which the layer is visible.

    Parameters

    • maxResolution: number

      The maximum resolution of the layer.

    Returns void

    Observable

    Api

    stable

  • Set the minimum resolution at which the layer is visible.

    Parameters

    • minResolution: number

      The minimum resolution of the layer.

    Returns void

    Observable

    Api

    stable

  • Set the opacity of the layer, allowed values range from 0 to 1.

    Parameters

    • opacity: number

      The opacity of the layer.

    Returns void

    Observable

    Api

    stable

  • Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties).

    Parameters

    • values: {
          [k: string]: any;
      }

      Values.

      • [k: string]: any
    • Optional opt_silent: boolean

      Update without triggering an event.

    Returns void

    Api

    stable

  • Set the layer source.

    Parameters

    • source: Source

      The layer source.

    Returns void

    Observable

    Api

    stable

  • Set the visibility of the layer (true or false).

    Parameters

    • visible: boolean

      The visibility of the layer.

    Returns void

    Observable

    Api

    stable

  • Set Z-index of the layer, which is used to order layers before rendering. The default Z-index is 0.

    Parameters

    • zindex: number

      The z-index of the layer.

    Returns void

    Observable

    Api

  • Unlisten for a certain type of event.

    Parameters

    • type: string | string[]

      The event type or array of event types.

    • listener: Function

      The listener function.

    • Optional opt_this: Object

      The object which was used as this by the listener.

    Returns void

    Api

    stable

  • Removes an event listener using the key returned by on() or once(). Note that using the ol.Observable.unByKey static function is to be preferred.

    Parameters

    • key: Object | Object[]

      The key returned by on() or once() (or an array of keys).

    Returns void

    Function

    Api

    stable

  • Unsets a property.

    Parameters

    • key: string

      Key name.

    • Optional opt_silent: boolean

      Unset without triggering an event.

    Returns void

    Api

    stable

  • Removes an event listener using the key returned by on() or once().

    Parameters

    • key: Object | Object[]

      The key returned by on() or once() (or an array of keys).

    Returns void

    Api

    stable

Generated using TypeDoc