Skip to main content
 首页 » 编程设计

c#之一个工作的 GMap.NET 应用程序源

2024年01月22日32kerrycode

关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。












想改进这个问题?将问题更新为 on-topic对于堆栈溢出。

6年前关闭。




Improve this question




我第一次使用 GMap,但我的 map 不会显示...我正在寻找一个工作的 c# 应用程序源。你能帮助我吗?

注意:我已经下载了this和 this来自 http://greatmaps.codeplex.com 的文件,但它们只是应用程序,不包括源...

谢谢。

请您参考如下方法:

这是带有 gMapControl1 的表格在上面。在 Gmap.NET.Core 上添加引用和 Gmap.NET.WindowsForms到你的项目。

using System; 
using System.Windows.Forms; 
using GMap.NET.MapProviders; 
using GMap.NET; 
 
namespace gmap 
{ 
    public partial class Form1 : Form 
    { 
        public Form1() 
        { 
            InitializeComponent(); 
        } 
 
        private void Form1_Load(object sender, EventArgs e) 
        { 
            //use google provider 
            gMapControl1.MapProvider = GoogleMapProvider.Instance; 
            //get tiles from server only 
            gMapControl1.Manager.Mode = AccessMode.ServerOnly; 
            //not use proxy 
            GMapProvider.WebProxy = null; 
            //center map on moscow 
            gMapControl1.Position = new PointLatLng(55.755786121111, 37.617633343333); 
 
            //zoom min/max; default both = 2 
            gMapControl1.MinZoom = 1; 
            gMapControl1.MaxZoom = 20; 
            //set zoom 
            gMapControl1.Zoom = 10; 
        } 
    } 
}