GMap.NET Question

I am trying to use GMap.NET to display a map using the following code

GMapControl g = new GMapControl(); GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly; g.Dock = DockStyle.Fill; pnlMap.Controls.Add(g); g.MapType = MapType.GoogleMap; g.MaxZoom = 6; g.MinZoom = 1; g.Position = new PointLatLng(51.31835, 0.873866); 

The problem is that the control is loading, but there is no visible map inside. Does anyone know what I might need

thanks

edit:

The fix was this

  public Form1() { InitializeComponent(); SuspendLayout(); GMapControl MainMap = new GMapControl(); { MainMap.MapProvider = GMapProviders.YahooMap; MainMap.Position = new PointLatLng(54.6961334816182, 25.2985095977783); MainMap.MinZoom = 1; MainMap.MaxZoom = 17; MainMap.Zoom = 9; MainMap.Dock = DockStyle.Fill; } Controls.Add(MainMap); ResumeLayout(true); } 
+4
source share

All Articles