Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Mask<SourceType, SourceType>

Type parameters

  • SourceType: Source

  • SourceType: Source

Hierarchy

  • Layer
  • Layer
    • Mask

Index

Constructors

constructor

  • new Mask(layerOptions?: Options, maskOptions?: Options): Mask
  • Parameters

    • Default value layerOptions: Options = {}
    • Default value maskOptions: Options = {}

    Returns Mask

Methods

addEventListener

  • addEventListener(type: string, listener: Listener): void
  • Parameters

    • type: string

      Type.

    • listener: Listener

      Listener.

    Returns void

changed

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

    api

    Returns void

createExtent

  • createExtent(center: Coordinate, halfLength: number): Extent
  • Parameters

    • center: Coordinate
    • halfLength: number

      a half length of a square's side.

    Returns Extent

    an extent.

dispatchEvent

  • dispatchEvent(event: BaseEvent | string): boolean | undefined
  • 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: BaseEvent | string

      Event object.

    Returns boolean | undefined

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

dispose

  • dispose(): void
  • Clean up.

    Returns void

get

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

    api

    Parameters

    • key: string

      Key name.

    Returns any

    Value.

getClassName

  • getClassName(): string

getExtent

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

    observable
    api

    Returns Array | undefined

    The layer extent.

getFeatures

  • getFeatures(pixel: Array): Promise<Array<any>>
  • Parameters

    • pixel: Array

      Pixel.

    Returns Promise<Array<any>>

    Promise that resolves with an array of features.

getKeys

  • getKeys(): Array<string>
  • Get a list of object property names.

    api

    Returns Array<string>

    List of property names.

getLayerState

  • getLayerState(opt_managed?: boolean | undefined): { extent?: Array; layer: any; managed: boolean; maxResolution: number; maxZoom: number; minResolution: number; minZoom: number; opacity: number; sourceState: any; visible: boolean; zIndex: number }
  • 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

    • Optional opt_managed: boolean | undefined

      Layer is managed.

    Returns { extent?: Array; layer: any; managed: boolean; maxResolution: number; maxZoom: number; minResolution: number; minZoom: number; opacity: number; sourceState: any; visible: boolean; zIndex: number }

    Layer state.

    • Optional extent?: Array
    • layer: any
    • managed: boolean
    • maxResolution: number
    • maxZoom: number
    • minResolution: number
    • minZoom: number
    • opacity: number

      Opacity, the value is rounded to two digits to appear after the decimal point.

    • sourceState: any
    • visible: boolean
    • zIndex: number

getLayerStatesArray

  • getLayerStatesArray(opt_states?: Array<{ extent?: Array; layer: any; managed: boolean; maxResolution: number; maxZoom: number; minResolution: number; minZoom: number; opacity: number; sourceState: any; visible: boolean; zIndex: number }> | undefined): Array<{ extent?: Array; layer: any; managed: boolean; maxResolution: number; maxZoom: number; minResolution: number; minZoom: number; opacity: number; sourceState: any; visible: boolean; zIndex: number }>
  • abstract

    Parameters

    • Optional opt_states: Array<{ extent?: Array; layer: any; managed: boolean; maxResolution: number; maxZoom: number; minResolution: number; minZoom: number; opacity: number; sourceState: any; visible: boolean; zIndex: number }> | undefined

      Optional list of layer states (to be modified in place).

    Returns Array<{ extent?: Array; layer: any; managed: boolean; maxResolution: number; maxZoom: number; minResolution: number; minZoom: number; opacity: number; sourceState: any; visible: boolean; zIndex: number }>

    List of layer states.

getLayersArray

  • getLayersArray(opt_array?: Array<any> | undefined): Array<any>
  • abstract

    Parameters

    • Optional opt_array: Array<any> | undefined

      Array of layers (to be modified in place).

    Returns Array<any>

    Array of layers.

getListeners

  • getListeners(type: string): Array<Listener> | undefined
  • 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 Array<Listener> | undefined

    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(): {}
  • Get an object of all property names and values.

    api

    Returns {}

    Object.

    • [x: string]: any

getRenderer

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

    Returns 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(): any

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 | undefined): boolean
  • Parameters

    • Optional opt_type: string | undefined

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

    Returns boolean

    Has listeners.

hasProperties

  • hasProperties(): boolean
  • Returns boolean

    The object has properties.

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 | Array<string>, listener: (arg0: unknown) => unknown): { listener: ListenerFunction; target: EventTargetLike; type: string } | Array<{ listener: ListenerFunction; target: EventTargetLike; type: string }>
  • Listen for a certain type of event.

    api

    Parameters

    • type: string | Array<string>

      The event type or array of event types.

    • listener: (arg0: unknown) => unknown

      The listener function.

        • (arg0: unknown): unknown
        • Parameters

          • arg0: unknown

          Returns unknown

    Returns { listener: ListenerFunction; target: EventTargetLike; type: string } | Array<{ listener: ListenerFunction; target: EventTargetLike; type: string }>

    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 | Array<string>, listener: (arg0: unknown) => unknown): { listener: ListenerFunction; target: EventTargetLike; type: string } | Array<{ listener: ListenerFunction; target: EventTargetLike; type: string }>
  • Listen once for a certain type of event.

    api

    Parameters

    • type: string | Array<string>

      The event type or array of event types.

    • listener: (arg0: unknown) => unknown

      The listener function.

        • (arg0: unknown): unknown
        • Parameters

          • arg0: unknown

          Returns unknown

    Returns { listener: ListenerFunction; target: EventTargetLike; type: string } | Array<{ listener: ListenerFunction; target: EventTargetLike; type: string }>

    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: Listener): void
  • Parameters

    • type: string

      Type.

    • listener: Listener

      Listener.

    Returns void

render

  • render(frameState: FrameState): HTMLCanvasElement
  • Parameters

    • frameState: FrameState

    Returns HTMLCanvasElement

set

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

    api

    Parameters

    • key: string

      Key name.

    • value: any

      Value.

    • Optional opt_silent: boolean | undefined

      Update without triggering an event.

    Returns void

setExtent

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

    observable
    api

    Parameters

    • extent: Array | undefined

      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: {}, opt_silent?: boolean | undefined): 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: {}

      Values.

      • [x: string]: any
    • Optional opt_silent: boolean | undefined

      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 | Array<string>, listener: (arg0: unknown) => unknown): void
  • Unlisten for a certain type of event.

    api

    Parameters

    • type: string | Array<string>

      The event type or array of event types.

    • listener: (arg0: unknown) => unknown

      The listener function.

        • (arg0: unknown): unknown
        • Parameters

          • arg0: unknown

          Returns unknown

    Returns void

unset

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

    api

    Parameters

    • key: string

      Key name.

    • Optional opt_silent: boolean | undefined

      Unset without triggering an event.

    Returns void

Generated using TypeDoc