Ejemplo n.º 1
22
        public void DrawMarkers()
        {
            int i002 = 0;
            int i003 = 0;
            int i004 = 0;
            if (points.Count == 0)
            {
                MessageBox.Show("У маршрута несуществует точек.");
                return;
            }

            overlayOne = new GMapOverlay(gmap, "OverlayOne");

            foreach (PointD p in points)
            {
                int s = getStatus(p.code);

                if (s == 0)
                {
                    i002++;
                    GMapCustomImageMarker a = new GMapCustomImageMarker(new PointLatLng(p.getx(), p.gety()));
                    a.Tag = p;
                    overlayOne.Markers.Add(a);
                }

                if (s == 1)
                {
                    i004++;
                    GMapCustomImageMarkerRed a = new GMapCustomImageMarkerRed(new PointLatLng(p.getx(), p.gety()));
                    a.Tag = p;
                    overlayOne.Markers.Add(a);
                }

                if (s == 2)
                {
                    i003++;
                    GMapCustomImageMarkerYellow a = new GMapCustomImageMarkerYellow(new PointLatLng(p.getx(), p.gety()));
                    a.Tag = p;
                    overlayOne.Markers.Add(a);
                }

                if (s == 3)
                {
                    GMapCustomImageMarkerBlue a = new GMapCustomImageMarkerBlue(new PointLatLng(p.getx(), p.gety()));
                    a.Tag = p;
                    overlayOne.Markers.Add(a);
                }
            }
            setStatusCount(i002, i003, i004);
            DrawRoute();
            gmap.Overlays.Clear();
            gmap.Overlays.Add(overlayOne);
        }
Ejemplo n.º 2
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;
        }
Ejemplo n.º 3
1
        private void addPIN(PointLatLng point)
        {
            GMapOverlay markersOverlay = new GMapOverlay(gmap, "marker");
            this.marker = new GMapMarkerGoogleRed(point);
            markersOverlay.Markers.Add(marker);
            gmap.Overlays.Add(markersOverlay);

            marker.ToolTipText = this.article.mLink;
            marker.ToolTipMode = MarkerTooltipMode.Never;
        }
Ejemplo n.º 4
0
 private void buttonShowAllDepartments_Click(object sender, EventArgs e)
 {
     gMapControl1.Overlays.Clear();
     foreach (var c in Program.banksSystem.Department)
     {
         //Создание маркера
         GMapOverlay markersOverlay = new GMapOverlay(c.Bank1.Id.ToString());
         GMarkerGoogle marker = new GMarkerGoogle(new PointLatLng(c.Сoordinate_y, c.Сoordinate_x), GMarkerGoogleType.green);
         //Добавляем описание
         marker.ToolTip = new GMapRoundedToolTip(marker);
         marker.ToolTipText = c.Bank1.Name + "\n" + c.Name + "\n" + c.Address + "\n" + c.Phone + "\n";
         var departmentCurrencies = (from depCurr in Program.banksSystem.DeprtmentsСurrencies
                                     join curr in Program.banksSystem.Сurrency on depCurr.Сurrency equals curr
                                     where depCurr.Department == c.Id
                                     select new
                                         {
                                             Currency = curr.Name,
                                             Buy = depCurr.Buy,
                                             Sell = depCurr.Sell
                                         }).ToList();
         foreach (var cur in departmentCurrencies)
         {
             marker.ToolTipText += cur.Currency + "  " + cur.Buy + "  " + cur.Sell + "\n";
         }
         //Добавляем на карту
         markersOverlay.Markers.Add(marker);
         gMapControl1.Overlays.Add(markersOverlay);
         //fix ставим на правильное место
         gMapControl1.Position = gMapControl1.Position;
     }
 }
        public static void Build(ref GMapOverlay OverlayOut)
        {
            ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            // Display defined radars
            //
            string FileName = @"C:\ASTERIX\IMAGES\waypoint.jpg";
            Image WaypointImage = Image.FromFile(FileName);

            DisplayAttributes.DisplayAttributesType WaypointDisplayAttribute = DisplayAttributes.GetDisplayAttribute(DisplayAttributes.DisplayItemsType.Waypoint);

            WaypointImage = GraphicUtilities.ResizeImage(WaypointImage, new Size(WaypointDisplayAttribute.ImageSize.Width, WaypointDisplayAttribute.ImageSize.Height), false);

            // Here loop through defined waypoints and display them on the map
            foreach (SystemAdaptationDataSet.Waypoint Waypoint in SystemAdaptationDataSet.WaypointDataSet)
            {
                // Image properties
                GMapMarkerImage MyMarkerImage =
                    new GMapMarkerImage(new PointLatLng(Waypoint.WaypointPosition.GetLatLongDecimal().LatitudeDecimal, Waypoint.WaypointPosition.GetLatLongDecimal().LongitudeDecimal), WaypointImage);
                MyMarkerImage.ToolTipMode = MarkerTooltipMode.Never;

                System.Drawing.SolidBrush myBrush;
                myBrush = new System.Drawing.SolidBrush(WaypointDisplayAttribute.TextColor);
                WaypointMarker WPT_Marker = new WaypointMarker(new PointLatLng(Waypoint.WaypointPosition.GetLatLongDecimal().LatitudeDecimal, Waypoint.WaypointPosition.GetLatLongDecimal().LongitudeDecimal), Waypoint.WaypointName,
                   new Font(WaypointDisplayAttribute.TextFont, WaypointDisplayAttribute.TextSize, FontStyle.Regular, GraphicsUnit.Pixel), myBrush);

                // Load marker to overlay
                OverlayOut.Markers.Add(MyMarkerImage);
                OverlayOut.Markers.Add(WPT_Marker);
            }
        }
Ejemplo n.º 6
0
        public MainForm()
        {
            InitializeComponent();

             if(!DesignMode)
             {
            try
            {
               System.Net.IPHostEntry e = System.Net.Dns.GetHostEntry("www.bing.com");
            }
            catch
            {
               mapControl.Manager.Mode = AccessMode.CacheOnly;
               MessageBox.Show("No internet connection avaible, going to CacheOnly mode.", "GMap.NET - CloudsDemo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            mapControl.MapProvider = GMapProviders.BingSatelliteMap;
            mapControl.OnMapZoomChanged += new MapZoomChanged(mapControl_OnMapZoomChanged);

            mainOverlay = new GMapOverlay("top");
            mapControl.Overlays.Add(mainOverlay);

            clouds = new GMapImage(gtl);
            clouds.Image = Properties.Resources.USOverlay;
            mainOverlay.Markers.Add(clouds);
             }
        }
Ejemplo n.º 7
0
        public GridUIv2(GridPluginv2 plugin)
        {
            this.plugin = plugin;

            InitializeComponent();

            map.MapProvider = plugin.Host.FDMapType;

            map.Position = plugin.Host.FPMenuMapPosition;
            map.Zoom = 16;

            layerpolygons = new GMapOverlay( "polygons");
            map.Overlays.Add(layerpolygons);

            plugin.Host.FPDrawnPolygon.Points.ForEach(x => { list.Add(x); });

			num_overlap = 50;
			num_sidelap = 60;

            NUM_altitude.Value = 50;
			
            // set and angle that is good
            NUM_angle.Value = (decimal)((getAngleOfLongestSide(list) + 360) % 360);

        }
Ejemplo n.º 8
0
        public OperationTj(RMap mapcontrol)
            : base(mapcontrol) {

            routes = new GMapOverlay(mapcontrol, "qytj");
            routes.Markers.CollectionChanged += new GMap.NET.ObjectModel.NotifyCollectionChangedEventHandler(Markers_CollectionChanged);
            mapcontrol.Overlays.Add(routes);
        }
        public static void Build(ref GMapOverlay OverlayOut)
        {
            // Here loop through defined sectors and display them on the map
            foreach (SystemAdaptationDataSet.SectorBorder Sector in SystemAdaptationDataSet.SectorBorderDataSet)
            {
                System.Collections.Generic.List<PointLatLng> SectorPointList = new System.Collections.Generic.List<PointLatLng>();
                foreach (GeoCordSystemDegMinSecUtilities.LatLongClass SectorPoint in Sector.SectorBorderPoints)
                {
                    SectorPointList.Add(new PointLatLng(SectorPoint.GetLatLongDecimal().LatitudeDecimal, SectorPoint.GetLatLongDecimal().LongitudeDecimal));
                }

                // Get sector border display attributes
                DisplayAttributes.DisplayAttributesType SectorBorderDisplayAttribute = DisplayAttributes.GetDisplayAttribute(DisplayAttributes.DisplayItemsType.SectorBorder);

                GMapPolygon SectorPolygon = new GMapPolygon(SectorPointList, Sector.SectorName);
                SectorPolygon.Stroke = new Pen(SectorBorderDisplayAttribute.LineColor, SectorBorderDisplayAttribute.LineWidth);

                Type brushType = typeof(Brushes);

                Brush myBrush = (Brush)brushType.InvokeMember(SectorBorderDisplayAttribute.AreaPolygonColor.Name,
                 BindingFlags.Public | BindingFlags.Static | BindingFlags.GetProperty,
                 null, null, new object[] { });

                SectorPolygon.Fill = myBrush;
                OverlayOut.Polygons.Add(SectorPolygon);

            }
        }
Ejemplo n.º 10
0
        public Georefimage()
        {
            InitializeComponent();


            CHECK_AMSLAlt_Use.Checked = true;
            PANEL_TIME_OFFSET.Enabled = false;

            useAMSLAlt = CHECK_AMSLAlt_Use.Checked;

            JXL_StationIDs = new List<int>();

            selectedProcessingMode = PROCESSING_MODE.CAM_MSG;

            MissionPlanner.Utilities.Tracking.AddPage(this.GetType().ToString(), this.Text);

            myGMAP1.MapProvider = MainV2.instance.FlightData.gMapControl1.MapProvider;
            myGMAP1.MinZoom = MainV2.instance.FlightData.gMapControl1.MinZoom;
            myGMAP1.MaxZoom = MainV2.instance.FlightData.gMapControl1.MaxZoom;

            GMapOverlay overlay = new GMapOverlay();
            myGMAP1.Overlays.Add(overlay);

            myGMAP1.OnMarkerClick += MyGMAP1_OnMarkerClick;
        }
Ejemplo n.º 11
0
Archivo: SITL.cs Proyecto: kkouer/PcGcs
        public SITL()
        {
            InitializeComponent();

            if (!Directory.Exists(sitldirectory))
                Directory.CreateDirectory(sitldirectory);

            homemarker.Position = MainV2.comPort.MAV.cs.HomeLocation;

            myGMAP1.Position = homemarker.Position;

            myGMAP1.MapProvider = GCSViews.FlightData.mymap.MapProvider;
            myGMAP1.MaxZoom = 22;
            myGMAP1.Zoom = 16;
            myGMAP1.DisableFocusOnMouseEnter = true;

            markeroverlay = new GMapOverlay("markers");
            myGMAP1.Overlays.Add(markeroverlay);

            markeroverlay.Markers.Add(homemarker);

            myGMAP1.Invalidate();

            try
            {
                if (simulator != null)
                    simulator.Kill();
            }
            catch { }

            Utilities.ThemeManager.ApplyThemeTo(this);

            MissionPlanner.Utilities.Tracking.AddPage(this.GetType().ToString(), this.Text);
        }
Ejemplo n.º 12
0
        public frmMapCar95() {
            InitializeComponent();
            barButtonItem11.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right;
            btFullScrean.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            barSubItem1.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            rMap1 = new RMap();

            rMap1.MouseWheelZoomType = MouseWheelZoomType.MousePositionWithoutCenter;
            rMap1.Dock = DockStyle.Fill;
            Controls.Add(rMap1);
            mapview = rMap1;
            rMap1.Manager.Mode = GMap.NET.AccessMode.ServerOnly;
            GoogleChinaMap map = GoogleChinaMap.Instance;
            map.TryCorrectVersion = false;
            rMap1.MapProvider = map;
            //rMap1.Position = new PointLatLng(46.6, 130);
            rMap1.MaxZoom = 16;
            rMap1.MinZoom = 9;
            mapServer = ClientServer.PlatformServer.GetService<TONLI.MapCore.IMapServer>();

            objects = new GMapOverlay(rMap1, "objects");
            routes = new GMapOverlay(rMap1, "LineCode");
            
            rMap1.Overlays.Add(routes);
            rMap1.Overlays.Add(objects);

            routes.Markers.CollectionChanged += new GMap.NET.ObjectModel.NotifyCollectionChangedEventHandler(Markers_CollectionChanged);
            
            oInstances = new OperationInstances(rMap1);
            curOperation = oInstances.LineOperation;
            curOperation.CanEditMarker = true;
            rMap1.OnMapZoomChanged += new MapZoomChanged(rMap1_OnMapZoomChanged);
            rMap1.MouseEnter += new EventHandler(rMap1_MouseEnter);
            rMap1.MouseMove += new MouseEventHandler(rMap1_MouseMove);
            rMap1.MouseMove += new MouseEventHandler(MainMap_MouseMove);
            rMap1.MouseDown += new MouseEventHandler(MainMap_MouseDown);
            rMap1.MouseUp += new MouseEventHandler(MainMap_MouseUp);
            rMap1.OnMarkerEnter += new MarkerEnter(MainMap_OnMarkerEnter);
            rMap1.OnMarkerLeave += new MarkerLeave(MainMap_OnMarkerLeave);
            rMap1.OnTileLoadStart += new TileLoadStart(MainMap_OnTileLoadStart);

            rMap1.OnTileLoadComplete += new TileLoadComplete(MainMap_OnTileLoadComplete);
            barButtonItem10.ButtonStyle = DevExpress.XtraBars.BarButtonStyle.Check;
            barButtonItem10.AllowAllUp = true;
            barButtonItem4.ButtonStyle = DevExpress.XtraBars.BarButtonStyle.Check;
            barButtonItem4.DownChanged += new DevExpress.XtraBars.ItemClickEventHandler(测距_DownChanged);
            barButtonItem10.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;

            //加载设备列表
            ucLayerCar = new UCLayerCar();
            ucLayerCar.Dock = DockStyle.Fill;
            dockPanel1_Container.Controls.Add(ucLayerCar);
            bxdh = new UCPJ_21gzbxdh();
            bxdh.Dock = DockStyle.Fill;
            dockPanel2_Container.Controls.Add(bxdh);
            bxdh.OnBeginLocation += new ObjectEventHandler<PJ_21gzbxdh>(OnBeginLocation);
            bxdh.OnTQLocation += new ObjectEventHandler<PJ_21gzbxdh>(bxdh_OnTQLocation);
            this.WindowState = FormWindowState.Maximized;
            btGzdj.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
        }
Ejemplo n.º 13
0
        private void gMapControl1_Load_1(object sender, EventArgs e)
        {
            //Set the map provider
            gMapControl1.MapProvider = GMap.NET.MapProviders.OpenStreetMapProvider.Instance;

            //Set the map center
            gMapControl1.Position = new GMap.NET.PointLatLng(41.7149567, -71.4167);

            //Create an Overlay to hold marks
            GMapOverlay mark = new GMapOverlay(gMapControl1, "mark");

            //add the marks
            //this needs to populate marks for all the tags
            mark.Markers.Add(new GMap.NET.WindowsForms.Markers.GMapMarkerGoogleGreen(new PointLatLng(41.7149967, -71.369163)));
            mark.Markers.Add(new GMap.NET.WindowsForms.Markers.GMapMarkerGoogleRed(new PointLatLng(41.7149967, -71.379163)));

            //tell the map to add the overlay
            gMapControl1.Overlays.Add(mark);

            //set the settings for the map
            gMapControl1.MinZoom = 1;
            gMapControl1.MaxZoom = 17;
            gMapControl1.Zoom = 13;
            gMapControl1.Dock = DockStyle.Fill;
        }
Ejemplo n.º 14
0
        private double R = 6378137; // WGS-84;
        public NavigationView(MainForm mainForm)
        {
            mf = mainForm;
            InitializeComponent();
            mainOverlay = new GMapOverlay(MainMap, "map");
            MainMap.Overlays.Add(mainOverlay);

            //routes = new GMapOverlay(MainMap, "routes");
            //MainMap.Overlays.Add(routes);

            Net = new GMapOverlay(MainMap, "net");
            MainMap.Overlays.Add(Net);

            track = new GMapOverlay(MainMap, "polygons");
            MainMap.Overlays.Add(track);

            objects = new GMapOverlay(MainMap, "objects");
            MainMap.Overlays.Add(objects);

            rulers = new GMapOverlay(MainMap, "rulers");
            MainMap.Overlays.Add(rulers);

            DistanceInfo = new GMapOverlay(MainMap, "DistanceInfo");
            MainMap.Overlays.Add(DistanceInfo);

            infolayers = new GMapOverlay(MainMap, "Info");
            MainMap.Overlays.Add(infolayers);

            WebNodeLayer = new GMapOverlay(MainMap, "webnode");
            MainMap.Overlays.Add(WebNodeLayer);
            g = MainMap.CreateGraphics();

        }
Ejemplo n.º 15
0
        public void Build_Prediction_Marker(PointLatLng Base_Position, string ACID, MySqlProvider.PredictionTableNumberType Table_Type, ref GMapOverlay Overlay)
        {
            MySqlProvider SqlProvider = new MySqlProvider();
            System.Collections.Generic.List<MySqlProvider.PredictionDataSetOneRow> Record = SqlProvider.GetOneRecordPerTimeAndACID(Table_Type, SharedData.LookAheadTime, ACID, false);

            // If prediction data for the given parameters exists
            // then lets add it to the display list.
            if (Record.Count > 0)
            {
                GeoCordSystemDegMinSecUtilities.LatLongClass P_Pont = new GeoCordSystemDegMinSecUtilities.LatLongClass(double.Parse(Record[0].Lat), double.Parse(Record[0].Lon));

                PointLatLng PredictedPoint = new PointLatLng(P_Pont.GetLatLongDecimal().LatitudeDecimal, P_Pont.GetLatLongDecimal().LongitudeDecimal);
                PredictionMarker PM;

                string label = Record[0].ACID + "\n" + Record[0].Time.ToShortTimeString();

                switch (Table_Type)
                {
                    case MySqlProvider.PredictionTableNumberType.One:
                        PM = new PredictionMarker(Base_Position, Color.Magenta, PredictedPoint, label);
                        Overlay.Markers.Add(PM);
                        break;
                    case MySqlProvider.PredictionTableNumberType.Two:
                        PM = new PredictionMarker(Base_Position, Color.Blue, PredictedPoint, label);
                        Overlay.Markers.Add(PM);
                        break;
                    case MySqlProvider.PredictionTableNumberType.Three:
                        PM = new PredictionMarker(Base_Position, Color.Orange, PredictedPoint, label);
                        Overlay.Markers.Add(PM);
                        break;
                }
            }
        }
Ejemplo n.º 16
0
        private void cbContrib_CheckedChanged(object sender, EventArgs e)
        {
            DataTable dtMapPin = new DataTable();

            BusinessLayer.MapPin MapList = new BusinessLayer.MapPin();

            int t = 1;

            dtMapPin = MapList.getMapPinByType(t);

            GMapOverlay mark = new GMapOverlay(gMapControl1, "mark");

            if (cbContrib.Checked)
            {
                for (int j = 0; j < dtMapPin.Rows.Count; j++)
                {
                    int m = Convert.ToInt32(dtMapPin.Rows[j]["CategoryID"]);

                    if (m == 2)
                    {
                        double x = Convert.ToDouble(dtMapPin.Rows[j]["XLOC"]);
                        double y = Convert.ToDouble(dtMapPin.Rows[j]["YLOC"]);
                        mark.Markers.Add(new GMap.NET.WindowsForms.Markers.GMapMarkerGoogleRed(new PointLatLng(x, y)));
                    }

                    //tell the map to add the overlay
                    gMapControl1.Overlays.Add(mark);
                }
            }
            else
            {
                gMapControl1.Overlays.Clear();

            }
        }
        public static List<FortData> Optimize(FortData[] pokeStops, LatLong latlng, GMapOverlay routeOverlay)
        {
            List<FortData> optimizedRoute = new List<FortData>(pokeStops);

            // NN
            FortData NN = FindNN(optimizedRoute, latlng.Latitude, latlng.Longitude);
            optimizedRoute.Remove(NN);
            optimizedRoute.Insert(0, NN);
            for (int i = 1; i < pokeStops.Length; i++)
            {
                NN = FindNN(optimizedRoute.Skip(i), NN.Latitude, NN.Longitude);
                optimizedRoute.Remove(NN);
                optimizedRoute.Insert(i, NN);
                Visualize(optimizedRoute, routeOverlay);
            }

            // 2-Opt
            bool isOptimized;
            do
            {
                optimizedRoute = Optimize2Opt(optimizedRoute, out isOptimized);
                Visualize(optimizedRoute, routeOverlay);
            }
            while (isOptimized);

            return optimizedRoute;
        }
Ejemplo n.º 18
0
 public OverlayProcessor(ref Map control, ref GridDataSetManager PointManager)
 {
     Control = control;
     GDSM = PointManager;
     Layers = new List<Bitmap>();
     mainOverlay = new GMapOverlay();
     Control.Overlays.Add(mainOverlay);
 }
Ejemplo n.º 19
0
 private void Form1_Load(object sender, EventArgs e)
 {
     myMap.MapProvider = GMap.NET.MapProviders.GoogleMapProvider.Instance;
     GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly;
     myMap.Position = new GMap.NET.PointLatLng(46.25, 20.15);
     markers = new GMapOverlay("markers");
     myMap.Overlays.Add(markers);
 }
Ejemplo n.º 20
0
 public static void DrawPoint(GMapControl map, decimal latitude, decimal longitude)
 {
     GMapOverlay overlay = new GMapOverlay(map, "Stop");
     overlay.Markers.Add(new GMap.NET.WindowsForms.Markers.GMapMarkerGoogleGreen(new PointLatLng((double)latitude, (double)longitude)));
     map.Overlays.Add(overlay);
     map.ZoomAndCenterMarkers(overlay.Id);
     map.Zoom -= 2;
 }
Ejemplo n.º 21
0
        public LogBrowse()
        {
            InitializeComponent();

             mapoverlay = new GMapOverlay("overlay");

             myGMAP1.MapProvider = GMap.NET.MapProviders.GoogleSatelliteMapProvider.Instance;

             myGMAP1.Overlays.Add(mapoverlay);
        }
Ejemplo n.º 22
0
        public LogBrowse()
        {
            InitializeComponent();

             mapoverlay = new GMapOverlay(myGMAP1,"overlay");

             myGMAP1.MapType = MapType.GoogleSatellite;

             myGMAP1.Overlays.Add(mapoverlay);
        }
Ejemplo n.º 23
0
        private void Form1_Load(object sender, EventArgs e)
        {


            // Initialize map:
            gMapControl.MapProvider = GMap.NET.MapProviders.GoogleMapProvider.Instance;
            GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly;
            gMapControl.Position = new GMap.NET.PointLatLng(0.06,34);
            // gMapControl.SetPositionByKeywords("Embu, kenya");

            //Placing a marker on a certain position
            GMapOverlay markersOverlay = new GMapOverlay("markers");
            GMarkerGoogle marker = new GMarkerGoogle(new  PointLatLng(0.06, 34.2),
              GMarkerGoogleType.green);            
            marker.ToolTipText = "This is the first marker we put up";
            marker.ToolTipMode = MarkerTooltipMode.OnMouseOver;
            markersOverlay.Markers.Add(marker);
            gMapControl.Overlays.Add(markersOverlay);

            GMapOverlay markersOverlaymaseno = new GMapOverlay("markers");
            GMarkerGoogle masenomarker = new GMarkerGoogle(new PointLatLng(45, 45),
              GMarkerGoogleType.blue);
            masenomarker.ToolTipText = "This is the second marker we put up";
            masenomarker.ToolTipMode = MarkerTooltipMode.OnMouseOver;
            markersOverlay.Markers.Add(masenomarker);
            gMapControl.Overlays.Add(markersOverlay);

            markersOverlay.Markers.Add(marker);
            gMapControl.Overlays.Add(markersOverlay);

            GMapOverlay markersOverlaythird = new GMapOverlay("markers");
            GMarkerGoogle thirdmarker = new GMarkerGoogle(new PointLatLng(-45, 45),
              GMarkerGoogleType.red);
            thirdmarker.ToolTipText = "This is the third marker we put up";
            thirdmarker.ToolTipMode = MarkerTooltipMode.OnMouseOver;

            markersOverlay.Markers.Add(thirdmarker);
            gMapControl.Overlays.Add(markersOverlay);



            GMapOverlay polyOverlay = new GMapOverlay("polygons");
            List<PointLatLng> points = new List<PointLatLng>();
            points.Add(new PointLatLng(-25.969562, 32.585789));
            points.Add(new PointLatLng(-25.966205, 32.588171));
            points.Add(new PointLatLng(-25.968134, 32.591647));
            points.Add(new PointLatLng(-25.971684, 32.589759));
            GMapPolygon polygon = new GMapPolygon(points, "mypolygon");
            polygon.Fill = new SolidBrush(Color.FromArgb(50, Color.Red));
            polygon.Stroke = new Pen(Color.Red, 1);
            polyOverlay.Polygons.Add(polygon);
            gMapControl.Overlays.Add(polyOverlay);


        }
Ejemplo n.º 24
0
        private Main parent; // for SQL queries

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Constructors GoogleMap and sets gmap and the parent.
        /// Initialises the first overlay of the map.
        /// </summary>
        public GoogleMap(GMapControl gmap, Main parent)
        {
            if (gmap == null) throw new ArgumentNullException();
            if (parent == null) throw new ArgumentNullException();

            this.parent = parent;
            this.gmap = gmap;

            // overlay layer to add markers on the map
            GMapOverlay overlay = new GMapOverlay("first_layer");
            gmap.Overlays.Add(overlay);
        }
Ejemplo n.º 25
0
        public LogBrowse()
        {
            listdata = new PointPairList[] { list1, list2, list3, list4, list5, list6, list7, list8, list9, list10 };

            InitializeComponent();

             mapoverlay = new GMapOverlay(myGMAP1,"overlay");

             myGMAP1.MapType = MapType.GoogleSatellite;

             myGMAP1.Overlays.Add(mapoverlay);
        }
Ejemplo n.º 26
0
 public void DisplayMap()
 {
     GMapOverlay overlay1 = new GMapOverlay(gMapControl1, "PhotosByLocation");
     if (_passedTable != null)
     {
         foreach (DataRow dr in _passedTable.Rows)
         {
             overlay1.Markers.Add(new GMap.NET.WindowsForms.Markers.GMapMarkerGoogleGreen(new PointLatLng(Convert.ToDouble(dr["latitude"]), Convert.ToDouble(dr["longitude"]))));
         }
     }
     gMapControl1.Overlays.Add(overlay1);
 }
Ejemplo n.º 27
0
 static void DoDebug()
 {
     polygons = new GMapOverlay("polygons");
     map = new GMapControl();
     var form = new Form() { Size = new Size(1024, 768), WindowState = FormWindowState.Maximized };
     map.Dock = DockStyle.Fill;
     map.MapProvider = GMapProviders.GoogleSatelliteMap;
     map.MaxZoom = 20;
     map.Overlays.Add(polygons);
     form.Controls.Add(map);
     form.Show();
 }
Ejemplo n.º 28
0
        public LogBrowse()
        {
            InitializeComponent();

            mapoverlay = new GMapOverlay("overlay");

            myGMAP1.MapProvider = GMap.NET.MapProviders.GoogleSatelliteMapProvider.Instance;

            myGMAP1.Overlays.Add(mapoverlay);

            //CMB_preselect.DisplayMember = "Name";
            CMB_preselect.DataSource = graphs;
        }
Ejemplo n.º 29
0
        public void DrawMarkers()
        {
            overlayOne = new GMapOverlay(gmap, "OverlayOne");
            foreach (MarkerD p in marks)
            {
                    GMapCustomImageMarkerM a = new GMapCustomImageMarkerM(new PointLatLng(p.getx(), p.gety()));
                    a.Tag = p;
                    overlayOne.Markers.Add(a);
            }

            DrawRoute();
            gmap.Overlays.Clear();
            gmap.Overlays.Add(overlayOne);
        }
Ejemplo n.º 30
0
 private void button1_Click(object sender, EventArgs e)
 {
     //Создание маркера
     GMapOverlay markersOverlay = new GMapOverlay("markers");
     GMarkerGoogle marker = new GMarkerGoogle(new PointLatLng(53.899906, 27.562688), GMarkerGoogleType.green);
     //Добавляем описание
     marker.ToolTip = new GMapRoundedToolTip(marker);
     marker.ToolTipText = "Красная площадь";
     //Добавляем на карту
     markersOverlay.Markers.Add(marker);
     gMapControl1.Overlays.Add(markersOverlay);
     //fix ставим на правильное место
     gMapControl1.Position = new GMap.NET.PointLatLng(53.9018722, 27.6574339);
 }
 	private void Form1_Load(object sender, EventArgs e)
 	{
 
 		GMapControl1.DragButton = MouseButtons.Left;
 		GMapControl1.MapProvider = GMap.NET.MapProviders.GMapProviders.GoogleMap;
 		GMapControl1.Position = new PointLatLng(25.037531, 121.5639969);
 		GMapControl1.MinZoom = 5;
 		GMapControl1.MaxZoom = 20;
 		GMapControl1.ShowCenter = false;
 		GMapControl1.Zoom = 11;
 
 		gMapOverlay = new WindowsForms.GMapOverlay("markers");
 		gMapOverlay.IsVisibile = true;
 
 	}
Ejemplo n.º 32
0
        private void map_Load(object sender, EventArgs e)
        {
            SqlDataAdapter da;

            da = new SqlDataAdapter("select lat,lng,city FROM [test].[dbo].[wordcites] where city in ('Tirana','Andorra la Vella','Yerevan','Vienna','Baku','Minsk','Brussels','Sarajevo','Sofia','Zagreb','Nicosia','Prague','Copenhagen','Tallinn','Helsinki','Paris','Tbilisi','Berlin','Athens','Budapest','Reykjavik','Dublin','Rome','Pristina','Riga','Vaduz','Vilnius','Luxembourg','Valletta','Chisinau','Monaco','Podgorica','Amsterdam','Macedonia','Skopje','Oslo','Warsaw','Lisbon','Bucharest','Moscow','San Marino','Belgrade','Bratislava','Ljubljana','Madrid','Stockholm','Bern','Ankara','Kyiv','London','Vatican')", con);

            var dt = new DataTable();

            da.Fill(dt);
            dataGridView1.DataSource = dt;

            //    MySqlDataAdapter da = new MySqlDataAdapter("select * from sinkhole where sinkhole_status = '" + "Active" + "'", Conn);
            //    MySqlCommandBuilder cBuilder = new MySqlCommandBuilder(da);

            // DataTable dataTable = new DataTable();
            // DataSet ds = new DataSet();
            // da.Fill(dataTable);

            for (int i = dataGridView1.Rows.Count - 1; i >= 0; i--)
            {
                double lng   = Convert.ToDouble(dataGridView1.Rows[i].Cells[1].Value);
                double lat   = Convert.ToDouble(dataGridView1.Rows[i].Cells[0].Value);
                string misto = Convert.ToString(dataGridView1.Rows[i].Cells[2].Value);

                // double lng = double.Parse(dataGridView1.Rows[i][4].ToString());
                //  double lat = double.Parse(dataGridView1.Rows[i][3].ToString());
                //string location = dataTable.Rows[i][2].ToString();
                // string name = dataTable.Rows[i][1].ToString();
                // string desciption = dataTable.Rows[i][5].ToString();



                ////ok
                //GMap.NET.WindowsForms.GMapOverlay markers = new GMap.NET.WindowsForms.GMapOverlay("markers");
                //GMap.NET.WindowsForms.GMapMarker marker =
                //   new GMap.NET.WindowsForms.Markers.GMarkerGoogle(

                //new GMap.NET.PointLatLng(lat, lng),
                //new Bitmap("C:\\Users\\Admin\\Desktop\\1logo-większe.jpg"));
                //marker.ToolTipText = misto;
                //markers.Markers.Add(marker);
                //map.Overlays.Add(markers);


                //ok
                GMap.NET.WindowsForms.GMapOverlay markers = new GMap.NET.WindowsForms.GMapOverlay("markers");
                GMap.NET.WindowsForms.GMapMarker  marker  =
                    new GMap.NET.WindowsForms.Markers.GMarkerGoogle(
                        new GMap.NET.PointLatLng(lat, lng), GMarkerGoogleType.green);
                marker.ToolTipText = misto + " POJEMNIKÓW NA STANIE: 2000, W UŻYCIU: 1500, WOLNYCH: 500";
                markers.Markers.Add(marker);
                map.Overlays.Add(markers);



                ////ok
                GMap.NET.WindowsForms.GMapOverlay markerSs = new GMap.NET.WindowsForms.GMapOverlay("markers");
                GMap.NET.WindowsForms.GMapMarker  markerR  =
                    new GMap.NET.WindowsForms.Markers.GMarkerGoogle(

                        new GMap.NET.PointLatLng(50.9493132, 21.3966463),
                        new Bitmap("C:\\Users\\Admin\\Desktop\\1logo-większe.jpg"));
                markerR.ToolTipText = "ELKOM TRADE S.A.";
                markerSs.Markers.Add(markerR);
                map.Overlays.Add(markerSs);



                GMap.NET.WindowsForms.GMapOverlay markersSS = new GMap.NET.WindowsForms.GMapOverlay("markers");
                GMap.NET.WindowsForms.GMapMarker  markerRR  =
                    new GMap.NET.WindowsForms.Markers.GMarkerGoogle(
                        new GMap.NET.PointLatLng(41.3833, 2.1834), GMarkerGoogleType.red_big_stop);
                markerRR.ToolTipText = "BARCELONA PRZEKROCZONY CZAS ZWROTU O 15 DNI, DO ZWROTU 1200 POJEMNIKÓW ";
                markersSS.Markers.Add(markerRR);
                map.Overlays.Add(markersSS);



                //GMapOverlay markersOverlay = new GMapOverlay("markers");
                //GMarkerGoogle markerr = new GMarkerGoogle(new PointLatLng(50.9493132 ,21.3966463),
                //   new Bitmap("C:\\Users\\Admin\\Desktop\\1logo-większe.jpg"));
                //markersOverlay.Markers.Add(marker);
                //marker.ToolTipText = "WYSŁANO 2500 POJEMNIKÓW " +
                //    "OBECNIE NA STANIE 1500 POJEMNIKÓW ";
                //map.Overlays.Add(markersOverlay);



                //GMapOverlay markersOverlay = new GMapOverlay("markers");
                //GMarkerGoogle markerr = new GMarkerGoogle(new PointLatLng(50.334778, 19.256055), GMarkerGoogleType.red);
                //markersOverlay.Markers.Add(markerr);
                //markerr.ToolTipText = "HANEX 2536 POJEMNIKÓW";
                //map.Overlays.Add(markersOverlay);



                //GMapOverlay markersOverlay = new GMapOverlay("marker");
                //GMapMarkerGoogleGreen marker = new GMapMarkerGoogleGreen(new PointLatLng(lat, lng));
                //markersOverlay.Markers.Add(marker);
                ////marker.ToolTipMode = MarkerTooltipMode.Always;
                //marker.ToolTip = new GMapRoundedToolTip(marker);
                //marker.ToolTipText = "Coordinates: (" + Convert.ToString(lat) + "," + Convert.ToString(lng);
                //map.Overlays.Add(markersOverlay);
            }



            map.MapProvider = GMap.NET.MapProviders.BingHybridMapProvider.Instance;
            GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly;
            map.SetPositionByKeywords("Poland, Ostrowiec");
            map.ShowCenter = false;

            //GMap.NET.WindowsForms.GMapOverlay markers = new GMap.NET.WindowsForms.GMapOverlay("markers");
            //GMap.NET.WindowsForms.GMapMarker marker =
            //   new GMap.NET.WindowsForms.Markers.GMarkerGoogle(
            //        new GMap.NET.PointLatLng(50.9493144, 21.3960227),
            //        new Bitmap("C:\\Users\\Admin\\Desktop\\1logo-większe.jpg"));
            //marker.ToolTipText = "Nasza Firma";
            //markers.Markers.Add(marker);
            //map.Overlays.Add(markers);



            //GMapOverlay markers = new GMapOverlay("markers");
            //GMapMarker marker = new GMarkerGoogle(
            //    new PointLatLng(doubleValue, doubleValue2),
            //    new Bitmap("C:\\Users\\Admin\\Desktop\\1logo-większe.jpg"));
            //markers.Markers.Add(marker);
            //map.Overlays.Add(markers);


            //gmap.MapProvider = GMap.NET.MapProviders.GoogleMapProvider.Instance;
            //GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly;
            //gmap.Position = new PointLatLng(37.9667, 23.7167);

            //gmap.MouseClick += new MouseEventHandler(map_MouseClick);

            // Initialize map:
            //gmap.MapProvider = GMap.NET.MapProviders.GoogleMapProvider.Instance;
            //GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly;
            //gmap.Position = new PointLatLng(37.9667, 23.7167);

            //gmap.MouseClick += new MouseEventHandler(Map_MouseClick);



            //open map and create marker and its label
            map.MapProvider = GMapProviders.GoogleMap;
            map.Position    = new PointLatLng(0, 0);
            map.MinZoom     = 2;
            map.MaxZoom     = 24;
            map.Zoom        = 2;



            //GMapOverlay markersOverlay = new GMapOverlay("markers");
            //GMarkerGoogle marker = new GMarkerGoogle(new PointLatLng(50.334778, 19.256055), GMarkerGoogleType.red);
            //markersOverlay.Markers.Add(marker);
            //marker.ToolTipText = "HANEX 2536 POJEMNIKÓW";
            //gmap.Overlays.Add(markersOverlay);


            // remove marker
            // gmap.Overlays.Remove(marker);
        }
Ejemplo n.º 33
0
        public void trys()
        {
            GMap.NET.WindowsForms.GMapOverlay markers = new GMap.NET.WindowsForms.GMapOverlay("markers");

            GMapMarker markerCharlotte = new GMarkerGoogle(new PointLatLng(35.213889, -80.943056), GMarkerGoogleType.blue);

            markerCharlotte.Tag = "11057";
            markers.Markers.Add(markerCharlotte);
            GMapMarker markerFortLauderdale = new GMarkerGoogle(new PointLatLng(26.0725, -80.152778), GMarkerGoogleType.blue);

            markerFortLauderdale.Tag = "11697";
            markers.Markers.Add(markerFortLauderdale);
            GMapMarker markerFortMyers = new GMarkerGoogle(new PointLatLng(26.536111, -81.755278), GMarkerGoogleType.blue);

            markerFortMyers.Tag = "14635";
            markers.Markers.Add(markerFortMyers);
            GMapMarker markerPhoenix = new GMarkerGoogle(new PointLatLng(33.434167, -112.011667), GMarkerGoogleType.blue);

            markerPhoenix.Tag = "14107";
            markers.Markers.Add(markerPhoenix);
            GMapMarker markerAtlanta = new GMarkerGoogle(new PointLatLng(33.636667, -84.428056), GMarkerGoogleType.blue);

            markerAtlanta.Tag = "10397";
            markers.Markers.Add(markerAtlanta);
            GMapMarker marker6 = new GMarkerGoogle(new PointLatLng(42.2125, -83.353333), GMarkerGoogleType.blue);

            marker6.Tag = "DTW";
            GMapMarker marker7 = new GMarkerGoogle(new PointLatLng(26.6832, -80.0956), GMarkerGoogleType.blue);

            marker7.Tag = "PBI";
            GMapMarker marker8 = new GMarkerGoogle(new PointLatLng(40.4882, -80.2263), GMarkerGoogleType.blue);

            marker8.Tag = "PIT";
            GMapMarker marker9 = new GMarkerGoogle(new PointLatLng(39.871944, -75.241111), GMarkerGoogleType.blue);

            marker9.Tag = "PHL";
            GMapMarker marker10 = new GMarkerGoogle(new PointLatLng(27.975556, -82.533333), GMarkerGoogleType.blue);

            marker10.Tag = "TPA";
            GMapMarker marker11 = new GMarkerGoogle(new PointLatLng(25.793333, -80.290556), GMarkerGoogleType.blue);

            marker11.Tag = "MIA";
            GMapMarker marker12 = new GMarkerGoogle(new PointLatLng(33.9425, -118.408056), GMarkerGoogleType.blue);

            marker12.Tag = "LAX";
            GMapMarker marker13 = new GMarkerGoogle(new PointLatLng(32.847222, -96.851667), GMarkerGoogleType.blue);

            marker13.Tag = "DAL";
            GMapMarker marker14 = new GMarkerGoogle(new PointLatLng(39.499167, -119.768056), GMarkerGoogleType.blue);

            marker14.Tag = "RNO";
            GMapMarker marker15 = new GMarkerGoogle(new PointLatLng(36.08, -115.152222), GMarkerGoogleType.blue);

            marker15.Tag = "LAS";
            GMapMarker marker16 = new GMarkerGoogle(new PointLatLng(39.861667, -104.673056), GMarkerGoogleType.blue);

            marker16.Tag = "DEN";
            GMapMarker marker17 = new GMarkerGoogle(new PointLatLng(40.788333, -111.977778), GMarkerGoogleType.blue);

            marker17.Tag = "SLC";
            GMapMarker marker18 = new GMarkerGoogle(new PointLatLng(44.881944, -93.221667), GMarkerGoogleType.blue);

            marker18.Tag = "MSP";
            GMapMarker marker19 = new GMarkerGoogle(new PointLatLng(38.944444, -77.455833), GMarkerGoogleType.blue);

            marker19.Tag = "IAD";
            GMapMarker marker20 = new GMarkerGoogle(new PointLatLng(28.429444, -81.308889), GMarkerGoogleType.blue);

            marker20.Tag = "MCO";
            GMapMarker marker21 = new GMarkerGoogle(new PointLatLng(41.411667, -81.849722), GMarkerGoogleType.blue);

            marker21.Tag = "CLE";
            GMapMarker marker22 = new GMarkerGoogle(new PointLatLng(43.564444, -116.222778), GMarkerGoogleType.blue);

            marker22.Tag = "BOI";
            GMapMarker marker23 = new GMarkerGoogle(new PointLatLng(41.978611, -87.904724), GMarkerGoogleType.blue);

            marker23.Tag = "ORD";
            GMapMarker marker24 = new GMarkerGoogle(new PointLatLng(32.109666228, -110.937996248), GMarkerGoogleType.blue);

            marker24.Tag = "TUS";
            GMapMarker marker25 = new GMarkerGoogle(new PointLatLng(64.808996764, -147.853829918), GMarkerGoogleType.blue);

            marker25.Tag = "FAI";
            GMapMarker marker26 = new GMarkerGoogle(new PointLatLng(37.6432974268, -97.426498294), GMarkerGoogleType.blue);

            marker26.Tag = "ICT";
            GMapMarker marker27 = new GMarkerGoogle(new PointLatLng(35.436077, -82.541298), GMarkerGoogleType.blue);

            marker27.Tag = "AVL";
            GMapMarker marker28 = new GMarkerGoogle(new PointLatLng(39.053276, -84.663017), GMarkerGoogleType.blue);

            marker28.Tag = "CVG";
            GMapMarker marker29 = new GMarkerGoogle(new PointLatLng(55.35333192, -131.7083305), GMarkerGoogleType.blue);

            marker29.Tag = "KTN";
            GMapMarker marker30 = new GMarkerGoogle(new PointLatLng(42.7738469046, -84.5850476598), GMarkerGoogleType.blue);

            marker30.Tag = "LAN";
            GMapMarker marker31 = new GMarkerGoogle(new PointLatLng(35.040031, -89.981873), GMarkerGoogleType.blue);

            marker31.Tag = "MEM";
            GMapMarker marker32 = new GMarkerGoogle(new PointLatLng(33.656384, -101.821861), GMarkerGoogleType.blue);

            marker32.Tag = "LBB";
            GMapMarker marker33 = new GMarkerGoogle(new PointLatLng(40.50889, -122.29333), GMarkerGoogleType.blue);

            marker33.Tag = "RDD";
            GMapMarker marker34 = new GMarkerGoogle(new PointLatLng(43.128002, -77.665474), GMarkerGoogleType.blue);

            marker34.Tag = "ROC";
            GMapMarker marker35 = new GMarkerGoogle(new PointLatLng(57.0496, -135.361), GMarkerGoogleType.blue);

            marker35.Tag = "SIT";
            GMapMarker marker36 = new GMarkerGoogle(new PointLatLng(32.731770, -117.197624), GMarkerGoogleType.blue);

            marker36.Tag = "SAN";
            GMapMarker marker37 = new GMarkerGoogle(new PointLatLng(32.656582000000, -114.605972000000), GMarkerGoogleType.blue);

            marker37.Tag = "YUM";
            GMapMarker marker38 = new GMarkerGoogle(new PointLatLng(36.131687, -86.668823), GMarkerGoogleType.blue);

            marker38.Tag = "BNA";
            GMapMarker marker39 = new GMarkerGoogle(new PointLatLng(42.481806000000, -114.487750000000), GMarkerGoogleType.blue);

            marker39.Tag = "TWF";
            GMapMarker marker40 = new GMarkerGoogle(new PointLatLng(40.652941, -75.436502), GMarkerGoogleType.blue);

            marker40.Tag = "ABE";
            GMapMarker marker41 = new GMarkerGoogle(new PointLatLng(46.909829694, -114.087666316), GMarkerGoogleType.blue);

            marker41.Tag = "MSO";
            GMapMarker marker42 = new GMarkerGoogle(new PointLatLng(35.617500, -106.088333), GMarkerGoogleType.blue);

            marker42.Tag = "SAF";

            gmap.Overlays.Add(markers);


            //Implementacion poligonos.

            /*GMapOverlay polyOverlay = new GMapOverlay("polygons");
             * List<GMap.NET.PointLatLng> points = new List<GMap.NET.PointLatLng>();
             * points.Add(new PointLatLng(40.652941, -75.436502));
             * points.Add(new PointLatLng(40.002941, -75.006502));
             * points.Add(new PointLatLng(40.300041, -75.300002));
             * points.Add(new PointLatLng(40.652941, -75.436502));
             * GMapPolygon polygon = new GMapPolygon(points, "mypolygon");
             * polygon.Fill = new SolidBrush(Color.FromArgb(50, Color.Red));
             * polygon.Stroke = new Pen(Color.Red, 1);
             * polyOverlay.Polygons.Add(polygon);
             * gmap.Overlays.Add(polyOverlay);*/
        }