private void Map_MouseMoveEvent(object sender, AxMapPoint._IMappointCtrlEvents_MouseMoveEvent e) { if (MeasureDistance && p1) { if (linea!=null) linea.Delete(); linea = Map.ActiveMap.Shapes.AddLine(point1, Map.ActiveMap.XYToLocation(e.x, e.y)); } }
private void Map_BeforeClick(object sender, AxMapPoint._IMappointCtrlEvents_BeforeClickEvent e) { if (MeasureDistance) { if (!p1) { point1 = Map.ActiveMap.XYToLocation(e.x, e.y); p1 = true; } else { point2 = Map.ActiveMap.XYToLocation(e.x, e.y); Map.ActiveMap.Shapes.AddShape(MapPoint.GeoAutoShapeType.geoShapeOval, point2, 100, 100); Map.ActiveMap.Shapes.AddLine(point1, point2); double distance = Map.ActiveMap.Distance(point1, point2); MessageBox.Show("Distanza rilevata: " + Math.Round(distance, 2) + " Km"); MeasureDistance = false; Map.MousePointer = MapPoint.GeoPointer.geoPointerArrow; p1 = false; } } }
private void Map_BeforeDblClick(object sender, AxMapPoint._IMappointCtrlEvents_BeforeDblClickEvent e) { if (GetLocation) { TempLocation = this.Map.ActiveMap.XYToLocation(e.x, e.y); GetLocation = true; mainFrm.frm_obiettivo.setNewLocation(TempLocation); } }