当前位置: 首页>>代码示例>>C#>>正文


C# WindowsForms.GMapControl类代码示例

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


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

示例1: MapAdapter

        public MapAdapter(GMapControl mapControl)
        {
            _context = new WindowsFormsSynchronizationContext();

            _mapControl = mapControl;

            IObservable<Unit> positionChanged = Observable
                .FromEvent<PositionChanged, PointLatLng>(
                    action => point => action(point),
                    handler => _mapControl.OnPositionChanged += handler,
                    handler => _mapControl.OnPositionChanged -= handler)
                .Select(i => Unit.Default);


            IObservable<Unit> mapZoom = Observable
                .FromEvent<MapZoomChanged, Unit>(
                    action => () => action(Unit.Default),
                    handler => _mapControl.OnMapZoomChanged += handler,
                    handler => _mapControl.OnMapZoomChanged -= handler);


            MapChanged = positionChanged
                .Merge(mapZoom)
                .ObserveOn(ThreadPoolScheduler.Instance);

            mapControl.OnMapDrag += MapControl_OnMapDrag;
            mapControl.OnPolygonClick += Control_OnPolygonClick;
        }
开发者ID:nitbot,项目名称:MissionPlanner,代码行数:28,代码来源:MapAdapter.cs

示例2: GMapMarkerTarget

 public GMapMarkerTarget(PointLatLng p, GMapControl map, Bitmap icon)
     : base(p)
 {
     Size = SizeSt;
     MainMap = map;
     this.icon = icon;
 }
开发者ID:JamesMasterman,项目名称:SeaScan,代码行数:7,代码来源:GMapMarkerTarget.cs

示例3: FeedMarker

 public FeedMarker(PointLatLng loc, Article art, GMapControl gmap)
 {
     location = loc;
     article = art;
     this.gmap = gmap;
     addPIN(location);
 }
开发者ID:shank8,项目名称:CPTS-323,代码行数:7,代码来源:FeedMarker.cs

示例4: PloyLineOverLay

 public PloyLineOverLay(GMapControl map, string layid)
     : base(map, layid) {
     control = map;
     map.OnMarkerEnter += new MarkerEnter(map_OnMarkerEnter);
     map.OnMarkerLeave += new MarkerLeave(map_OnMarkerLeave);
     map.OnMapZoomChanged += new MapZoomChanged(map_OnMapZoomChanged);
 }
开发者ID:s7loves,项目名称:mypowerscgl,代码行数:7,代码来源:PloyLineOverLay.cs

示例5: LineOverlay

 public LineOverlay(GMapControl map, string lineCode)
     : base(map, lineCode) {
     map.OnMarkerEnter += new MarkerEnter(map_OnMarkerEnter);
     map.OnMarkerLeave += new MarkerLeave(map_OnMarkerLeave);
     map.OnMapZoomChanged += new MapZoomChanged(map_OnMapZoomChanged);
     this.Markers.CollectionChanged += new GMap.NET.ObjectModel.NotifyCollectionChangedEventHandler(Markers_CollectionChanged);
     control = map;
 }
开发者ID:s7loves,项目名称:mypowerscgl,代码行数:8,代码来源:LineOverLay.cs

示例6: DrawPoint

 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;
 }
开发者ID:richardpianka,项目名称:Transit,代码行数:8,代码来源:MapUtilities.cs

示例7: DoDebug

 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();
 }
开发者ID:Event38,项目名称:MissionPlanner,代码行数:12,代码来源:Grid.cs

示例8: GoogleMap

        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);
        }
开发者ID:TristanZeph,项目名称:QDMS_INB201,代码行数:22,代码来源:GoogleMap.cs

示例9: GMapOverlay

      public GMapOverlay(GMapControl control, string id)
      {
         if(control == null)
         {
            throw new Exception("GMapControl in GMapOverlay can't be null");
         }

         Control = control;
         Id = id;
         Markers.CollectionChanged += new NotifyCollectionChangedEventHandler(Markers_CollectionChanged);
         Routes.CollectionChanged += new NotifyCollectionChangedEventHandler(Routes_CollectionChanged);
         Polygons.CollectionChanged += new NotifyCollectionChangedEventHandler(Polygons_CollectionChanged);
      }
开发者ID:neolu,项目名称:MissionPlanner,代码行数:13,代码来源:GMapOverlay.cs

示例10: OnLoad

        public override void OnLoad(GMapControl gMapControl)
        {
            _gMapControl = gMapControl;
            _gMapControl.Overlays.Add(_gMapOverlay);

            _points = new List<PointLatLng>();
            _gMapControl.Overlays.Add(_gMapOverlay);
            _gMapControl.Overlays.Add(_highLightOverlay);
            _start = false;
            _queryResultForm = new QueryResultForm();
            this._mapUrl = ((SuperMapProvider)gMapControl.MapProvider).ServiceUrl;
            this._mapName = ((SuperMapProvider)gMapControl.MapProvider).MapName;
            InitLayers();
            base.OnLoad(gMapControl);
        }
开发者ID:SuperMap,项目名称:iClient-DotNet-Example,代码行数:15,代码来源:QueryByPolygonForm.cs

示例11: StaticImage

        public StaticImage(GMapControl main)
        {
            InitializeComponent();

             this.MainMap = main;

             numericUpDown1.Maximum = MainMap.MaxZoom;
             numericUpDown1.Minimum = MainMap.MinZoom;
             numericUpDown1.Value = MainMap.Zoom;

             bg.WorkerReportsProgress = true;
             bg.WorkerSupportsCancellation = true;
             bg.DoWork += new DoWorkEventHandler(bg_DoWork);
             bg.ProgressChanged += new ProgressChangedEventHandler(bg_ProgressChanged);
             bg.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bg_RunWorkerCompleted);
        }
开发者ID:wrbrooks,项目名称:VB3,代码行数:16,代码来源:StaticImage.cs

示例12: MapPrintPreviewForm

        public MapPrintPreviewForm(GMapControl ctrlGMap)
            : this()
        {
            #region Create Map copied

            gMap.Manager.Mode = AccessMode.ServerOnly;
            gMap.MinZoom = ctrlGMap.MinZoom;
            gMap.MaxZoom = ctrlGMap.MaxZoom;
            gMap.Zoom = ctrlGMap.Zoom;
            gMap.Position = ctrlGMap.Position;
            gMap.MouseWheelZoomEnabled = ctrlGMap.MouseWheelZoomEnabled;
            gMap.MouseWheelZoomType = ctrlGMap.MouseWheelZoomType;
            gMap.EmptyTileColor = System.Drawing.Color.Aquamarine;
            gMap.GrayScaleMode = true;
            gMap.Manager.UsePlacemarkCache = false;
            gMap.ConnectionString = (ctrlGMap is CustomGMapControl)
                ? ((CustomGMapControl)ctrlGMap).ConnectionString
                : null;
            gMap.OnTileLoadComplete += GMap_OnTileLoadComplete;
            gMap.OnTileLoadStart += GMap_OnTileLoadStart;
            gMap.Manager.UseMemoryCache = true;

            //gMap.Manager.CancelTileCaching();

            foreach (GMapOverlay overlay in ctrlGMap.Overlays)
            {
                foreach (var marker in overlay.Markers)
                {
                    gMap.AddMarker(marker);
                }

                foreach (var route in overlay.Routes)
                {
                    var r = new GMapRoute(route.Name);
                    r.Points.AddRange(route.Points);
                    r.Stroke = route.Stroke;

                    gMap.AddRoute(r);
                }

                gMap.SetMapBound();
            }

            #endregion            
        }
开发者ID:Behzadkhosravifar,项目名称:greatmaps,代码行数:45,代码来源:MapPrintPreviewForm.cs

示例13: 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

示例14: GMapMarkerWind

        public GMapMarkerWind(PointLatLng p, GMapControl map, float bearing, float speed)
            : base(p)
        {
            Size = SizeSt;
            MainMap = map;

            this.bearing = bearing;
            this.speed = speed;

            if (speed > ORANGE_SPEED_LIMIT)
            {
                icon = global::SeaScanUAV.Properties.Resources.Orange_N;
            }
            else if (speed > RED_SPEED_LIMIT)
            {
                icon = global::SeaScanUAV.Properties.Resources.Red_N;
            }
        }
开发者ID:JamesMasterman,项目名称:SeaScan,代码行数:18,代码来源:GMapMarkerWind.cs

示例15: GMapRestImagery

        public GMapRestImagery()
        {
            //_baseUri = baseUri;

            _levels = new RasterLevel[NumberOfLevels];
            _levelsCollection = new RasterLevelCollection(_levels);

            double deltaLongitude = LevelZeroDeltaLongitudeDegrees;
            double deltaLatitude = LevelZeroDeltaLatitudeDegrees;
            for (int i = 0; i < _levels.Length; ++i)
            {
                int longitudePosts = (int)Math.Round(360.0 / deltaLongitude) * TileLongitudePosts + 1;
                int latitudePosts = (int)Math.Round(180 / deltaLatitude) * TileLatitudePosts + 1;
                _levels[i] = new RasterLevel(this, i, _extent, longitudePosts, latitudePosts, TileLongitudePosts, TileLatitudePosts);
                deltaLongitude /= 2.0;
                deltaLatitude /= 2.0;
            }

            MainMap = new GMapControl();
            MainMap.MapType = GMap.NET.MapType.GoogleSatellite;

            MainMap.CacheLocation = Path.GetDirectoryName(Application.ExecutablePath) + "/gmapcache/";
        }
开发者ID:CJBlake,项目名称:ardupilotone,代码行数:23,代码来源:temp.cs


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