GMap.NET shows no map

♀尐吖头ヾ 提交于 2019-12-18 17:33:52

问题


I'm trying to use the GMap.NET.WindowsForms control in my Windows forms application but I cannot make it show me any map.

Here is what I did:

I added the control to my Visual Studio's 2010 toolbox by clicking 'Choose Items...' from the toolbox's context menu and browsing for the GMap.NET.WindowsForms.dll included in the downloaded zip archive. I also added references to GMap.NET.Core.dll and System.Data.SQLite.dll in my solution.

Then I put the GMapControl that appeared in the toolbox on the main form of my application and set the map type to GoogleMap. When I run my application, however, the control shows either a blue screen with a piece of text saying "We are sorry, but we don't have imagery at this zoom level for this region" or a bright screen with completely no data (when I change zoom level).

Here is my code:

  GMapMain.MapType = MapType.GoogleMap;
  GMapMain.MaxZoom = 100;
  GMapMain.MinZoom = 0;
  GMapMain.Zoom = 50;
  GMapMain.CurrentPosition = new PointLatLng(54.6961334816182, 25.2985095977783);

  GMapMain.ReloadMap();      

Please help. I have no idea what to do and I cannot find any information in the Internet that could help me solve the problem.

Thank you very much in advance.


回答1:


try setting the instance mode to server only

GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly




回答2:


You could use following statements before using gmap Control.

GMapProvider.WebProxy = WebRequest.GetSystemWebProxy();
GMapProvider.WebProxy.Credentials = CredentialCache.DefaultNetworkCredentials;



回答3:


Your zoom level looks too high.
The zoom should be between 1 and 17.




回答4:


In version 1.7.0 of GMap.NET the satellite view is not working, you should download the lastest version from here:

https://www.nuget.org/packages/GMap.NET.Presentation/

with that you can use the satellite view.

If you can see the satellite view in your environmet it's because you have the map in the cache but you will can not see some places. With the new version, you will download the map from the server and you will see it well.



来源:https://stackoverflow.com/questions/1996101/gmap-net-shows-no-map

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!