Exemplo n.º 1
0
        private void DrawPath(bool isGeodesic)
        {
            ClearMap();

            MapPolyline line = new MapPolyline();

            line.StrokeColor     = Colors.Red;
            line.StrokeThickness = 4;
            List <BasicGeoposition> templine = new List <BasicGeoposition>();

            currentAnimation = new PathAnimation(path, (coord, pathIdx, frameIdx) =>
            {
                if (frameIdx == 1)
                {
                    //Create the line after the first frame so that we have two points to work with.
                    templine.Add(path.Positions[0]);
                    templine.Add(coord);
                    line.Path = new Geopath(templine);

                    MyMap.MapElements.Add(line);
                }
                else if (frameIdx > 1)
                {
                    templine.Add(coord);
                    line.Path = new Geopath(templine);
                    MyMap.MapElements.Add(line);
                }
            }, isGeodesic, 10000);

            currentAnimation.Play();
        }
Exemplo n.º 2
0
        private void MovePinOnPath(bool isGeodesic)
        {
            Image forImage = new Image();

            forImage.Source = new BitmapImage(new Uri("ms-appx:///Assets/pin.png"));
            MapControl.SetLocation(forImage, new Geopoint(path.Positions[0]));
            MapItems.Items.Add(forImage);

            currentAnimation = new PathAnimation(path, (coord, pathIdx, frameIdx) =>
            {
                MapControl.SetLocation(forImage, new Geopoint(coord));
            }, isGeodesic, 10000);

            currentAnimation.Play();
        }
Exemplo n.º 3
0
        private void MoveMapOnPath(bool isGeodesic)
        {
            ClearMap();

            //Change zooms levels as map reaches points along path.
            int[] zooms = new int[4] {
                5, 4, 6, 5
            };
            MyMap.ZoomLevel = zooms[0];
            MyMap.Center    = new Geopoint(path.Positions[0]);

            currentAnimation = new PathAnimation(path, (coord, pathIdx, frameIdx) =>
            {
                MyMap.ZoomLevel = zooms[pathIdx];
                MyMap.Center    = new Geopoint(coord);
            }, isGeodesic, 10000);

            currentAnimation.Play();
        }