【发布时间】:2019-01-20 09:35:21
【问题描述】:
我想在 WPF 中使用 GMAP.NET 我添加了 GMap.NET.Core.dll 和 GMap.NET.WindowsForms.dll 作为对我的项目的引用。 在document 的帮助下,我正在使用 GMAP.Net,但在 WPF 中。现在我想为我的标记使用自定义图标,但我找不到方法。 我的代码如下
gmap.MapProvider = GMap.NET.MapProviders.BingMapProvider.Instance;
GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly;
gmap.Position = new GMap.NET.PointLatLng(35.6960617168288, 51.4005661010742);
gmap.ShowCenter = false;
GMap.NET.WindowsPresentation.GMapMarker marker = new GMap.NET.WindowsPresentation.GMapMarker(new GMap.NET.PointLatLng(35.6960617168288, 51.4005661010742));
marker.Shape = new Ellipse
{
Width = 10,
Height = 10,
Stroke = Brushes.Red,
StrokeThickness = 1.5,
ToolTip = "This is tooltip",
Visibility=Visibility.Visible,
Fill=Brushes.Red,
};
gmap.Markers.Add(marker);
感谢任何帮助。
【问题讨论】: