I have a use case that is not covered under the three snapping modes available in the anchoredSnapper.
My candidates are a set of lines, the anchors can be either lines or polygons, but for this discussion will be polygons.
The lines need to have their end points (and only their endpoints) snapped to the nearest polygon segment. The rest of the vertices of the line should remain untouched.
Currently I am developing the following workflow:
Create a unique id for the lines.
Extract the end points of the candidate lines, send them to an anchoredSnapper with the polygons as the anchor, use snapping type Segment.
Take the original lines and send them to a second AnchoredSnapper with the points as anchors and snapping type End Point, grouped by unique id.
Is there a better solution I'm overlooking?