首页 > 学院 > 开发设计 > 正文

GMap.Net使用(3)之地图添加

2019-11-08 01:16:11
字体:
来源:转载
供稿:网友

GMap.Net使用(3)之地图添加

                                     --樊渝江

 

1.在窗口应用程序中添加地图

先在Form中添加GMapControl控件

然后添加如下代码:

PRivate void Form1_Load(object sender, EventArgs e)        {            //指定地图缓存存放路径            this.gMapControl1.CacheLocation = System.Windows.Forms.application.StartupPath;            //指定地图类型            this.gMapControl1.MapProvider = GMapProviders.GoogleChinaMap;            //地图加载模式(有三种模式)            this.gMapControl1.Manager.Mode = accessMode.ServerAndCache;            //地图最小比例            this.gMapControl1.MinZoom = 1;            //地图最大比例              this.gMapControl1.MaxZoom = 18;            //当前比例            this.gMapControl1.Zoom = 5;            //不显示中心十字点            this.gMapControl1.ShowCenter = false;            //左键拖拽地图            this.gMapControl1.DragButton = System.Windows.Forms.MouseButtons.Left;            //默认显示地址 经,纬            this.gMapControl1.Position = new PointLatLng(30.67, 104.06);//成都        }


上一篇:PAT 1084

下一篇:CCriticalSection的使用

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表