internal override void AddEvents(FBAdapter i_FBAdapter, IEnumerable<object> i_Events) { m_GMapControl.Invoke(new Action(() => m_GMapControl.MapProvider = GMap.NET.MapProviders.GoogleMapProvider.Instance)); m_GMapControl.Invoke(new Action(() => m_GMapControl.SetPositionByKeywords("dubnov, Tel Aviv, Israel"))); m_MarkersOverlay = new GMapOverlay("markers"); foreach (object fbEvent in i_Events) { if (i_FBAdapter.HasLocationEvent(fbEvent)) { //PointLatLng point = GetPosition(i_FBAdapter.GetLatLong(fbEvent)); PointD eventLocation = i_FBAdapter.GetLatLong(fbEvent); PointLatLng point = new PointLatLng(eventLocation.X, eventLocation.Y); GMap.NET.WindowsForms.Markers.GMarkerGoogle marker = new GMap.NET.WindowsForms.Markers.GMarkerGoogle( point, GMap.NET.WindowsForms.Markers.GMarkerGoogleType.red_small); marker.ToolTipText = i_FBAdapter.GetEventName(fbEvent); m_MarkersOverlay.Markers.Add(marker); } } }
internal override void AddEvents(FBAdapter i_FBAdapter, IEnumerable <object> i_Events) { m_GMapControl.Invoke(new Action(() => m_GMapControl.MapProvider = GMap.NET.MapProviders.GoogleMapProvider.Instance)); m_GMapControl.Invoke(new Action(() => m_GMapControl.SetPositionByKeywords("dubnov, Tel Aviv, Israel"))); m_MarkersOverlay = new GMapOverlay("markers"); foreach (object fbEvent in i_Events) { if (i_FBAdapter.HasLocationEvent(fbEvent)) { //PointLatLng point = GetPosition(i_FBAdapter.GetLatLong(fbEvent)); PointD eventLocation = i_FBAdapter.GetLatLong(fbEvent); PointLatLng point = new PointLatLng(eventLocation.X, eventLocation.Y); GMap.NET.WindowsForms.Markers.GMarkerGoogle marker = new GMap.NET.WindowsForms.Markers.GMarkerGoogle( point, GMap.NET.WindowsForms.Markers.GMarkerGoogleType.red_small); marker.ToolTipText = i_FBAdapter.GetEventName(fbEvent); m_MarkersOverlay.Markers.Add(marker); } } }
private void loadMap() { gMapControl.Invoke(new Action(() => gMapControl.MapProvider = GMap.NET.MapProviders.GoogleMapProvider.Instance)); gMapControl.Invoke(new Action(() => gMapControl.SetPositionByKeywords("dubnov, Tel Aviv, Israel"))); m_MarkersOverlay = new GMapOverlay("markers"); foreach (object obj in m_FBAdapter.Events) { if (m_FBAdapter.HasLocationEvent(obj)) { PointLatLng point = getLatLong(m_FBAdapter.GetLatLong(obj)); GMap.NET.WindowsForms.Markers.GMarkerGoogle marker = new GMap.NET.WindowsForms.Markers.GMarkerGoogle( point, GMap.NET.WindowsForms.Markers.GMarkerGoogleType.red_small); marker.ToolTipText = m_FBAdapter.GetEventName(obj); m_MarkersOverlay.Markers.Add(marker); } } gMapControl.Invoke(new Action(() => gMapControl.Overlays.Add(m_MarkersOverlay))); gMapControl.Invoke(new Action(() => gMapControl.ZoomAndCenterMarkers(null))); }