Update the SDK SnapResult Class to Clarify Point Locations

573
0
09-30-2021 05:00 PM
Status: Open
Labels (1)
DavidHowes
New Contributor III

Update the SnapResult class to distinguish between three points:

- the click point;
- the point to which the click point is snapped if it lies within the snapping tolerance area;
- the point to which the click point would be snapped if it were to lie within the snapping tolerance area.

Here's why:

SnapResults are provided in the OnSketchCompleteAsync event handler.

If the click point is snapped to only one feature point

- the geometry provided to the handler is set to the snap point
- the first SnapResult object will provide
-- Layer
-- OID
-- SnapLocation
-- SnapType

where the SnapLocation is equal to the geometry location.

If the click point is outside the snap tolerance area

- the geometry will represent the click location
- Layer will be empty
- OID will be -1
- SnapLocation will be the point to which the click point would be snapped if it were to lie within the snapping tolerance area
- SnapType will be None

It's confusing to use the SnapLocation property in two different ways. What the SnapResults say in the second case is that no snapping occurred, but here's the snap location.

Furthermore, knowing the click location is sometimes helpful, but there may be no way to get it because handling the MouseDown event causes OnSketchCompleteAsync not to fire.

Updating the SnapResult class properties as follows would provide greater clarity along with the three potentially useful locations:

- Layer
- OID
- ClickPoint
- SnapPoint
- PotentialSnapPoint
- SnapType

where, using the descriptions from above,

- ClickPoint is the click point,
- SnapPoint is the point to which the click point is snapped if it lies within the snapping tolerance area, and
- PotentialSnapPoint is the point to which the click point would be snapped if it were to lie within the snapping tolerance area.

Note that "Point" is clearer than "Location" to describe what the corresponding property provides.

No new computation is required. I'm simply asking that the captured and computed point locations are made available and clearly distinguished.