GMap.NET问题
我正在尝试使用 GMap.NET 使用以下代码显示地图
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);
问题是,控件加载但内部没有可见的地图。有谁知道我可能需要做什么
谢谢
编辑:
修复是这样的
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);
}
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);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论