ThinkGeo.com    |     Documentation    |     Premium Support

VertexAdding not accepting set value

Hi,

I use a snapping layer to allow user to draw shapes that snap to points in the snapping layer; however, it appears in v14 that setting the AddingVertex of interactive overlay with the closest snap point is not being honored once it leaves this event. Here is the code I used in v10.

    void Track_VertexAdding(object sender, VertexAddingTrackInteractiveOverlayEventArgs e)
    {
        SnapOverlay snap = WinMap.EditOverlay as SnapOverlay;
        PointShape closestPoint = SnapOverlay.FindNearestSnappingPoint(snap.ToSnapInMemoryFeatureLayer, SnapSettings,
            new PointShape(e.AddingVertex), WinMap.CurrentExtent, WinMap.Width, WinMap.Height);
        if (closestPoint == null) return;
        e.AddingVertex = new Vertex(closestPoint);
    }