void map_Tap(object sender, System.Windows.Input.GestureEventArgs e) { Point p = e.GetPosition(map);//获得在map容器的像素坐标 if (start == null) { start = map.FromScreenPixelToLngLat(p);//确定起点 startText.Text = start.ToString(); map.Children.Add(new MMarker() { LngLat = start, IsEditable = true, IconURL = "/bus_start_pic.jpg", Anchor = new Point(0.5, 1) }); } else if (end == null) { end = map.FromScreenPixelToLngLat(p);//确定终点 endText.Text = start.ToString(); map.Children.Add(new MMarker() { LngLat = end, IconURL = "/bus_end_pic.jpg", Anchor = new Point(0.5, 1) }); } }