ThinkGeo.com    |     Documentation    |     Premium Support

TrackOverlay.VertexAdding

Hi,

I try to snap to the nearest point when creating a shape. The method bellow works but only for the first point of the shape. Then the method is still fired and TargetPointShape and AddingVerted are set but in the end the point is not snapped. Did I miss something here ?

private void TrackOverlay_VertexAdding(object sender, VertexAddingTrackInteractiveOverlayEventArgs e)
{
  PointShape targetPointShape = new(e.AddingVertex.X, e.AddingVertex.Y);
  PointShape nearPS = FindNearestSnappingPoint(targetPointShape);

  if (nearPS != null)
  {
    e.AddingVertex = new Vertex(nearPS.X, nearPS.Y);
    e.TargetPointShape = nearPS;
  }
}

Hi Judicaël,

It was recreated and fixed in beta097, which supports both .net9-android and .net10-android. Pull the latest and have a try.

NuGet Gallery | ThinkGeo.UI.Android 14.5.0-beta097

Thanks,
Ben