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

刘兄弟 刘兄弟 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
简单介绍下,我引用的是高德地图源;
我想在地图上标记每个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);



}
...全文
评论 2
收藏 已收藏
分享
返回顶部
刘兄弟
.NET Framework 17,748 成员 24,324 内容