Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Mask

Hierarchy

  • Layer
  • Layer
    • Mask

Index

Constructors

constructor

  • new Mask(options?: {}): Mask

Methods

addEventListener

  • addEventListener(type: string, listener: {}): void
  • Parameters

    • type: string

      Type.

    • listener: {}

      Listener.

    Returns void

changed

  • changed(): void
  • Increases the revision counter and dispatches a 'change' event.

    api

    Returns void

createExtent

  • createExtent(center: number[], halfLength: number): number[]
  • Parameters

    • center: number[]
    • halfLength: number

      a half length of a square's side.

    Returns number[]

    an extent.

dispatchEvent

  • dispatchEvent(event: string | BaseEvent | { propagationStopped: boolean; target: Target | EventTarget; type: string }): boolean
  • 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.

    api

    Parameters

    • event: string | BaseEvent | { propagationStopped: boolean; target: Target | EventTarget; type: string }

    Returns boolean

    false if anyone called preventDefault on the event object or if any of the listeners returned false.

dispose

  • dispose(): void
  • Clean up.

    Returns void

disposeInternal

  • disposeInternal(): void
  • inheritdoc

    Returns void

get

  • get(key: string): any
  • Gets a value.

    api

    Parameters

    • key: string

      Key name.

    Returns any

    Value.

getClassName

  • getClassName(): string

getExtent

  • getExtent(): number[]
  • Return the {@link module:ol/extent~Extent extent} of the layer or undefined if it will be visible regardless of extent.

    observable
    api

    Returns number[]

    The layer extent.

getFeatures

  • getFeatures(pixel: number[]): Promise<Feature<any>[]>
  • Parameters

    • pixel: number[]

      Pixel.

    Returns Promise<Feature<any>[]>

    Promise that resolves with an array of features.

getKeys

  • getKeys(): string[]
  • Get a list of object property names.

    api

    Returns string[]

    List of property names.

getLayerState

  • getLayerState(opt_managed: boolean): {}
  • This method is not meant to be called by layers or layer renderers because the state is incorrect if the layer is included in a layer group.

    Parameters

    • opt_managed: boolean

      Layer is managed.

    Returns {}

    Layer state.

getLayerStatesArray

  • getLayerStatesArray(opt_states: any): any
  • inheritdoc

    Parameters

    • opt_states: any

    Returns any

getLayersArray

  • getLayersArray(opt_array: any): any
  • inheritdoc

    Parameters

    • opt_array: any

    Returns any

getListeners

  • getListeners(type: string): {}[]
  • Get the listeners for a specified event type. Listeners are returned in the order that they will be called in.

    Parameters

    • type: string

      Type.

    Returns {}[]

    Listeners.

getMaxResolution

  • getMaxResolution(): number
  • Return the maximum resolution of the layer.

    observable
    api

    Returns number

    The maximum resolution of the layer.

getMaxZoom

  • getMaxZoom(): number
  • Return the maximum zoom level of the layer.

    observable
    api

    Returns number

    The maximum zoom level of the layer.

getMinResolution

  • getMinResolution(): number
  • Return the minimum resolution of the layer.

    observable
    api

    Returns number

    The minimum resolution of the layer.

getMinZoom

  • getMinZoom(): number
  • Return the minimum zoom level of the layer.

    observable
    api

    Returns number

    The minimum zoom level of the layer.

getOpacity

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

    observable
    api

    Returns number

    The opacity of the layer.

getProperties

  • getProperties(): Object
  • Get an object of all property names and values.

    api

    Returns Object

    Object.

getRenderer

  • getRenderer(): LayerRenderer<any>
  • Get the renderer for this layer.

    Returns LayerRenderer<any>

    The layer renderer.

getRevision

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

    api

    Returns number

    Revision.

getSource

  • getSource(): SourceType
  • Get the layer source.

    observable
    api

    Returns SourceType

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

getSourceState

  • getSourceState(): string | { ERROR: string; LOADING: string; READY: string; UNDEFINED: string }
  • inheritdoc

    Returns string | { ERROR: string; LOADING: string; READY: string; UNDEFINED: string }

getVisible

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

    observable
    api

    Returns boolean

    The visibility of the layer.

getZIndex

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

    observable
    api

    Returns number

    The Z-index of the layer.

hasListener

  • hasListener(opt_type: string): boolean
  • Parameters

    • opt_type: string

      Type. If not provided, true will be returned if this event target has any listeners.

    Returns boolean

    Has listeners.

hasRenderer

  • hasRenderer(): boolean
  • Returns boolean

    The layer has a renderer.

notify

  • notify(key: string, oldValue: any): void
  • Parameters

    • key: string

      Key name.

    • oldValue: any

      Old value.

    Returns void

on

  • on(type: string | string[], listener: {}): {} | {}[]
  • Listen for a certain type of event.

    api

    Parameters

    • type: string | string[]

      The event type or array of event types.

    • listener: {}

      The listener function.

    Returns {} | {}[]

    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.

once

  • once(type: string | string[], listener: {}): {} | {}[]
  • Listen once for a certain type of event.

    api

    Parameters

    • type: string | string[]

      The event type or array of event types.

    • listener: {}

      The listener function.

    Returns {} | {}[]

    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.

removeEventListener

  • removeEventListener(type: string, listener: {}): void
  • Parameters

    • type: string

      Type.

    • listener: {}

      Listener.

    Returns void

render

  • render(frameState: {}): HTMLCanvasElement
  • Parameters

    • frameState: {}

    Returns HTMLCanvasElement

set

  • set(key: string, value: any, opt_silent: boolean): void
  • Sets a value.

    api

    Parameters

    • key: string

      Key name.

    • value: any

      Value.

    • opt_silent: boolean

      Update without triggering an event.

    Returns void

setExtent

  • setExtent(extent: number[]): void
  • Set the extent at which the layer is visible. If undefined, the layer will be visible at all extents.

    observable
    api

    Parameters

    • extent: number[]

      The extent of the layer.

    Returns void

setMap

  • setMap(map: PluggableMap): void
  • 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 {@link module: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 {@link module:ol/Map#addLayer} instead.

    api

    Parameters

    • map: PluggableMap

      Map.

    Returns void

setMaxResolution

  • setMaxResolution(maxResolution: number): void
  • Set the maximum resolution at which the layer is visible.

    observable
    api

    Parameters

    • maxResolution: number

      The maximum resolution of the layer.

    Returns void

setMaxZoom

  • setMaxZoom(maxZoom: number): void
  • Set the maximum zoom (exclusive) at which the layer is visible. Note that the zoom levels for layer visibility are based on the view zoom level, which may be different from a tile source zoom level.

    observable
    api

    Parameters

    • maxZoom: number

      The maximum zoom of the layer.

    Returns void

setMinResolution

  • setMinResolution(minResolution: number): void
  • Set the minimum resolution at which the layer is visible.

    observable
    api

    Parameters

    • minResolution: number

      The minimum resolution of the layer.

    Returns void

setMinZoom

  • setMinZoom(minZoom: number): void
  • Set the minimum zoom (inclusive) at which the layer is visible. Note that the zoom levels for layer visibility are based on the view zoom level, which may be different from a tile source zoom level.

    observable
    api

    Parameters

    • minZoom: number

      The minimum zoom of the layer.

    Returns void

setOpacity

  • setOpacity(opacity: number): void
  • Set the opacity of the layer, allowed values range from 0 to 1.

    observable
    api

    Parameters

    • opacity: number

      The opacity of the layer.

    Returns void

setProperties

  • setProperties(values: Object, opt_silent: boolean): void
  • 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).

    api

    Parameters

    • values: Object

      Values.

    • opt_silent: boolean

      Update without triggering an event.

    Returns void

setSource

  • setSource(source: SourceType): void
  • Set the layer source.

    observable
    api

    Parameters

    • source: SourceType

      The layer source.

    Returns void

setVisible

  • setVisible(visible: boolean): void
  • Set the visibility of the layer (true or false).

    observable
    api

    Parameters

    • visible: boolean

      The visibility of the layer.

    Returns void

setZIndex

  • setZIndex(zindex: number): void
  • Set Z-index of the layer, which is used to order layers before rendering. The default Z-index is 0.

    observable
    api

    Parameters

    • zindex: number

      The z-index of the layer.

    Returns void

un

  • un(type: string | string[], listener: {}): void
  • Unlisten for a certain type of event.

    api

    Parameters

    • type: string | string[]

      The event type or array of event types.

    • listener: {}

      The listener function.

    Returns void

unset

  • unset(key: string, opt_silent: boolean): void
  • Unsets a property.

    api

    Parameters

    • key: string

      Key name.

    • opt_silent: boolean

      Unset without triggering an event.

    Returns void

Generated using TypeDoc