Javascript API, elevation layer query

797
2
Jump to solution
04-11-2020 01:49 AM
ManolisNikolakakis
New Contributor II

Hello!
What I want to do is retrieve the elevation of a known point using ArcGIS javascript 4.14. A working example of an an elevation layer query based on the following https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryE... would be great.

I have a similar piece of code in the following link https://codepen.io/nikolakakis/pen/jObOjEv?editors=1111  I always get the error Failed to query elevation: TypeError: Cannot read property 'wkid' of undefined

I tried with an Elevation layer I uploaded and made it public with the same results. 

var layer = new ElevationLayer({
       portalItem: {  // public Elevation layer
           id: "258fc22265f74dfb9a7b2d48338ff2de"
        }
 });‍‍‍‍‍

Does the

https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryE... example indeed return an error or do I miss something here?

Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Frequent Contributor

The syntax to create a Multipoint is incorrect.

// Incorrect
new Multipoint(points)

// Correct
new Multipoint({points: points})

Once I fixed that, your codepen sample worked.

View solution in original post

2 Replies
ReneRubalcava
Frequent Contributor

The syntax to create a Multipoint is incorrect.

// Incorrect
new Multipoint(points)

// Correct
new Multipoint({points: points})

Once I fixed that, your codepen sample worked.

ManolisNikolakakis
New Contributor II

Thank you Rene,

much appreciated.

0 Kudos