Quantcast
Channel: GMap.NET - Great Maps for Windows Forms & Presentation
Viewing all articles
Browse latest Browse all 3384

New Post: WPF custom route marker

$
0
0
Hi Radioman!
Thanks for your job, I already used it for my projects, really helpful!
I am stuck with an issue concerning custom marker route for WPF.
I did some custom marker for points (defined in xaml) but I didn't manage to do it for routes.

I put my code below, can you give me some advices?

Thanks for your help,
Melanie

XAML
<UserControl...>
    <Path Name="pathMarker" />
</UserControl>
CodeBehind
{
    public partial class PathMarker : UserControl, IGenericMarker
    {
        #region Properties
        public int StartVisibiltyZoomLevel { get; set; }
        public int StopVisibiltyZoomLevel { get; set; }
        public GMapControl Map { get; set; }
        #endregion

        #region Constructor
        public PathMarker (GMapControl mainMap, int visibilityStartLevel, int visibilityStopLeve, Brush color)
        {
            InitializeComponent();
            this.Map = mainMap;
            InitializeComponent();
            pathMarker.Stroke = color;
            this.StartVisibiltyZoomLevel = visibilityStartLevel;
            this.StopVisibiltyZoomLevel = visibilityStopLevel;
        }
        #endregion
Marker instantiation
PointLatLng ptw = new PointLatLng(marker.StartPoint.Lat, marker.StartPoint.Long);
                        GMapMarker path = new GMapMarker(ptw);
                        path.Shape = new PathMarker(MainMap, marker.VisibilityStartLevel, MainMap.MaxZoom, Brushes.Orange);
                        MainMap.Markers.Add(path );
                    
Thank you and sorry for my broken english
Melanie

Viewing all articles
Browse latest Browse all 3384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>