Exemple #1
0
        /// <summary>
        /// This function should be called when the slider value changes
        /// </summary>
        /// <param name="value">The value of the slider</param>
        public void SliderValueChanged(int value)
        {
            MapPolylines = maker.CreateRoute(_data, value);
            MapCenter    = _data.Route.ElementAt(value);

            RaiseEvent(new EventArgs());
        }
        public void RouteMaker_CreateRoutePoint_CreatesRoute()
        {
            if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
            {
                throw new ThreadStateException("The current threads apartment state is not STA");
            }

            DataProvider data = Factories.GetRouteData();

            RouteMaker maker    = new RouteMaker();
            var        testData = maker.CreateRoute(data, 3);

            List <Microsoft.Maps.MapControl.WPF.MapPolyline> locations = new List <Microsoft.Maps.MapControl.WPF.MapPolyline>();

            MapPolyline arrow = new Microsoft.Maps.MapControl.WPF.MapPolyline();
            MapPolyline line  = new Microsoft.Maps.MapControl.WPF.MapPolyline();

            Setup(line);

            line.Locations = new LocationCollection();

            for (int i = 0; i < 3; i++)
            {
                var loc = data.Route.ElementAt(i);
                line.Locations.Add(new Location(loc));
            }

            arrow = GetArrow(data.Route.First(), data.Route.ElementAt(1));

            locations.Add(line);
            locations.Add(arrow);

            Assert.IsTrue(CompareMapPolylines.compare(locations.ElementAt(0), testData.ElementAt(0)));
            Assert.IsTrue(CompareMapPolylines.compare(locations.ElementAt(1), testData.ElementAt(1)));
        }
Exemple #3
0
 /// <summary>
 /// This function draws the route. It needs to be called after the constructor finishes
 /// </summary>
 public void Initialize()
 {
     _mapPolylines = maker.CreateRoute(_data);
     RaiseEvent(new EventArgs());
 }