public async 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(); 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); /* 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; */ } } catch (Exception e) { Console.WriteLine("couldn't download" + e); } }
private void addEvent_Click() { MainWindow f = (MainWindow)root; f.Show(); if ((bool)image.IsChecked) { int id = AddXML.AddToFile("photo", message.Text, pp, filename); (f).addMarkerImage(id, pp.Lat, pp.Lng, filename, message.Text); } else if ((bool)twitter.IsChecked) { Console.WriteLine("test"); int id = AddXML.AddToFile("tweet", message.Text, pp, filename); (f).addMarker(id, pp.Lat, pp.Lng, message.Text, "tweet"); } else if ((bool)facebook.IsChecked) { Console.WriteLine("test"); int id = AddXML.AddToFile("facebook-status-update", message.Text, pp, filename); (f).addMarker(id, pp.Lat, pp.Lng, message.Text, "facebook-status-update"); } this.Close(); //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 ); // 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; //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 ); }