WAB Edit Widget - Trace Features

218
2
02-27-2021 06:24 AM
DavidPike
MVP Regular Contributor

WAB Standalone Enterprise Portal10.6.1

Oracle SDE-served Feature Service

Hi,

We have an editable polygon feature service, and snapping is possible by holding Ctrl on vertex creation.

Is tracing at all possible? - both to itself and other separate feature services such as land parcels etc.?

If not, do you have any suggestions/workarounds?

Cheers.

2 Replies
LongDinh
New Contributor III

Hi David Pike,

I imagine it would be possible by creating a new widget or extending the Edit/Draw Widgets in JavaScript 3.x/4.x or TypeScript. I am not aware of any open source solutions. 

Thinking conceptually, I would start with creating a new WAB Widget with a similar workflow to ArcMap/Pro's trace functionality. The widget should:

  1. Select a layer/s to be used to trace.
    1. Add the layer's geometry to a feature set containing Points, Lines, Polylines,
  2. Create a feature/graphic.
    1. Uses the ESRI Draw tools JS library
    2. Add some event handlers to draw tools

Steps 2 will have most of the challenges, specifically the event handlers. Some event handlers to replicate the Trace create feature tool in JS may be:

  1. On 1st map click: begin draw. If within snapping tolerance of trace feature set geometry and snap to feature and geometry, else, draw by map click
  2. On next map click: check snapping tolerance to trace feature set geometry and snap to feature and geometry, or release trace.
  3. If snapped to feature set, read the next/previous feature segment of the geometry. paths
  4. On double click: release and finish feature. (close out polygon if incomplete)
  5. and more.

 

 

0 Kudos
DavidPike
MVP Regular Contributor

Thanks very much for the ideas.

0 Kudos