Parses ground configurations into instances of esri/Ground.

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

interface GroundConfigParser {
    parse(
        config: string | any[] | GroundProperties,
    ): Promise<{ instance: Ground }>;
}

Methods

Methods

  • Parses ground layer configurations.

    Parameters

    Returns Promise<{ instance: Ground }>

    A promise which resolves to { instance : groundlayer {.

    // well known ground name
    configParser.parse("world-elevation").then((result) => {
    // result.instance is esri/Ground
    });
    // array of elevation layers
    configParser.parse([{
    "url": "http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",
    "type": "AGS_ELEVATION"
    }]).then((result) => {
    // result.instance is esri/Ground
    });
    // ground config object, the only way to add additional properties, like "title"
    configParser.parse({
    title: "My Ground Name",
    layers: [{
    "url": "http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",
    "type": "AGS_ELEVATION"
    }, {
    "url": "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Elevation/MtBaldy_Elevation/ImageServer",
    "type": "AGS_ELEVATION"
    }]
    }).then((result) => {
    // result.instance is esri/Ground
    });
MMNEPVFCICPMFPCPTTAAATR