Not able to use Elevation Profile Es Module.

242
1
05-05-2021 08:44 AM
GiovanniVanore1
New Contributor II
Hello All,

Working on ArcGIS ES module and its working pretty great. But now not able to use elevation Profile in the app.
 
here is my code.
 
import ElevationProfile from '@arcgis/core/widgets/ElevationProfile';
 
var elevationProfile = new ElevationProfile(
    {
    view: view,
    // configure widget with desired profile lines
    profiles: [
      {
        type: "ground" // first profile line samples the ground elevation
      },
      {
        type: "view" // second profile samples the view and shows building profiles
      }
    ],
    // hide the select button
    // this button can be displayed when there are polylines in the
    // scene to select and display the elevation profile for
    visibleElements: {
      selectButton: false
    }
  }
 );
 
Error : -
 
Error: ./node_modules/@arcgis/core/widgets/ElevationProfile/ElevationProfileController.js 110:16
Module parse failed: Unexpected token (110:16)
File was processed with these loaders:
* ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js
* ./node_modules/@ngtools/webpack/src/ivy/index.js
You may need an additional loader to handle the result of these loaders.
|
| try {
> for await (const t of o) {
| m(e), _this._clearInvalidResults(s);
|
 
0 Kudos
1 Reply
AndyGup
Esri Regular Contributor

Hi @GiovanniVanore1 that error looks like it has something to do with your Angular configuration. I tried your code in our Angular ESM sample and it worked: https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-angular-cli

0 Kudos