• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# GMapRoute类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中GMapRoute的典型用法代码示例。如果您正苦于以下问题:C# GMapRoute类的具体用法?C# GMapRoute怎么用?C# GMapRoute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GMapRoute类属于命名空间,在下文中一共展示了GMapRoute类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PlaybackSbxjHelper

        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;
        }
开发者ID:s7loves,项目名称:mypowerscgl,代码行数:28,代码来源:PlaybackSbxjHelper.cs


示例2: RoutePointMarker

 public RoutePointMarker(GMap.NET.PointLatLng p, int routePointIndex, GMapRoute route)
     : base(p)
 {
     _route = route;
     _routePointIndex = routePointIndex;
     base.Size = new Size(8, 8);
     base.Offset = new Point((-1) * base.Size.Width / 2, (-1) * base.Size.Height / 2);
 }
开发者ID:chinnisuraj1984,项目名称:navigational,代码行数:8,代码来源:RoutePointMarker.cs


示例3: getDistance

        public double getDistance(PointLatLng p1, PointLatLng p2)
        {
            GMapRoute route = new GMapRoute("getDistance");
            route.Points.Add(p1);
            route.Points.Add(p2);
            double distance = route.Distance;
            route.Clear();
            route = null;

            return distance;
        }
开发者ID:nadar71,项目名称:Krea,代码行数:11,代码来源:GoogleMapControl.cs


示例4: GetRouteFromKml

        public static GMapRoute GetRouteFromKml(string fileName)
        {
            try
            {
                //XDocument root = XDocument.Load(new System.IO.StreamReader(fileName));
                XElement root = XElement.Load(new System.IO.StreamReader(fileName));
                IEnumerable<string> coordinates = from c in root.Descendants(XName.Get("coordinates", root.Name.NamespaceName))
                                                  select (string)c;
                foreach (string c in coordinates)
                {
                    List<PointLatLng> points = new List<GMap.NET.PointLatLng>();

                    string[] ss = c.Split(new char[] { ' ', '\n', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                    foreach (string sss in ss)
                    {
                        string[] ss2 = sss.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        points.Add(new PointLatLng(Convert.ToDouble(ss2[1]), Convert.ToDouble(ss2[0])));
                    }

                    GMapRoute rt = new GMapRoute(points, string.Empty);
                    {
                        rt.Stroke = new Pen(Color.FromArgb(144, Color.Red));
                        rt.Stroke.Width = 5;
                        rt.Stroke.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
                    }
                    return rt;
                }
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
            return null;
        }
开发者ID:urmilaNominate,项目名称:mERP-framework,代码行数:34,代码来源:KmlOverlay.cs


示例5: MapControl_OnRouteEnter

        private void MapControl_OnRouteEnter(GMapRoute item)
        {
            if (marker != null)
                item.Overlay.Markers.Remove(marker);

            var point = item.Overlay.Control.PointToClient(Control.MousePosition);
            var pos = item.Overlay.Control.FromLocalToLatLng(point.X, point.Y);

            marker = new GMapMarkerRect(pos) { ToolTipMode = MarkerTooltipMode.Always, ToolTipText = createMessage(item.Tag), IsHitTestVisible = false };
            item.Overlay.Markers.Add(marker);
        }
开发者ID:ArduPilot,项目名称:MissionPlanner,代码行数:11,代码来源:MapAdapter.cs


示例6: timer1_Tick

        private void timer1_Tick(object sender, EventArgs e)
        {
            GMap.NET.WindowsForms.Markers.GMarkerGoogle curPos = new GMap.NET.WindowsForms.Markers.GMarkerGoogle(initialPoint, GMap.NET.WindowsForms.Markers.GMarkerGoogleType.blue_pushpin);
            path = GMap.NET.MapProviders.GoogleMapProvider.Instance.GetRoute(initialPoint, finalPoint, false, false, 15);
            GMapRoute route = new GMapRoute(path.Points, "My route");
            overlayRoute.Routes.Clear();
            overlayRoute.Routes.Add(route);
            areaMap.Overlays.Add(overlayRoute);
            label10.Text = (path.Distance * 1000).ToString();
            areaMap.Refresh();
            

        }
开发者ID:hkumar96,项目名称:sastr-navigation,代码行数:13,代码来源:Form1.cs


示例7: refreshRoute

        void refreshRoute() {
            List<PointLatLng> linePoints = new List<PointLatLng>();

            foreach (GMapMarker m in routes.Markers) {                
                m.Tag = linePoints.Count;
                linePoints.Add(m.Position);
                m.ToolTipMode = MarkerTooltipMode.Never;
            }
            if (routes.Markers.Count > 1) {
                routes.Markers[routes.Markers.Count - 1].ToolTipMode = MarkerTooltipMode.Always;
            }
            if (linePoints.Count > 0) {
                GMapRoute route = new GMapRoute(linePoints, "distance");
                route.Stroke.Width = 4;
                routes.Routes.Clear();
                routes.Routes.Add(route);
            }
        }
开发者ID:s7loves,项目名称:mypowerscgl,代码行数:18,代码来源:OperationDistance.cs


示例8: BuildRoute

        void BuildRoute()
        {
            if (markersOverlay.Markers.Count > 0)
            {
                List<PointLatLng> points = new List<PointLatLng>();

                for (int i = 0; i < markersOverlay.Markers.Count; i++)
                {
                    points.Add(markersOverlay.Markers[i].Position);
                }

                GMapRoute route = new GMapRoute(points, "myRoute");
                routeOverlay.Routes.Clear();
                routeOverlay.Routes.Add(route);
                MainMap.Overlays.Add(routeOverlay);
                MainMap.UpdateRouteLocalPosition(route);
            }
        }
开发者ID:vadimvoyevoda,项目名称:NetworkProgramming,代码行数:18,代码来源:Form1.cs


示例9: DrawMap

        public static void DrawMap(GMapControl map, List<Point> points, Color color, bool includeMarkers)
        {
            Pen pen = new Pen(color, 3.0f);

            List<PointLatLng> allMapPoints = points.Select(point => new PointLatLng(point.Latitude, point.Longitude)).ToList();
            GMapRoute route = new GMapRoute(allMapPoints, "Route");
            route.Stroke = pen;
            map.ZoomAndCenterRoute(route);

            GMapOverlay overlay = new GMapOverlay(map, "Overlay");
            if (includeMarkers)
            {
                overlay.Markers.Add(new GMap.NET.WindowsForms.Markers.GMapMarkerGoogleGreen(new PointLatLng(allMapPoints.First().Lat, allMapPoints.First().Lng)));
                overlay.Markers.Add(new GMap.NET.WindowsForms.Markers.GMapMarkerGoogleRed(new PointLatLng(allMapPoints.Last().Lat, allMapPoints.Last().Lng)));
            }
            overlay.Routes.Add(route);
            map.Overlays.Add(overlay);
        }
开发者ID:richardpianka,项目名称:Transit,代码行数:18,代码来源:MapUtilities.cs


示例10: Build

        public static void Build(ref GMapOverlay OverlayOut)
        {
            // Here loop through defined state borders and display them on the map
            foreach (SystemAdaptationDataSet.StateBorder State in SystemAdaptationDataSet.StateBorderDataSet)
            {
                System.Collections.Generic.List<PointLatLng> SectorPointList = new System.Collections.Generic.List<PointLatLng>();
                foreach (GeoCordSystemDegMinSecUtilities.LatLongClass SectorPoint in State.StateBorderPoints)
                {
                    SectorPointList.Add(new PointLatLng(SectorPoint.GetLatLongDecimal().LatitudeDecimal, SectorPoint.GetLatLongDecimal().LongitudeDecimal));
                }

                GMapRoute StateBoundaryData = new GMapRoute(SectorPointList, State.StateName);
                StateBoundaryData.Stroke.Width = DisplayAttributes.GetDisplayAttribute(DisplayAttributes.DisplayItemsType.StateBorder).LineWidth;
                StateBoundaryData.Stroke.DashStyle = DisplayAttributes.GetDisplayAttribute(DisplayAttributes.DisplayItemsType.StateBorder).LineStyle;
                StateBoundaryData.Stroke.Color = DisplayAttributes.GetDisplayAttribute(DisplayAttributes.DisplayItemsType.StateBorder).LineColor;
                OverlayOut.Routes.Add(StateBoundaryData);
            }
        }
开发者ID:akapetanovic,项目名称:ASTERIX-ANALYSER-and-DATA-DISPLAY,代码行数:18,代码来源:StateBorderDisplay.cs


示例11: AddRoute

        public void AddRoute(List<PointLatLng> route)
        {
            // add route
            GMapRoute r = new GMapRoute(route, "test");
            routes.Routes.Add(r);

            //// add route start/end marks
            //GMapMarker m1 = new GMapMarkerGoogleRed(start);
            //m1.ToolTipText = "Start: " + start.ToString();
            //m1.TooltipMode = MarkerTooltipMode.Always;

            //GMapMarker m2 = new GMapMarkerGoogleGreen(end);
            //m2.ToolTipText = "End: " + end.ToString();
            //m2.TooltipMode = MarkerTooltipMode.Always;

            //objects.Markers.Add(m1);
            //objects.Markers.Add(m2);

            MainMap.ZoomAndCenterRoute(r);
        }
开发者ID:urmilaNominate,项目名称:mERP-framework,代码行数:20,代码来源:Map.cs


示例12: destinationMenuItem_Click

        private void destinationMenuItem_Click(object sender, EventArgs e)
        {
            GMarkerGoogle marker = new GMarkerGoogle(gPoint, GMarkerGoogleType.red);
            markers.Markers.Add(marker);
            PointLatLng start = new PointLatLng(markers.Markers[0].Position.Lat, markers.Markers[0].Position.Lng);
            PointLatLng end = new PointLatLng(markers.Markers[1].Position.Lat, markers.Markers[1].Position.Lng);
            MapRoute route = GMap.NET.MapProviders.GoogleMapProvider.Instance.GetRoute(
                start,
                end,
                false,
                false,
                14
            );
            GMapRoute r = new GMapRoute(route.Points, "My route");

            GMapOverlay routesOverlay = new GMapOverlay("routes");
            routesOverlay.Routes.Add(r);
            myMap.Overlays.Add(routesOverlay);

            // Térkép frissítése a route felrakása után, különben csak egy zoomolás után látszik a route.
            myMap.UpdateRouteLocalPosition(r);
            myMap.Invalidate();
        }
开发者ID:CsabaBarsony,项目名称:RouteSim,代码行数:23,代码来源:Form1.cs


示例13: mainloop


//.........这里部分代码省略.........
                        }

                        gMapControl1.HoldInvalidation = true;

                        while (gMapControl1.inOnPaint == true)
                        {
                            System.Threading.Thread.Sleep(1);
                        }

                        if (trackPoints.Count > int.Parse(MainV2.config["NUM_tracklength"].ToString()))
                        {
                            trackPoints.RemoveRange(0, trackPoints.Count - int.Parse(MainV2.config["NUM_tracklength"].ToString()));
                        }
                        if (MainV2.cs.lat != 0)
                            trackPoints.Add(new PointLatLng(MainV2.cs.lat, MainV2.cs.lng));

                        //                        if (CB_tuning.Checked == false) // draw if in view
                        {

                            if (MainV2.comPort.logreadmode && MainV2.comPort.logplaybackfile != null)
                            {
                                // this is for the pulled wp list from a mavlink logfile
                                FlightPlanner.pointlist.Clear();
                                FlightPlanner.pointlist.AddRange(MainV2.comPort.wps);
                            }

                            while (gMapControl1.inOnPaint == true)
                            {
                                System.Threading.Thread.Sleep(1);
                            }

                            updateClearRoutes();

                            route = new GMapRoute(trackPoints, "track");
                            //track.Stroke = Pens.Red;
                            //route.Stroke = new Pen(Color.FromArgb(144, Color.Red));
                            //route.Stroke.Width = 5;
                            //route.Tag = "track";

                            routes.Routes.Add(route);

                            if (waypoints.AddSeconds(10) < DateTime.Now)
                            {
                                //Console.WriteLine("Doing FD WP's");
                                polygons.Markers.Clear();

                                foreach (PointLatLngAlt plla in FlightPlanner.pointlist)
                                {
                                    if (plla == null || plla.Lng == 0 || plla.Lat == 0)
                                        break;
                                    addpolygonmarker(plla.Tag, plla.Lng, plla.Lat, (int)plla.Alt,plla.color,polygons);
                                }

                                RegeneratePolygon();

                                waypoints = DateTime.Now;
                            }

                            if (MainV2.cs.mode.ToLower() == "guided" && GuidedModeWP != null && GuidedModeWP.Lat != 0)
                            {
                                addpolygonmarker("Guided Mode", GuidedModeWP.Lng, GuidedModeWP.Lat, (int)GuidedModeWP.Alt, Color.Blue, routes);
                            }

                            //routes.Polygons.Add(poly);

                            if (trackPoints.Count > 0)
开发者ID:digitalcraft,项目名称:ardupilot-mega-buzz,代码行数:67,代码来源:FlightData.cs


示例14: mainloop


//.........这里部分代码省略.........
                        double time = (Environment.TickCount - tickStart) / 1000.0;
                        if (list1item != null)
                            list1.Add(time, (float)list1item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list2item != null)
                            list2.Add(time, (float)list2item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list3item != null)
                            list3.Add(time, (float)list3item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list4item != null)
                            list4.Add(time, (float)list4item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list5item != null)
                            list5.Add(time, (float)list5item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list6item != null)
                            list6.Add(time, (float)list6item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list7item != null)
                            list7.Add(time, (float)list7item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list8item != null)
                            list8.Add(time, (float)list8item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list9item != null)
                            list9.Add(time, (float)list9item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list10item != null)
                            list10.Add(time, (float)list10item.GetValue((object)MainV2.comPort.MAV.cs, null));
                    }

                    if (tracklast.AddSeconds(1) < DateTime.Now)
                    {
                        if (MainV2.config["CHK_maprotation"] != null && MainV2.config["CHK_maprotation"].ToString() == "True")
                        {
                            // dont holdinvalidation here
                            setMapBearing();
                        }

                        if (route == null)
                        {
                            route = new GMapRoute(trackPoints, "track");
                            routes.Routes.Add(route);
                        }

                        PointLatLng currentloc = new PointLatLng(MainV2.comPort.MAV.cs.lat, MainV2.comPort.MAV.cs.lng);

                        gMapControl1.HoldInvalidation = true;

                        int cnt = 0;

                        while (gMapControl1.inOnPaint == true)
                        {
                            System.Threading.Thread.Sleep(1);
                            cnt++;
                        }

                        while (route.Points.Count > 200)
                        {
                            //  trackPoints.RemoveRange(0, trackPoints.Count - int.Parse(MainV2.config["NUM_tracklength"].ToString()));
                            route.Points.RemoveAt(0);
                        }
                        if (MainV2.comPort.MAV.cs.lat != 0)
                        {
                            // trackPoints.Add(currentloc);
                            route.Points.Add(currentloc);
                        }

                        //                        if (CB_tuning.Checked == false) // draw if in view
                        {

                            while (gMapControl1.inOnPaint == true)
                            {
                                System.Threading.Thread.Sleep(1);
开发者ID:neolu,项目名称:MissionPlanner,代码行数:67,代码来源:Simple.cs


示例15: mainloop


//.........这里部分代码省略.........
                        if (list5item != null)
                            list5.Add(time, ConvertToDouble(list5item.GetValue(MainV2.comPort.MAV.cs, null)));
                        if (list6item != null)
                            list6.Add(time, ConvertToDouble(list6item.GetValue(MainV2.comPort.MAV.cs, null)));
                        if (list7item != null)
                            list7.Add(time, ConvertToDouble(list7item.GetValue(MainV2.comPort.MAV.cs, null)));
                        if (list8item != null)
                            list8.Add(time, ConvertToDouble(list8item.GetValue(MainV2.comPort.MAV.cs, null)));
                        if (list9item != null)
                            list9.Add(time, ConvertToDouble(list9item.GetValue(MainV2.comPort.MAV.cs, null)));
                        if (list10item != null)
                            list10.Add(time, ConvertToDouble(list10item.GetValue(MainV2.comPort.MAV.cs, null)));
                    }

                    // update map
                    if (tracklast.AddSeconds(1.2) < DateTime.Now)
                    {
                        // show disable joystick button
                        if (MainV2.joystick != null && MainV2.joystick.enabled)
                        {
                            this.Invoke((MethodInvoker) delegate {
                                but_disablejoystick.Visible = true;
                            });
                        }

                        if (Settings.Instance.GetBoolean("CHK_maprotation"))
                        {
                            // dont holdinvalidation here
                            setMapBearing();
                        }

                        if (route == null)
                        {
                            route = new GMapRoute(trackPoints, "track");
                            routes.Routes.Add(route);
                        }

                        PointLatLng currentloc = new PointLatLng(MainV2.comPort.MAV.cs.lat, MainV2.comPort.MAV.cs.lng);

                        gMapControl1.HoldInvalidation = true;

                        int numTrackLength = Settings.Instance.GetInt32("NUM_tracklength");
                        // maintain route history length
                        if (route.Points.Count > numTrackLength)
                        {
                            route.Points.RemoveRange(0,
                                route.Points.Count - numTrackLength);
                        }
                        // add new route point
                        if (MainV2.comPort.MAV.cs.lat != 0 && MainV2.comPort.MAV.cs.lng != 0)
                        {
                            route.Points.Add(currentloc);
                        }

                        gMapControl1.UpdateRouteLocalPosition(route);

                        // update programed wp course
                        if (waypoints.AddSeconds(5) < DateTime.Now)
                        {
                            //Console.WriteLine("Doing FD WP's");
                            updateClearMissionRouteMarkers();

                            float dist = 0;
                            float travdist = 0;
                            distanceBar1.ClearWPDist();
                            MAVLink.mavlink_mission_item_t lastplla = new MAVLink.mavlink_mission_item_t();
开发者ID:denisdifazio,项目名称:MissionPlanner,代码行数:67,代码来源:FlightData.cs


示例16: DrawMap

        void DrawMap()
        {
            int a = 0;

            DateTime starttime = DateTime.MinValue;
            int startdelta = 0;
            DateTime workingtime = starttime;

            DateTime lastdrawn = DateTime.MinValue;

            List<PointLatLng> routelist = new List<PointLatLng>();

            //zg1.GraphPane.GraphObjList.Clear();

            foreach (DataGridViewRow datarow in dataGridView1.Rows)
            {
                if (datarow.Cells[1].Value.ToString() == "GPS")
                {
                    if (!logformat.ContainsKey("GPS"))
                        break;

                    int index = FindInArray(logformat["GPS"].FieldNames, "Lat");
                    if (index == -1)
                    {
                        a++;
                        continue;
                    }

                    int index2 = FindInArray(logformat["GPS"].FieldNames, "Lng");
                    if (index2 == -1)
                    {
                        a++;
                        continue;
                    }

                    int index3 = FindInArray(logformat["GPS"].FieldNames, "Status");
                    if (index3 == -1)
                    {
                        a++;
                        continue;
                    }

                    if (double.Parse(datarow.Cells[index3 + 2].Value.ToString()) != 3)
                    {
                        a++;
                        continue;
                    }

                    string lat = datarow.Cells[index+2].Value.ToString();
                    string lng = datarow.Cells[index2+2].Value.ToString();

                    PointLatLng pnt = new PointLatLng() { };
                    pnt.Lat = double.Parse(lat);
                    pnt.Lng = double.Parse(lng);

                    routelist.Add(pnt);
                }
                a++;
            }

            GMapRoute route = new GMapRoute(routelist,"route");
            mapoverlay.Routes.Add(route);
            myGMAP1.ZoomAndCenterRoute(route);
            myGMAP1.RoutesEnabled = true;
        }
开发者ID:neolu,项目名称:MissionPlanner,代码行数:65,代码来源:LogBrowse.cs


示例17: mainloop


//.........这里部分代码省略.........
                        if (list1item != null)
                            list1.Add(time, (float)list1item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list2item != null)
                            list2.Add(time, (float)list2item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list3item != null)
                            list3.Add(time, (float)list3item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list4item != null)
                            list4.Add(time, (float)list4item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list5item != null)
                            list5.Add(time, (float)list5item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list6item != null)
                            list6.Add(time, (float)list6item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list7item != null)
                            list7.Add(time, (float)list7item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list8item != null)
                            list8.Add(time, (float)list8item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list9item != null)
                            list9.Add(time, (float)list9item.GetValue((object)MainV2.comPort.MAV.cs, null));
                        if (list10item != null)
                            list10.Add(time, (float)list10item.GetValue((object)MainV2.comPort.MAV.cs, null));
                    }

                    // update map
                    if (tracklast.AddSeconds(1.2) < DateTime.Now && gMapControl1.Visible)
                    {
                        if (MainV2.config["CHK_maprotation"] != null && MainV2.config["CHK_maprotation"].ToString() == "True")
                        {
                            // dont holdinvalidation here
                            setMapBearing();
                        }

                        if (route == null)
                        {
                            route = new GMapRoute(trackPoints, "track");
                            routes.Routes.Add(route);
                        }

                        PointLatLng currentloc = new PointLatLng(MainV2.comPort.MAV.cs.lat, MainV2.comPort.MAV.cs.lng);

                        gMapControl1.HoldInvalidation = true;

                        int cnt = 0;

                        while (gMapControl1.inOnPaint == true)
                        {
                            System.Threading.Thread.Sleep(1);
                            cnt++;
                        }

                        // maintain route history length
                        if (route.Points.Count > int.Parse(MainV2.config["NUM_tracklength"].ToString()))
                        {
                            //  trackPoints.RemoveRange(0, trackPoints.Count - int.Parse(MainV2.config["NUM_tracklength"].ToString()));
                            route.Points.RemoveRange(0, route.Points.Count - int.Parse(MainV2.config["NUM_tracklength"].ToString()));
                        }
                        // add new route point
                        if (MainV2.comPort.MAV.cs.lat != 0)
                        {
                            // trackPoints.Add(currentloc);
                            route.Points.Add(currentloc);
                        }

                        {

                            while (gMapControl1.inOnPaint == true)
                            {
开发者ID:LeoTosti,项目名称:x-drone,代码行数:67,代码来源:FlightData.cs


示例18: RenderPath

 private void RenderPath()
 {
     GMapRoute path = new GMapRoute(lPointsPath, "Path");
     PathOverlay.Clear();
     PathOverlay.Routes.Add(path);
     updateTable();
 }
开发者ID:BiasedMangos,项目名称:GroundControl,代码行数:7,代码来源:frmMain.cs


示例19: GetObjectData

      /// <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);
      }
开发者ID:prathika3692,项目名称:greatmaps,代码行数:25,代码来源:GMapOverlay.cs


示例20: DrawMap

        void DrawMap()
        {
            int rtcnt = 0;

            try
            {
                mapoverlay.Routes.Clear();

                DateTime starttime = DateTime.MinValue;
                DateTime workingtime = starttime;

                DateTime lastdrawn = DateTime.MinValue;

                List<PointLatLng> routelist = new List<PointLatLng>();
                List<int> samplelist = new List<int>();

                //zg1.GraphPane.GraphObjList.Clear();
				
				//check if GPS data are available
				if (!DFLog.logformat.ContainsKey("GPS"))
                    return;

                int index = DFLog.FindMessageOffset("GPS", "Lat");
                if (index == -1)
                {
                    return;
                }

                int index2 = DFLog.FindMessageOffset("GPS", "Lng");
                if (index2 == -1)
                {
                    return;
                }

                int index3 = DFLog.FindMessageOffset("GPS", "Status");
                if (index3 == -1)
                {
                    return;
                }				
				
                int i = 0;
                int firstpoint = 0;
                int b = 0;

                foreach (var item2 in logdata)
                {
                    b++;
                    var item = DFLog.GetDFItemFromLine(item2, b);

                    if (item.msgtype == "GPS")
                    {
                        var ans = getPointLatLng(item);

                        if (ans.HasValue)
                        {
                            routelist.Add(ans.Value);
							samplelist.Add(i);
							
							
							if (routelist.Count > 1000)
                            {
                                //split the route in several small parts (due to memory errors)
                                GMapRoute route_part = new GMapRoute(routelist, "route_" + rtcnt);
                                route_part.Stroke = new Pen(Color.FromArgb(127, Color.Blue), 2);

                                LogRouteInfo lri = new LogRouteInfo();
                                lri.firstpoint = firstpoint;
                                lri.lastpoint = i;
                                lri.samples.AddRange(samplelist);
                                
                                route_part.Tag = lri;
                                route_part.IsHitTestVisible = true;
                                mapoverlay.Routes.Add(route_part);
                                rtcnt++;

                                //clear the list and set the last point as first point for the next route
                                routelist.Clear();
                                samplelist.Clear();
                                firstpoint = i;
                                samplelist.Add(firstpoint);
                                routelist.Add(ans.Value);
                            }							
                        }
                    }
					i++;
                }

                GMapRoute route = new GMapRoute(routelist, "route_" + rtcnt);
                route.Stroke = new Pen(Color.FromArgb(127, Color.Blue), 2);

                LogRouteInfo lri2 = new LogRouteInfo();
                lri2.firstpoint = firstpoint;
                lri2.lastpoint = i;
                lri2.samples.AddRange(samplelist);
                route.Tag = lri2;
                route.IsHitTestVisible = true;
                mapoverlay.Routes.Add(route);
                rtcnt++;
                myGMAP1.ZoomAndCenterRoute(route);
                
//.........这里部分代码省略.........
开发者ID:shujaatak,项目名称:UAV_MissionPlanner,代码行数:101,代码来源:LogBrowse.cs



注:本文中的GMapRoute类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# GMarkerGoogle类代码示例发布时间:2022-05-24
下一篇:
C# GMapPolygon类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap