Пример #1
1
 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);
         }
     }
 }
Пример #2
0
 private void listBoxEvents_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (m_FBAdapter.HasLocationEvent(listBoxEvents.SelectedItem))
     {
         m_Map.SetPosition(m_FBAdapter.GetLatLong(listBoxEvents.SelectedItem));
     }
     else
     {
         m_Map.ZoomAndCenterMarkers();
     }
 }
Пример #3
0
        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)));
        }
Пример #4
0
 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);
         }
     }
 }