使用GMAP的大大们 增加自定义图片,显示图标只有一个,而且在地图中间和预计位置,新手求指点
简单介绍下,我引用的是高德地图源;
我想在地图上标记每个KTV的位置,
我将不同品牌的KTV分成了不同的层A/B/C/D/E/F....
再将某一品牌所属的KTV具体位置标注在其所在的层上面。
然后再显示在地图上。
我想在地图上标记每个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);
}
...全文
相关推荐
GMap地图控件GMarkerOverlay使用例程
使用GMap控件进行开发时,在地图层上的GMarkerOverlay的使用例程
在WinForm和WPF中使用GMap.Net地图插件简单教程
GMap.NET是一个强大、免费、跨平台、开源的.NET控件,它在Windows Forms 和WPF环境中能够使用来自Google, Yahoo!, Bing, OpenStreetMap, ArcGIS, Pergo, SigPac等地图,下面看一下使用方法
C#调用GMap在地图上打点等操作
C#调用GMap在地图上打点, 绘制多边形, 显示标签, 点闪烁
GMap.Net开发之自定义Marker使用方法
主要介绍了GMap中Marker的使用方法,有需要的朋友可以参考一下
GMAP地图控件示例
GMAP地图控件基本操作演示,c#代码封装了一个控件,一般地图功能,本地化; 地图能够完成一般绘制,查询,已经包括了基本功能


.NET Framework
