I have this code:
InitializeComponent();
mainMap.ShowCenter = false;
mainMap.MapProvider = GMap.NET.MapProviders.GoogleMapProvider.Instance;
//mainMap.MapProvider = GMap.NET.MapProviders.OpenStreetMapProvider.Instance;
GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly;
mainMap.DragButton = MouseButtons.Left;
mainMap.Zoom = 5;
this is working and I can see a map on my window:
Now I want to use OpenStreetMap as my map provider. So I changed it to this one:
InitializeComponent();
mainMap.ShowCenter = false;
//mainMap.MapProvider = GMap.NET.MapProviders.GoogleMapProvider.Instance;
mainMap.MapProvider = GMap.NET.MapProviders.OpenStreetMapProvider.Instance;
GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly;
mainMap.DragButton = MouseButtons.Left;
mainMap.Zoom = 5;
But I can get a map:
If I change the map provider to OpenStreet4UMapProvider, I am getting this:
So which provider should I use to show street-level data from OpenStreetMap database using GMap.Net
I found the reason for this problem:
I used version 1.7 of this control. After upgrading it to v 2.x (if you use Nuget, you need to uninstall the GMap package, search for the new version and install the new version)
After upgrading, I was able to use OpenStreetMap without any problem.