Class MaskLayer<UserData>

A ColorLayer that can be used to mask parts of a map. The source can be any source supported by the color layers.

Type Parameters

Hierarchy

Constructors

  • Creates a mask layer. It should be added in a Map to be displayed in the instance. See the example for more information on layer creation.

    Type Parameters

    Parameters

    Returns MaskLayer<UserData>

Properties

_composer: LayerComposer
_maskMode: MaskMode
_queue: RequestQueue
backgroundColor: Color
colorMap: ColorMap

The colormap of this layer

computeMinMax: boolean
disposed: boolean
extent: Extent

The extent of this layer

frozen: boolean = false

Disables automatic updates of this layer. Useful for debugging purposes.

id: string

The unique identifier of this layer.

interpretation: Interpretation
isColorLayer: boolean = true

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

isLayer: boolean = true

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

isMaskLayer: boolean = true

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

isPickableFeatures: true = true
name: string

Optional name of this layer.

noDataOptions: NoDataOptions
resolutionFactor: number

The resolution factor applied to the textures generated by this layer.

showEmptyTextures: boolean
showTileBorders: boolean
source: ImageSource

The source of this layer

type: string
userData: UserData

An object that can be used to store custom data about the Layer.

Accessors

  • get brightness(): number
  • Gets or sets the brightness of this layer.

    Returns number

  • set brightness(v): void
  • Parameters

    • v: number

    Returns void

  • get colorimetry(): ColorimetryOptions
  • Gets the colorimetry parameters of this layer.

    Returns ColorimetryOptions

  • get composer(): Readonly<LayerComposer>
  • Returns Readonly<LayerComposer>

  • get contrast(): number
  • Gets or sets the contrast of this layer.

    Returns number

  • set contrast(v): void
  • Parameters

    • v: number

    Returns void

  • get elevationRange(): ElevationRange
  • Gets the elevation range of this layer, if any.

    Returns ElevationRange

  • set elevationRange(range): void
  • Sets the elevation range of this layer. Setting it to null removes the elevation range.

    Parameters

    Returns void

  • get loading(): boolean
  • Gets whether the object is currently performing an asynchronous operation.

    Returns boolean

  • get maskMode(): MaskMode
  • Gets or set the mask mode.

    Returns MaskMode

  • set maskMode(v): void
  • Parameters

    • v: MaskMode

    Returns void

  • get opacity(): number
  • Gets or sets the opacity of this layer.

    Returns number

  • set opacity(v): void
  • Parameters

    • v: number

    Returns void

  • get progress(): number
  • Returns the percentage of progress, in normalized value (i.e in the [0, 1] range), of the asynchronous operations that are scheduled to run on this object. 1 means that all operations have finished.

    Returns number

  • get ready(): boolean
  • Returns boolean

  • get saturation(): number
  • Gets or sets the saturation of this layer.

    Returns number

  • set saturation(v): void
  • Parameters

    • v: number

    Returns void

  • get visible(): boolean
  • Gets or sets the visibility of this layer.

    Returns boolean

  • set visible(v): void
  • Parameters

    • v: boolean

    Returns void

Methods

  • Adds a listener to an event type.

    Type Parameters

    Parameters

    • type: T

      The type of event to listen to.

    • listener: EventListener<(ColorLayerEvents & LayerEvents)[T], T, MaskLayer<UserData>>

      The function that gets called when the event is fired.

    Returns void

  • Type Parameters

    • T extends string

    Parameters

    • type: T
    • listener: EventListener<{}, T, MaskLayer<UserData>>

    Returns void

  • Adjusts the extent to avoid visual artifacts.

    Parameters

    • originalExtent: Extent

      The original extent.

    • originalWidth: number

      The width, in pixels, of the original extent.

    • originalHeight: number

      The height, in pixels, of the original extent.

    Returns {
        extent: Extent;
        height: number;
        width: number;
    }

    And object containing the adjusted extent, as well as adjusted pixel size.

    • extent: Extent
    • height: number
    • width: number
  • Parameters

    • target: Target

      The target.

    Returns void

  • Parameters

    • result: TextureAndPitch
    • target: Target

    Returns void

  • Parameters

    • target: Target

    Returns boolean

  • Resets all render targets to a blank state and repaint all the targets.

    Returns void

  • Parameters

    • extent: Extent

      The extent to test.

    Returns boolean

    true if this layer contains the specified extent, false otherwise.

  • Disposes the layer. This releases all resources held by this layer.

    Returns void

  • Returns the final extent of this layer. If this layer has its own extent defined, this will be used. Otherwise, will return the source extent (if any). May return undefined if not pre-processed yet.

    Returns Extent

    The layer final extent.

  • Returns an approximation of the memory used by this object, in bytes.

    Parameters

    • context: GetMemoryUsageContext

      The graphics context.

    • Optional target: MemoryUsageReport

      If specified, the values computed during this call must be added to the existing values in the target. Otherwise, a new report must be built.

    Returns MemoryUsageReport

    The memory usage report. If target is specified, then this must be returned.

  • Returns all features at some coordinates, with an optional hit tolerance radius.

    Returns Feature<Geometry>[]

    Array of features at coordinates (can be empty)

  • Get all features whose bounding box intersects the provided extent. Note that this returns an array of all features intersecting the given extent in random order (so it may include features whose geometries do not intersect the extent).

    Returns Feature<Geometry>[]

    Array of features intersecting the extent (can be empty)

  • Checks if listener is added to an event type.

    Type Parameters

    Parameters

    • type: T

      The type of event to listen to.

    • listener: EventListener<(ColorLayerEvents & LayerEvents)[T], T, MaskLayer<UserData>>

      The function that gets called when the event is fired.

    Returns boolean

  • Type Parameters

    • T extends string

    Parameters

    • type: T
    • listener: EventListener<{}, T, MaskLayer<UserData>>

    Returns boolean

  • Called when the layer has finished initializing.

    Returns Promise<void>

  • Parameters

    • texture: Texture

    Returns void

  • Returns void

  • Parameters

    Returns void

  • Removes a listener from an event type.

    Type Parameters

    Parameters

    Returns void

  • Type Parameters

    • T extends string

    Parameters

    • type: T
    • listener: EventListener<{}, T, MaskLayer<UserData>>

    Returns void

  • Removes the node from this layer.

    Parameters

    • node: Node

      The disposed node.

    Returns void

  • Updates the provided node with content from this layer.

    Parameters

    • context: Context

      the context

    • node: Node

      the node to update

    Returns void

  • Parameters

    • material: NodeMaterial

    Returns void

Generated using TypeDoc