使用GMAP的大大们 增加自定义图片,显示图标只有一个,而且在地图中间和预计位置,新手求指点

刘兄弟 2018-12-11 11:54:03
简单介绍下,我引用的是高德地图源;
我想在地图上标记每个KTV的位置,
我将不同品牌的KTV分成了不同的层A/B/C/D/E/F....
再将某一品牌所属的KTV具体位置标注在其所在的层上面。
然后再显示在地图上。


private void Form1_Load(object sender, EventArgs e)
{
this.gMapControl1.MarkersEnabled = true;
this.gMapControl1.MapProvider = AMapProvider.Instance;
this.gMapControl1.MinZoom = 2; //最小比例
this.gMapControl1.MaxZoom = 18; //最大比例
this.gMapControl1.Zoom = 12; //当前比例
this.gMapControl1.ShowCenter = true; //不显示中心十字点
this.gMapControl1.DragButton = System.Windows.Forms.MouseButtons.Left; //左键拖拽地图
this.gMapControl1.Position = new PointLatLng(30.6156070000, 104.0567920000); //地图中心位置:成都


//以下创建各个品牌的图层
GMapOverlay A = new GMapOverlay("A");
GMapOverlay B = new GMapOverlay("B");
GMapOverlay C = new GMapOverlay("C");
GMapOverlay D = new GMapOverlay("D");
//指定路径
string pathA = "C:\\Users\\Form\\Desktop\\GMap\\GMapProvidersExt\\GMapProvidersExt\\bin\\Debug\\Logo\\A.png";
string pathB= "C:\\Users\\Form\\Desktop\\GMap\\GMapProvidersExt\\GMapProvidersExt\\bin\\Debug\\Logo\\B.png";
//增加标记
addMarker(pathA, A, new PointLatLng(104.033014, 30.49284));
addMarker(pathB, B, new PointLatLng(104.033392, 30.633004));

}
private void addMarker(string logoPath, GMapOverlay markBrand, PointLatLng point)

{
bitmap = null;
bitmap = Bitmap.FromFile(logoPath) as Bitmap;
GMapMarker marker = new GMarkerGoogle(point, bitmap);
markBrand.Markers.Add(marker);
this.gMapControl1.Overlays.Add(markBrand);



}
...全文
855 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
刘兄弟 2018-12-13
  • 打赏
  • 举报
回复
现在这个点位大家都应该可以有空刷帖子了嘛,还是各位都忙得准备过节?
刘兄弟 2018-12-12
  • 打赏
  • 举报
回复
就这么愉快的沉了下去啊,大神们速度来江湖救急啊

17,747

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET Framework
社区管理员
  • .NET Framework社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧