Parses layer configurations.

Use service name "map-config-api.LayerConfigParser" to inject an instance of this class.

interface LayerConfigParser {
    parse(configs: any[]): Promise<Layer[]>;
}

Methods

Methods

  • Parses array of layer configurations.

    Parameters

    • configs: any[]

      An array of configuration items.

    Returns Promise<Layer[]>

    A promise which resolves to an array of layer instances.

    configParser.parse([{
    "visible": true,
    "url": "http://water.discomap.eea.europa.eu/arcgis/rest/services/BathingWater/BathingWater_Dyna_WM/MapServer",
    "type": "AGS_DYNAMIC",
    "sublayers": ["*"]
    }]).then((layers) => {
    // layers[0] is instance of esri/layers/MapImageLayer
    });