Пример #1
1
        public PlaybackSbxjHelper(RMap map,IContainer c) {
            _map = map;
            playOverlay = map.FindOverlay("play");
            if (playOverlay == null) {
                playOverlay = new GMapOverlay(map, "play");
                map.Overlays.Add(playOverlay);
                playRoute = new GMapRoute(new List<GMap.NET.PointLatLng>(), "play");
                playRoute.Stroke.Color = Color.Red;
                playRoute.Stroke.Width = 3;
                playOverlay.Routes.Add(playRoute);
            } 

            car = new GMapMarkerGoogleGreen(new GMap.NET.PointLatLng(0, 0));
            car.ToolTipMode = MarkerTooltipMode.Always;
            car.ToolTipText = "man";
            car.ToolTip.Format.Alignment = StringAlignment.Near;

            playOverlay.Markers.Add(car);

            queue_pos = new Queue<gps_position>();

            dataTimer = new Timer();
            dataTimer.Tick += new EventHandler(dataTimer_Tick);
            dataTimer.Interval = 1;
            playTimer = new Timer();
            playTimer.Tick += new EventHandler(playTimer_Tick);
            playTimer.Interval = 1000;
        }
Пример #2
0
 public virtual void OnMarkerChanged(GMapMarker marker) {
     GMapMarkerVector markerv = marker as GMapMarkerVector;
     if (markerv.Polygon != null) {
         markerv.Polygon.UpdateRoutePostion(markerv);
         control.UpdatePolygonLocalPosition(markerv.Polygon);
     }
 }
Пример #3
0
 private void gmap_OnMarkerClick(GMap.NET.WindowsForms.GMapMarker item, MouseEventArgs e)
 {
     Console.WriteLine($"{DateTime.Now} gmap_OnMarkerClick {item.ToolTipText} {e.Button} {e.Clicks}");
     if (e.Button == MouseButtons.Right)
     {
         RemoveMarker(item);
     }
 }
Пример #4
0
 public MapToolTip(GMapMarker marker)
    : base(marker)
 {
    Stroke = new Pen(Color.FromArgb(120, Color.Black));
    Stroke.Width = 1;
    this.Stroke.LineJoin = LineJoin.Round;
    this.Stroke.StartCap = LineCap.RoundAnchor;
    Fill = Brushes.Azure;
    Foreground = Brushes.Black;
 }
Пример #5
0
 /// <summary>
 /// 更新数据库
 /// </summary>
 /// <param name="marker"></param>
 public void Update(GMapMarker marker) {
     if (iobusy) return;
     
     GMapMarkerPoint p = marker as GMapMarkerPoint;
     if (p != null && p.Polygon!=null && p.Polygon.Tag is TX_Polygon) {
         iobusy = true;
         try {
             (p.Polygon.Tag as TX_Polygon).Points = pointstostring();
             Client.ClientHelper.PlatformSqlMap.Update<TX_Polygon>(p.Polygon.Tag);
         } catch { }
         iobusy = false;
     }
     
 }
Пример #6
0
        public void UpdatePersonnelInfoMarker(GMap.NET.WindowsForms.GMapMarker item, MouseEventArgs e)
        {
            if (item.Tag == null)
            {
                Personnel p = personnelScreen.mapControl1.curPersonnel;
                personnelScreen.personnelNameLabel.Text  = "Name: " + p.Name;
                personnelScreen.personnelTypeLabel.Text  = "Class: " + p.Class.ToString();
                personnelScreen.personnelXCordLabel.Text = "Latitude: " + p.Coord.Position.Lat.ToString();
                personnelScreen.personnelYCordLabel.Text = "Longitude: " + p.Coord.Position.Lng.ToString();

                personnelScreen.locationTitleLabel.Text = "Локация: ";
                personnelScreen.personnelAreaLabel.Text = Territory.Check(p.Coord.Position.Lat, p.Coord.Position.Lng);
            }
        }
Пример #7
0
        protected override void DrawToolTip(Graphics g, GMapMarker m, int x, int y)
        {
            GraphicsState s = g.Save();
            g.SmoothingMode = SmoothingMode.AntiAlias;

            System.Drawing.Size st = g.MeasureString(m.ToolTipText, TooltipFont).ToSize();
            System.Drawing.Rectangle rect = new System.Drawing.Rectangle(x, y, st.Width + Control.TooltipTextPadding.Width, st.Height + Control.TooltipTextPadding.Height);
            rect.Offset(m.ToolTipOffset.X, m.ToolTipOffset.Y);

            g.DrawLine(TooltipPen, x, y, rect.X + rect.Width / 2, rect.Y + rect.Height / 2);
            g.FillRectangle(TooltipBackground, rect);
            g.DrawRectangle(TooltipPen, rect);
            g.DrawString(m.ToolTipText, TooltipFont, Brushes.Navy, rect, TooltipFormat);

            g.Restore(s);
        }
Пример #8
0
        void GoStoopid()
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
            List <PointLatLng> points        = new List <PointLatLng>();
            List <PointLatLng> pointsforopen = new List <PointLatLng>();

            for (int i = 0; i < data.Count; i++)
            {
                double lat = data[i].Cells.geoData.coordinates[0][0][1];
                double lng = data[i].Cells.geoData.coordinates[0][0][0];
                marker =
                    new GMap.NET.WindowsForms.Markers.GMarkerGoogle(
                        new GMap.NET.PointLatLng(lat, lng), mainmarker
                        );

                String parking_info = data[i].global_id + "\n" + data[i].Cells.Name + "\n" + data[i].Cells.District + "\n" + "\n" + data[i].Cells.AdmArea + " \n" /* data[i].Address +"\n Максимальное количество парковочных мест: " + data[i].CountSpaces*/;
                marker.ToolTipText         = parking_info;
                marker.ToolTip.Fill        = Brushes.Black;
                marker.ToolTip.Foreground  = Brushes.White;
                marker.ToolTip.Stroke      = Pens.Black;
                marker.ToolTip.TextPadding = new Size(20, 30);
                marker.ToolTipMode         = MarkerTooltipMode.OnMouseOver;
                marker.IsVisible           = true;
                markers.Markers.Add(marker);
            }

            for (int i = 0; i < DataOpenPark.Count; i++)
            {
                marker =
                    new GMap.NET.WindowsForms.Markers.GMarkerGoogle(
                        new GMap.NET.PointLatLng(DataOpenPark[i].Cells.geoData.coordinates[0][0][1], DataOpenPark[i].Cells.geoData.coordinates[0][0][0]), openparkmarker
                        );
                marker.ToolTipText = DataOpenPark[i].Cells.ParkingName + "\n" + DataOpenPark[i].Cells.AdmArea;
                markers.Markers.Add(marker);
            }
            gMapControl1.Overlays.Add(polygons);
            gMapControl1.Overlays.Add(markers);


            gMapControl1.OnMarkerClick +=
                new MarkerClick(mapControl1_OnMarkerClick);

            this.KeyDown += new KeyEventHandler(OKP);


            LoadingIsOver = true;
        }
Пример #9
0
 /// <summary>
 /// updates local positions of objects
 /// </summary>
 internal void ForceUpdate()
 {
     if (Control != null)
     {
         //foreach (GMapMarker obj in Markers)
         //{
         //    if (obj.IsVisible)
         //    {
         //        Control.UpdateMarkerLocalPosition(obj);
         //    }
         //}
         for (int i = 0; i < Markers.Count; i++)
         {
             GMapMarker obj = Markers[i];
             if (obj.IsVisible)
             {
                 Control.UpdateMarkerLocalPosition(obj);
             }
         }
         foreach (GMapPolygon obj in Polygons)
         {
             if (obj.IsVisible)
             {
                 Control.UpdatePolygonLocalPosition(obj);
             }
         }
         DateTime start = DateTime.Now;
         //foreach (GMapRoute obj in Routes)
         //{
         //    if (obj.IsVisible)
         //    {
         //        Control.UpdateRouteLocalPosition(obj);
         //    }
         //}
         for (int i = 0; i < Routes.Count; i++)
         {
             GMapRoute obj = Routes[i];
             if (obj.IsVisible)
             {
                 Control.UpdateRouteLocalPosition(obj);
             }
         }
         DateTime end   = DateTime.Now;
         int      delta = (int)(end - start).TotalMilliseconds;
         Debug.WriteLine("求本地坐标耗时:" + delta.ToString());
     }
 }
Пример #10
0
        public GMapToolTip(GMapMarker marker)
        {
            this.Marker = marker;
            this.Offset = new Point(14, -44);

            this.Stroke.Width = 2;

            this.Font = marker.ToolTipFont;

#if !PocketPC
            this.Stroke.LineJoin      = LineJoin.Round;
            this.Stroke.StartCap      = LineCap.RoundAnchor;
            this.Format.LineAlignment = StringAlignment.Center;
#endif

            this.Format.Alignment = StringAlignment.Center;
        }
Пример #11
0
        /// <summary>
        /// Populates a <see cref="T:System.Runtime.Serialization.SerializationInfo"/> with the data needed to serialize the target object.
        /// </summary>
        /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> to populate with data.</param>
        /// <param name="context">The destination (see <see cref="T:System.Runtime.Serialization.StreamingContext"/>) for this serialization.</param>
        /// <exception cref="T:System.Security.SecurityException">
        /// The caller does not have the required permission.
        /// </exception>
        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue("Id", this.Id);
            info.AddValue("IsVisible", this.IsVisibile);

            GMapMarker[] markerArray = new GMapMarker[this.Markers.Count];
            this.Markers.CopyTo(markerArray, 0);
            info.AddValue("Markers", markerArray);

            GMapRoute[] routeArray = new GMapRoute[this.Routes.Count];
            this.Routes.CopyTo(routeArray, 0);
            info.AddValue("Routes", routeArray);

            GMapPolygon[] polygonArray = new GMapPolygon[this.Polygons.Count];
            this.Polygons.CopyTo(polygonArray, 0);
            info.AddValue("Polygons", polygonArray);
        }
        /// <summary>
        ///     Populates a <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with the data needed to serialize the
        ///     target object.
        /// </summary>
        /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> to populate with data.</param>
        /// <param name="context">
        ///     The destination (see <see cref="T:System.Runtime.Serialization.StreamingContext" />) for this
        ///     serialization.
        /// </param>
        /// <exception cref="T:System.Security.SecurityException">
        ///     The caller does not have the required permission.
        /// </exception>
        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue("Id", Id);
            info.AddValue("IsVisible", IsVisibile);

            var markerArray = new GMapMarker[Markers.Count];

            Markers.CopyTo(markerArray, 0);
            info.AddValue("Markers", markerArray);

            var routeArray = new GMapRoute[Routes.Count];

            Routes.CopyTo(routeArray, 0);
            info.AddValue("Routes", routeArray);

            var polygonArray = new GMapPolygon[Polygons.Count];

            Polygons.CopyTo(polygonArray, 0);
            info.AddValue("Polygons", polygonArray);
        }
Пример #13
0
      /// <summary>
      /// show info form about exchanger
      /// </summary>
      /// <param name="item"></param>
      /// <param name="mouseEventArgs"></param>
      private void GMapControl1OnOnMarkerClick(GMapMarker item, MouseEventArgs mouseEventArgs) {
         try {
            if(item.Tag == null) {
               throw new ArgumentNullException("CurrencyExchanger.Id is null");
            }
            //костыль, когда я подсвечиваю маркер синим в findNearestToolStripMenuItem_Click, 
            //я по сути не меняю цвет маркера(ненашел как, маразм честно говоря иметь возможность поставить маркер но неиметь возхможности изменить цвет)
            //а доабвляю новый слой с маркером поверх старого,
            //потому при нажатии на него выскакивло две формочки INFO, и был поставлен костыль, который проверяет не входит ли синий маркер в 
            //первый массив маркеров, а он не входит.
            if(!objMarkersOverlay.Markers.Contains(item)) return;


            var objInfoForm = new InfoForm((int)item.Tag);
            objInfoForm.ShowDialog();

            UpdateMarkers();
         }
         catch(Exception ex) {
            MessageBox.Show(ex.Message);
         }
      }
Пример #14
0
        private void gMapControl1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (!markers.Markers.Contains(Person))
                {
                    PointLatLng point = gMapControl1.FromLocalToLatLng(e.X, e.Y);

                    Person = new GMap.NET.WindowsForms.Markers.GMarkerGoogle(
                        point, GMarkerGoogleType.arrow);
                    markers.Markers.Add(Person);
                }
                else
                {
                    markers.Markers.Remove(Person);
                    PointLatLng point = gMapControl1.FromLocalToLatLng(e.X, e.Y);

                    Person = new GMap.NET.WindowsForms.Markers.GMarkerGoogle(
                        point, GMarkerGoogleType.arrow);
                    markers.Markers.Add(Person);
                }
            }
        }
Пример #15
0
 void map_OnMarkerLeave(GMapMarker item) {
     if (item.Overlay == this)
         selectedMarker = null;
 }
Пример #16
0
      /// <summary>
      /// Populates a <see cref="T:System.Runtime.Serialization.SerializationInfo"/> with the data needed to serialize the target object.
      /// </summary>
      /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> to populate with data.</param>
      /// <param name="context">The destination (see <see cref="T:System.Runtime.Serialization.StreamingContext"/>) for this serialization.</param>
      /// <exception cref="T:System.Security.SecurityException">
      /// The caller does not have the required permission.
      /// </exception>
      public void GetObjectData(SerializationInfo info, StreamingContext context)
      {
         info.AddValue("Id", this.Id);
         info.AddValue("IsVisible", this.IsVisibile);

         GMapMarker[] markerArray = new GMapMarker[this.Markers.Count];
         this.Markers.CopyTo(markerArray, 0);
         info.AddValue("Markers", markerArray);

         GMapRoute[] routeArray = new GMapRoute[this.Routes.Count];
         this.Routes.CopyTo(routeArray, 0);
         info.AddValue("Routes", routeArray);

         GMapPolygon[] polygonArray = new GMapPolygon[this.Polygons.Count];
         this.Polygons.CopyTo(polygonArray, 0);
         info.AddValue("Polygons", polygonArray);
      }
Пример #17
0
 private void gmap_OnMarkerClick(GMap.NET.WindowsForms.GMapMarker item, MouseEventArgs e)
 {
     clickMarker = item;
 }
Пример #18
0
 private void addMissionPhotoMarker(GMapMarker marker)
 {
     // not async
     Invoke((MethodInvoker)delegate
     {
         photosoverlay.Markers.Add(marker);
     });
 }
Пример #19
0
 private void gMapControl1_OnMarkerClick(GMap.NET.WindowsForms.GMapMarker item, MouseEventArgs e)
 {
     currentmarker = item;
 }
Пример #20
0
 void MainMap_OnMarkerEnter(GMapMarker item) {
     curOperation.OnMarkerEnter(item);
 }
Пример #21
0
 private void myGMAP1_OnMarkerLeave(GMapMarker item)
 {
     if (!mousedown)
         onmarker = false;
 }
Пример #22
0
        public GCS()
        {
            InitializeComponent();
            mymap = gMapControl1;
            //config map
            gMapControl1.CacheLocation = Path.GetDirectoryName(Application.ExecutablePath) + Path.DirectorySeparatorChar + "mapCache" + Path.DirectorySeparatorChar;
            gMapControl1.MapProvider = GMapProviders.AMap;
            gMapControl1.Manager.Mode = AccessMode.ServerAndCache;
            gMapControl1.MinZoom = 0;
            gMapControl1.MaxZoom = 24;
            gMapControl1.Zoom = 3;

            // setup main serial reader
            serialreaderthread = new Thread(SerialReader)
            {
                IsBackground = true,
                Name = "Main Serial reader",
                //Priority = ThreadPriority.BelowNormal
                Priority = ThreadPriority.AboveNormal
            };
            serialreaderthread.Start();

            thisthread = new Thread(mainloop)
            {
                Name = "Mainloop",
                IsBackground = true,
                // Priority = ThreadPriority.BelowNormal
            };
            thisthread.Start();


            //初始化端口控件
            this.comboBoxComPort.Items.AddRange(SerialPort.GetPortNames());
            comboBoxBoundrate.SelectedIndex = 0;

            // setup guids for droneshare
            if (!MainV2.config.ContainsKey("plane_guid"))
                MainV2.config["plane_guid"] = Guid.NewGuid().ToString();

            if (!MainV2.config.ContainsKey("copter_guid"))
                MainV2.config["copter_guid"] = Guid.NewGuid().ToString();

            if (!MainV2.config.ContainsKey("rover_guid"))
                MainV2.config["rover_guid"] = Guid.NewGuid().ToString();

            RegeneratePolygon();
            updateCMDParams();

            //map events
            gMapControl1.MouseUp += MainMap_MouseUp;
            gMapControl1.MouseDown += MainMap_MouseDown;
            gMapControl1.MouseMove += MainMap_MouseMove;
            gMapControl1.OnMarkerEnter += MainMap_OnMarkerEnter;
            gMapControl1.OnMarkerClick += MainMap_OnMarkerClick;
            gMapControl1.OnMarkerLeave += MainMap_OnMarkerLeave;
            gMapControl1.RoutesEnabled = true;
            

            routesoverlay = new GMapOverlay("routes");
            gMapControl1.Overlays.Add(routesoverlay);

            polygonsoverlay = new GMapOverlay("polygons");
            gMapControl1.Overlays.Add(polygonsoverlay);

            //airportsoverlay = new GMapOverlay("airports");
            //MainMap.Overlays.Add(airportsoverlay);

            objectsoverlay = new GMapOverlay("objects");
            gMapControl1.Overlays.Add(objectsoverlay);

            drawnpolygonsoverlay = new GMapOverlay("drawnpolygons");
            gMapControl1.Overlays.Add(drawnpolygonsoverlay);

            gMapControl1.Overlays.Add(poioverlay);


            objectsoverlay.Markers.Clear();

            gMapControl1.Position = new PointLatLng(36, 103);
            gMapControl1.Zoom = 4;
            currentMarker = new GMarkerGoogle(gMapControl1.Position, GMarkerGoogleType.red);
            this.Commands.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;


            comboBox1.SelectedIndex = 1;

            gMapControl1.ContextMenuStrip = this.contextMenuStrip1;
        }
Пример #23
0
 void groupmarkeradd(GMapMarker marker)
 {
     groupmarkers.Add(int.Parse(marker.Tag.ToString()));
     if (marker is GMapMarkerWP)
     {
         ((GMapMarkerWP)marker).selected = true;
     }
     if (marker is GMapMarkerRect)
     {
         ((GMapMarkerWP)((GMapMarkerRect)marker).InnerMarker).selected = true;
     }
 }
Пример #24
0
 void map_OnMarkerEnter(GMapMarker item) {
     if (item.Overlay == this)
         selectedMarker = item;
 }
Пример #25
0
 void gMapControl1_OnMarkerLeave(GMapMarker item)
 {
     CurrentGMapMarker = null;
 }
Пример #26
0
 public GMapToolTip(GMapMarker marker)
 {
     this.Marker = marker;
     this.Offset = new Point(0, -10);
 }
Пример #27
0
        private void map_MouseUp(object sender, MouseEventArgs e)
        {
            MouseDownEnd = map.FromLocalToLatLng(e.X, e.Y);

            // Console.WriteLine("MainMap MU");

            if (e.Button == MouseButtons.Right) // ignore right clicks
            {
                return;
            }

            if (isMouseDown) // mouse down on some other object and dragged to here.
            {
                if (e.Button == MouseButtons.Left)
                {
                    isMouseDown = false;
                }
                if (!isMouseDraging)
                {
                    if (CurrentGMapMarker != null)
                    {
                        // Redraw polygon
                        //AddDrawPolygon();
                    }
                }
            }
            isMouseDraging = false;
            CurrentGMapMarker = null;
            CurrentGMapMarkerIndex = 0;
            CurrentGMapMarkerStartPos = null;
        }
Пример #28
0
 private void addMissionRouteMarker(GMapMarker marker)
 {
     // not async
     Invoke((MethodInvoker)delegate
     {
         routes.Markers.Add(marker);
     });
 }
Пример #29
0
        private void map_OnMarkerLeave(GMapMarker item)
        {
            if (!isMouseDown)
            {
                if (item is GMapMarker)
                {
                    // when you click the context menu this triggers and causes problems
                    CurrentGMapMarker = null;
                }

            }
        }
Пример #30
0
 private void myGMAP1_OnMarkerEnter(GMapMarker item)
 {
     if (!mousedown)
         onmarker = true;
 }
Пример #31
0
 public GMapToolTip(GMapMarker marker)
 {
     Marker = marker;
     Offset = new Point(14, -44);
 }
Пример #32
0
 void MainMap_OnMarkerLeave(GMapMarker item) {
     curOperation.OnMarkerLeave(item);
 }
Пример #33
0
        private void gmap_OnMarkerClick(GMapMarker item, MouseEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            this.pictureBox1.Image = null;
            this.groupBox1.Visible = true;

            PointD p = (PointD)item.Tag;
            this.pt = p;
            try
            {
                if (isInMeta(p.code))
                {
                    foreach (MetaD m in meta)
                    {
                        if (m.code.Equals(p.code))
                        {
                            this.tTime.Text = Global.GetTime(m.time);
                            this.tWho.Text = m.uin;

                           // Image newImage;
                           // byte[] imageData = this.getImage(m.id);
                           // using (MemoryStream ms = new MemoryStream(imageData, 0, imageData.Length))
                           // {
                           //     ms.Write(imageData, 0, imageData.Length);
                           //     newImage = Image.FromStream(ms, true);
                          //  }
                            //pictureBox1.Image = newImage;

                            var request = WebRequest.Create("http://imedia.tatar1n.org/img.php?id=" + m.id + "&base=" + Global.baseSQL + "");

                            using (var response = request.GetResponse())
                            using (var stream = response.GetResponseStream())
                            {
                                pictureBox1.Image = Bitmap.FromStream(stream);
                            }

                        }
                    }
                }
                else if (isInPass(p.code))
                {
                    foreach (PassD m in pass)
                    {
                        if (m.code.Equals(p.code))
                        {
                            this.tTime.Text = Global.GetTime(m.time);
                            this.tWho.Text = "";

                            Image newImage;
                            string pId  = this.getImagePass(m.code, m.banner);

                            var request = WebRequest.Create("http://imedia.tatar1n.org/img.php?id=" + pId + "&base=" + Global.baseSQL + "");

                            using (var response = request.GetResponse())
                            using (var stream = response.GetResponseStream())
                            {
                                pictureBox1.Image = Bitmap.FromStream(stream);
                            }

                        }
                    }
                }
                else
                {
                    this.tTime.Text = "";
                    this.tWho.Text = "";
                }

            }
            catch (Exception) { }

            this.tCode.Text = p.code;
            this.tAdress.Text = "ул. " + p.street + " д. " + p.house + " п. " + p.porch;

            int s = getStatus(p.code);

            if (s == 0)
            {
                this.tStatus.Text = "Установка";
                this.tMessage.Text = "Баннер установлен!";
            }
            else if (s == 1)
            {
                foreach (SmsD m in sms)
                    if (m.code.Equals(p.code))
                    {
                        this.tStatus.Text = "Поломка";
                        this.tMessage.Text = Global.getSms(m.msg);
                        this.tTime.Text = Global.GetTime(m.time);
                    }
            }
            else if (s == 2)
            {
                foreach (PassD ms in pass)
                    if (ms.code.Equals(p.code))
                    {
                        this.tStatus.Text = "Пропуск";
                        this.tMessage.Text = Global.getPass(ms.banner);
                        this.tTime.Text = Global.GetTime(ms.time);
                    }
            }
            else
            {
                this.tStatus.Text = "- / -";
                this.tMessage.Text = " - / -";
            }

            Cursor.Current = Cursors.Default;
        }
Пример #34
0
 // click on some marker
 void MainMap_OnMarkerClick(GMapMarker item, MouseEventArgs e) {
 }
Пример #35
0
        private void gmap_OnMarkerClick(GMapMarker item, MouseEventArgs e)
        {
            Process.Start(item.ToolTipText); // Open up the article

            // Search the list of FeedMarkers for this article
        }
Пример #36
0
        private void gMapControl1_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                PointLatLng point = gMapControl1.FromLocalToLatLng(e.X, e.Y);

                double latdif = MouseDownStart.Lat - point.Lat;
                double lngdif = MouseDownStart.Lng - point.Lng;

                try
                {
                    gMapControl1.Position = new PointLatLng(gMapControl1.Position.Lat + latdif,
                        gMapControl1.Position.Lng + lngdif);
                }
                catch
                {
                }
            }
            else
            {
                // setup a ballon with home distance
                if (marker != null)
                {
                    if (routes.Markers.Contains(marker))
                        routes.Markers.Remove(marker);
                }

                if (MainV2.getConfig("CHK_disttohomeflightdata") != false.ToString())
                {
                    PointLatLng point = gMapControl1.FromLocalToLatLng(e.X, e.Y);

                    marker = new GMapMarkerRect(point);
                    marker.ToolTip = new GMapToolTip(marker);
                    marker.ToolTipMode = MarkerTooltipMode.Always;
                    marker.ToolTipText = "Dist to Home: " +
                                         ((gMapControl1.MapProvider.Projection.GetDistance(point,
                                             MainV2.comPort.MAV.cs.HomeLocation.Point())*1000)*
                                          CurrentState.multiplierdist).ToString("0");

                    routes.Markers.Add(marker);
                }
            }
        }
Пример #37
0
        private void NavigationView_Load(object sender, EventArgs e)
        {
            MainMap.Manager.Mode = AccessMode.CacheOnly;
            PointLatLng p = new PointLatLng(0.0, 0.0);

            // map center
            center = new GMapMarkerCross(MainMap.Position);
            objects.Markers.Add(center);
            MainMap.Position = p;
            NodeMarker = new UserMarker(p);
            NodeMarker.IsHitTestVisible = true;
            objects.Markers.Add(NodeMarker);
            NodeMarker.ToolTip = new MapToolTip(NodeMarker);
            NodeMarker.ToolTipMode = MarkerTooltipMode.Always;
            PointLatLng gpspos = NodeMarker.Position;
            string lngstr, latstr;
            if (gpspos.Lng > 0)
                lngstr = gpspos.Lng.ToString("F06") + " E";
            else
                lngstr = (-gpspos.Lng).ToString("F06") + " W";
            if (gpspos.Lat > 0)
                latstr = gpspos.Lat.ToString("F06") + " N";
            else
                latstr = (-gpspos.Lat).ToString("F06") + " S";
            NodeMarker.ToolTipText = "GPS\r\n经度=" + lngstr + "\r\n纬度=" + latstr;
            MainMap.MapType = MapType.None;
            MainMap.MinZoom = 1;
            MainMap.MaxZoom = 18;
            MainMap.Zoom = 15;
            MainMap.MapName = MapTitle;
            ShowTrack.PerformClick();
            AutoTrack.PerformClick();
            
        }
Пример #38
0
 void gMapControl1_OnMarkerEnter(GMapMarker item)
 {
     CurrentGMapMarker = item;
 }
Пример #39
0
 public void RemoveUserMarker(GMapMarker marker)
 {
     userMarkerOverlay.Markers.Remove(marker);
 }
Пример #40
0
        // Map Operators
        private void map_OnRouteEnter(GMapRoute item)
        {
            string dist;
            if (DistUnits == "Feet")
            {
                dist = ((float)item.Distance * 3280.84f).ToString("0.##") + " ft";
            }
            else
            {
                dist = ((float)item.Distance * 1000f).ToString("0.##") + " m";
            }
            if (marker != null)
            {
                if (routesOverlay.Markers.Contains(marker))
                    routesOverlay.Markers.Remove(marker);
            }

            PointLatLng point = currentMousePosition;

            marker = new GMapMarkerRect(point);
            marker.ToolTip = new GMapToolTip(marker);
            marker.ToolTipMode = MarkerTooltipMode.Always;
            marker.ToolTipText = "Line: " + dist;
            routesOverlay.Markers.Add(marker);
        }
Пример #41
0
 public void AddUserMarker(GMapMarker marker)
 {
     userMarkerOverlay.Markers.Add(marker);
 }
Пример #42
0
 private void map_OnMarkerEnter(GMapMarker item)
 {
     if (!isMouseDown)
     {
         if (item is GMapMarker)
         {
             CurrentGMapMarker = item as GMapMarker;
             CurrentGMapMarkerStartPos = CurrentGMapMarker.Position;
         }
     }
 }
 public GMapToolTip(GMapMarker marker)
 {
     this.Marker = marker;
     this.Offset = new Point(14, -44);
 }