GetCurrentPoint() public method

${core_FeaturePointerRoutedEventArgs_method_GetCurrentPoint_D}
public GetCurrentPoint ( UIElement element ) : PointerPoint
element Windows.UI.Xaml.UIElement
return Windows.UI.Input.PointerPoint
Example #1
0
 private void editLayer_PointerPressed(object sender, FeaturePointerRoutedEventArgs args)
 {
     Point2D startGeoRegion = Map.ScreenToMap(args.GetCurrentPoint(Map).Position);
     args.Handler = true;
     Map.Focus(Windows.UI.Xaml.FocusState.Pointer);
     startEdit(args.Feature , false , startGeoRegion);
 }
Example #2
0
 private void virtualLayer_PointerPressed(object sender, FeaturePointerRoutedEventArgs args)
 {
     args.Handler = true;
     Feature hoverFeature = args.Feature;
     if (hoverFeature == hoverCenterFeature)
     {
         prepareMoveLineOrRegionFeature(( hoverCenterFeature.Geometry as GeoPoint ).Location);
     }
     else
         if (hoverFeature.Geometry is GeoPoint)
         {
             prepareMovePointFeature(hoverFeature);
         }
         else if (hoverFeature.Geometry is GeoLine)
         {
             Point2D pMap = Map.ScreenToMap(args.GetCurrentPoint(Map).Position);
             addOneVertex(hoverFeature , pMap);
         }
 }
Example #3
0
 private void virtualLayer_PointerMoved(object sender, FeaturePointerRoutedEventArgs args)
 {
     Feature hoverFeature = args.Feature;
     //在虚拟线上,并且没遇到虚拟顶点 ,显示捕捉点
     if (draggingVertex == null && hoverFeature.Geometry is GeoLine)
     {
         GeoLine line = hoverFeature.Geometry as GeoLine;
         Point2D pMap = Map.ScreenToMap(args.GetCurrentPoint(Map).Position);
         Point2D snap = FindPointOnLineClosestToPoint(line.Parts[0][0] , line.Parts[0][1] , pMap);
         if (snapVertex == null)
         {
             snapVertex = new Feature() { Style = SnapStyle , Geometry = new GeoPoint(snap) };
             hoverLayer.Features.Add(snapVertex);
         }
         else
         {
             snapVertex.Geometry = new GeoPoint(snap);
         }
     }
 }