Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Layers

A Layers object is responsible for fetching and caching Aeris Maps (AMP) layers metadata as well as providing utility methods for returning and comparing layer information.

export

Hierarchy

Index

Constructors

constructor

  • Initializes and returns a new Layers instance.

    Layer metadata will be requested immediate if it has not already been cached by the library.

    memberof

    Layers

    Parameters

    Returns Layers

Accessors

validTimes

  • Returns the LayerTimes instance that can be used to fetch and return the valid times for AerisWeather Maps layers.

    readonly
    memberof

    Layers

    Returns LayerTimes

Methods

cached

  • cached(): boolean
  • Returns whether layer metadata is already cached.

    memberof

    Layers

    Returns boolean

exists

  • exists(layer: string): boolean
  • Returns whether the specified layer exists within AMP.

    memberof

    Layers

    Parameters

    • layer: string

    Returns boolean

fetch

  • Return the layer metadata.

    If the data has not already been loaded and cached, this method will perform a new request before resolving the Promise with the data.

    memberof

    Layers

    Returns Promise<void | LayerConfig[]>

find

  • find(prop: string, value: any, strict?: boolean): LayerConfig
  • Returns the layer metadata that matches the query based on the specified property and value.

    If strict is true, then the check will perform an equal comparison rather than a simple pattern match.

    memberof

    Layers

    Parameters

    • prop: string
    • value: any
    • Default value strict: boolean = false

    Returns LayerConfig

findAll

  • findAll(prop: string, values: string[], strict?: boolean): LayerConfig[]
  • Returns an array of layer metadata for all layers that match the query based on the specified property and values.

    If strict is true, then the check will perform an equal comparison rather than a simple pattern match.

    memberof

    Layers

    Parameters

    • prop: string
    • values: string[]
    • Default value strict: boolean = false

    Returns LayerConfig[]

findInvalidIds

  • findInvalidIds(ids: string | Array<string>): Array<string>
  • Parameters

    • ids: string | Array<string>

    Returns Array<string>

future

  • Returns an array of future layer metadata.

    memberof

    Layers

    Returns LayerConfig[]

futureCodes

  • futureCodes(): string[]
  • Returns an array of future layer identifiers.

    memberof

    Layers

    Returns string[]

groups

  • groups(): any
  • Returns the layer groups.

    memberof

    Layers

    Returns any

has

  • has(type: string): boolean
  • Returns whether the listeners are registered for the specified event name.

    memberof

    EventDispatcher

    Parameters

    • type: string

    Returns boolean

hasMetric

  • hasMetric(id: string): boolean
  • Returns whether the specified layer identifier has metric data, specifically for text layers.

    memberof

    Layers

    Parameters

    • id: string

    Returns boolean

inGroup

  • inGroup(id: string, group: string, strict?: boolean): boolean
  • Returns whether the layer for the identifier is part of the specified group.

    If strict is true, then the check will perform an equal comparison rather than a simple pattern match.

    memberof

    Layers

    Parameters

    • id: string
    • group: string
    • Default value strict: boolean = false

    Returns boolean

isBase

  • isBase(id: string): boolean
  • Returns whether the specified layer identifier is a base layer.

    memberof

    Layers

    Parameters

    • id: string

    Returns boolean

isFuture

  • isFuture(id: string): boolean
  • Returns whether the specified layer identifier is a future layer.

    memberof

    Layers

    Parameters

    • id: string

    Returns boolean

isOverlay

  • isOverlay(id: string): boolean
  • Returns whether the specified layer identifier is an overlay layer.

    memberof

    Layers

    Parameters

    • id: string

    Returns boolean

loading

  • loading(): boolean
  • Returns whether layer metadata is currently being requested.

    memberof

    Layers

    Returns boolean

off

  • Removes a registered listener function for the specified event.

    memberof

    EventDispatcher

    Parameters

    • type: string

      Name of the event to remove the listener for.

    • callback: Function

      Handler function to remove so it won't be executed next time the event is triggered.

    • Default value scope: any = null

    Returns EventDispatcher

offAll

on

  • on(type: string, callback: Function, scope?: any, priority?: number): EventDispatcher
  • Registers a listener function to be executed each time an event occurs

    memberof

    EventDispatcher

    Parameters

    • type: string

      Name of the event to listen for. Value can contain multiple event names separated by spaces to trigger the same handler function for each event name.

    • callback: Function

      Handler function to be called when the event occurs

    • Default value scope: any = null
    • Default value priority: number = 0

    Returns EventDispatcher

once

  • once(type: string, callback: Function, scope?: any, priority?: number): EventDispatcher
  • Registers a listener function to be executed the first time an event occurs.

    memberof

    EventDispatcher

    Parameters

    • type: string

      Name of the event to listen for. Value can contain multiple event names separated by spaces to trigger the same handler function for each event name.

    • callback: Function

      Handler function to be called when the event occurs

    • Default value scope: any = null
    • Default value priority: number = 0

    Returns EventDispatcher

trigger

  • Triggers the specified event so that all registered listeners will be executed with the specified parameters.

    memberof

    EventDispatcher

    Parameters

    • type: any

      Event name to trigger

    • Default value data: any = null

    Returns EventDispatcher

Generated using TypeDoc