Ejemplo n.º 1
0
        private void CreateInitialPath()
        {
            removeLastPoint = false;
            editRouteNotification = new NotificationEventArgs
            {
                Id         = Guid.NewGuid(),
                Background = AppState.AccentBrush,
                Foreground = Brushes.White,
                Header     = "Edit route",
                Text       = "Click the route, including way points.",
                Duration   = TimeSpan.FromDays(1),
                Options    = new List<string> { "DONE" }
            };

            editRouteNotification.OptionClicked += (sender, args) =>
            {
                removeLastPoint = !args.UsesTouch; // Only remove the last point when the mouse was used.
                draw.CompleteDraw();
            };
            AppState.TriggerNotification(editRouteNotification);

            draw = new Draw(AppState.ViewDef.MapControl)
            {
                DrawMode = DrawMode.Polyline,
                LineSymbol = new LineSymbol
                {
                    Width = Poi.NEffectiveStyle.StrokeWidth.HasValue ? Poi.NEffectiveStyle.StrokeWidth.Value : 2,
                    Color = new SolidColorBrush(Poi.NEffectiveStyle.StrokeColor.HasValue ? Poi.NEffectiveStyle.StrokeColor.Value : Colors.Black)
                },
                IsEnabled = true,
            };
            // Add the first point (drop point)
            draw.AddVertex(webMercator.FromGeographic(new MapPoint(Poi.Position.Longitude, Poi.Position.Latitude)) as MapPoint);

            draw.DrawComplete += OnDrawingCompleted;
        }