map.apps Bundle APIs 4.20.0
    Preparing search index...

    Interface GroundConfigParser

    Parses ground configurations into instances of @arcgis/core/Ground.

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

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

    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 @arcgis/core/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 @arcgis/core/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 @arcgis/core/Ground
      });