private void delete_Click(object sender, EventArgs e) { AddXML.removeEvent(Event.getIndex((GMapMarker)mark)); Console.WriteLine(Event.getIndex((GMapMarker)mark)); ((MainForm)root).removeMarker(mark); Close(); }
private void Connect_Click(object sender, EventArgs e) { ((MainForm)root).drawLine(Event.getIndex(mark), Int32.Parse(connectID.Text)); AddXML.addConnection(Event.getIndex(mark), Int32.Parse(connectID.Text)); (root).Refresh(); ((MainForm)root).GetGMapControl().Refresh(); this.Close(); }
public void doConnections() { foreach (var keys in markers) { var connections = AddXML.GetConnections(keys.Key); if (connections != null) { foreach (var item in connections) { Console.WriteLine("in connections" + item.from); drawLine(item.from, item.to); } } } }
public void addTracklog(int id, string data) { List <double[]> stuff = AddXML.getWaypoints(data); for (int i = 0; i < stuff.Count; i++) { if (i == 0) { addMarker(id, stuff[i][0], stuff[i][1], "", "tracklog"); } else { drawLineTrack(stuff[i - 1][0], stuff[i - 1][1], stuff[i][0], stuff[i][1]); } } }
private void addEvent_Click(object sender, EventArgs e) { MainForm f = (MainForm)root; // Console.WriteLine("testing"); // Label l= new Label(); // l.Text = "HI"; // l.Location = new Point(PositionSystem.Instance().X, PositionSystem.Instance().Y); //l.MouseClick+=new System.Windows.Forms.MouseEventHandler(f.panel1_MouseClick); // Random rnd = new Random(); // Color randomColor = Color.FromArgb(rnd.Next(256), rnd.Next(256), rnd.Next(256)); // l.BackColor = randomColor; int id = AddXML.AddToFile(EventType.Text, message.Text, pp, filetext.Text); if (EventType.Text == "photo") { ((MainForm)root).addMarkerImage(id, pp.Lat, pp.Lng, filetext.Text, EventType.Text); } else if (EventType.Text == "tracklog") { ((MainForm)root).addTracklog(id, AddXML.LoadGPXWaypoints(filetext.Text) + AddXML.LoadGPXTracks(filetext.Text)); } else if (EventType.Text == "video") { ((MainForm)root).addMarkerVideo(id, pp.Lat, pp.Lng, filetext.Text, EventType.Text); } else { ((MainForm)root).addMarker(id, pp.Lat, pp.Lng, message.Text, EventType.Text); } //f.getPanel().Controls.Add(l); // int zIndex = f.getPanel().Controls.GetChildIndex(l); // l.BringToFront(); // Do something... // Then send it back again //f.showMap(); //f.getPanel().Controls.SetChildIndex(l, zIndex +1 ); this.Close(); }
private void update_Click(object sender, EventArgs e) { AddXML.updateEvent(mark, message.Text); this.Close(); }
public void showMap() { try { var events = AddXML.getXMLEvents(); //markers = new List<GMapMarker>(); //labels = new List<Label>(); foreach (var item in events) { // Point p = getPositionOnScreen(item.lon, item.lat); addMarker(item.id, item.lat, item.lon, item.message, item.type); /* PointLatLng point = new PointLatLng(item.lat,item.lon); * GMapMarker marker = new GMarkerGoogle(point,GMarkerGoogleType.pink); * overlay.Markers.Add(marker); * marker.ToolTipText =item.id+ item.message; * marker.ToolTipMode = MarkerTooltipMode.Always; */ } var tracklogs = AddXML.getTracklogs(); foreach (var item in tracklogs) { addTracklog(item.id, item.data); } var photos = AddXML.getXMLPhotos(); foreach (var item in photos) { Console.WriteLine("test"); // Point p = getPositionOnScreen(item.lon, item.lat); addMarkerImage(item.id, item.lat, item.lon, item.filename, item.type); /* PointLatLng point = new PointLatLng(item.lat,item.lon); * GMapMarker marker = new GMarkerGoogle(point,GMarkerGoogleType.pink); * overlay.Markers.Add(marker); * marker.ToolTipText =item.id+ item.message; * marker.ToolTipMode = MarkerTooltipMode.Always; */ } var videos = AddXML.getXMLVideos(); foreach (var item in videos) { Console.WriteLine(item.type); // Point p = getPositionOnScreen(item.lon, item.lat); addMarkerVideo(item.id, item.lat, item.lon, item.filename, item.type); /* PointLatLng point = new PointLatLng(item.lat,item.lon); * GMapMarker marker = new GMarkerGoogle(point,GMarkerGoogleType.pink); * overlay.Markers.Add(marker); * marker.ToolTipText =item.id+ item.message; * marker.ToolTipMode = MarkerTooltipMode.Always; */ } doConnections(); } catch (Exception e) { Console.WriteLine("couldn't download" + e); } }