private void showSingleCheckInOnMap() { GMapOverlay mapMarkers = new GMapOverlay("markers"); CheckInLinkLabel.Text = string.Empty; CurrentCheckInPictureBox.InitialImage = null; if (CheckInsListBox.SelectedItems.Count == 1) { try { CheckInWrapper curCheckIn = CheckInsListBox.SelectedItem as CheckInWrapper; mapMarkers.Markers.Add(curCheckIn.CheckInMarkerOnMap); CheckInLinkLabel.Text = (curCheckIn.Link != null) ? curCheckIn.Link : string.Empty; if (curCheckIn.PhotoUrl != null) { CurrentCheckInPictureBox.LoadAsync(curCheckIn.PhotoUrl); } else { CurrentCheckInPictureBox.Image = null; // delete the last picture } } catch (Exception ex) { } } CheckInGMapControl.Overlays.Add(mapMarkers); }
private void updateInfo() { string eventName = string.Empty; CheckInsListBox.DisplayMember = "Name"; foreach (Checkin curCheckIn in m_UserCheckIns) { try { eventName = (curCheckIn.Place.Name == null) ? "[No Name]" : curCheckIn.Place.Name; PointLatLng location = new PointLatLng((double)curCheckIn.Place.Location.Latitude, (double)curCheckIn.Place.Location.Longitude); CheckInWrapper checkInWrapper = new CheckInWrapper(eventName, location, curCheckIn.PictureURL, curCheckIn.Link, (DateTime)curCheckIn.CreatedTime); r_CheckInsOnForm.Add(checkInWrapper); CheckInsListBox.Items.Add(checkInWrapper); } catch (Exception ex) { } } showAllCheckInsOnMap(); CheckInGMapControl.Zoom = 11.5; }