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 issue is, the control loads but there is no visible map inside. Does anyone know what i might need to do
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);
}