SketchViewModel – 2D snapping with automatic Z (like in ArcGIS Pro)

83
1
Tuesday
KrzysztofNoga
Emerging Contributor

When sketching with snapping on a 2D map, I'd like to achieve the same effect as in ArcGIS Pro. That is, the Z coordinate would be taken from the clicked vertex of another object, or if we click an edge, it would be calculated based on the vertices of the clicked edge.

Can this behavior be achieved using Sketch or SketchViewModel from the ArcGIS Maps SDK for JavaScript?

There is a video in the attachment showing the behavior in ArcGIS Pro.

0 Kudos
1 Reply
JonathanDawe_BAS
Regular Contributor

Unfortunately I don't think this is possible in the ArcGIS JS API. The client side geometry engine (and new geometry operators) mostly only work with 2D geometries. From past experience, the standard behaviour was that geometries in 2d maps didn't even bother bringing down the z coordinate in the requested geometries. 

 

The issue is that this is a surprisingly non-trivial problem. A z-coordinate could represent an absolute height or a height relative to an underlying elevation surface. This means that it might not be as simple to interpolate a vertical height between the two points on an edge, you may need to also account for the underlying elevation model you are using.

 

 

0 Kudos