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);
    }

hi @Damian_Hite ,

Just a quick update. I’m working on it. Will keep you posted.

Regards,
Leo

Hi @Damian_Hite,

I’ve fixed the issue in the latest beta(ThinkGeo.UI.wpf 14.4.0-beta092), could you upgrade and give it a try?

I also created a sample for your scenario, I moved the adding vertex 2000 meters to right, so you could see that every vertex I added was 2000 meters to right of where I clicked.
vertex_adding_sample.zip (13.6 KB)

Regards,
Leo

Hi Leo,

Yes, confirmed it is working. Thanks!

Great! Let me know if have any questions. :slight_smile:

Regards,
Leo