Exemple #1
0
        /// <summary>
        /// Hides the temporary via way point.
        /// </summary>
        public static void Hide()
        {
            if (instance != null)
            {
                instance.Dispose();
            }

            instance = null;
        }
        /// <summary>
        /// Handles mouse move event.
        /// Displays a draggable, temporary via way point if a route is in range.
        /// </summary>
        /// <param name="sender">Event source</param>
        /// <param name="e">Event arguments</param>
        private void Map_PreviewMouseMove(object sender, MouseEventArgs e)
        {
            Route route = null;
            var   p     = e.GetPosition(Map);

            if (GetNearestRoutePoint(48, ref route, ref p))
            {
                TemporaryVia.Show(this, route, p);
            }
            else
            {
                TemporaryVia.Hide();
            }
        }
Exemple #3
0
        /// <summary>
        /// Displays the temporary via way point
        /// </summary>
        /// <param name="layer">Assigned route layer</param>
        /// <param name="route">Assigned route</param>
        /// <param name="p">Position of the via way point (word coordinates)</param>
        public static void Show(RouteLayer layer, Route route, System.Windows.Point p)
        {
            if (instance == null)
            {
                instance = new TemporaryVia(layer, p, RouteLayer.TMPVIA_STYLE)
                {
                    ZIndex = 999
                }
            }
            ;

            instance.Route = route;
            instance.Point = p;
        }