A custom layer source implementation It is used to load and display weather data from the WxTiles server.

Example

const wxapi = new WxAPI({ 'http://dataserver.com' });

const datasetName = 'gfs.global';
const variable = 'air.temperature.at-2m'; // Scalar example

// Create a dataset manager (may be used for many layers from this dataset)
const wxdatasetManager = await wxapi.createDatasetManager(datasetName);

// get proper representation of the variable
const variables = wxdatasetManager.checkCombineVariableIfVector(variable);

// create a layer source
const wxsource = new WxTileSource({ wxdatasetManager, variables }, { id: 'wxsource', attribution: 'WxTiles' });

Or use the createSourceLayer method to create a layer/source in one step.

Hierarchy

Implements

Constructors

Properties

_needUpdateDSManager: boolean = false

A boolean flag indicating whether the dataset manager needs to be updated or not.

id: string

Accessors

Methods

  • Internal

    Used by framework. Creates a representation of a tile for the framework.

    Returns

    • A picture of the tile.

    Parameters

    • coords: Coords
    • done: DoneCallback

    Returns HTMLElement

  • Internal

    Description

    Called when the layer is removed from a map.

    Returns

    • The WxTileSource instance.

    Parameters

    • map: Map

      The map instance.

    Returns WxTileSource

  • Set the style of the source by its name from default styles.

    Returns

    A promise that resolves when the style is set.

    Parameters

    • wxstyleName: string

      Name of the new style to set.

    • reload: boolean = true

      If true, the source will be reloaded and rerendered.

    Returns Promise<void>

Generated using TypeDoc