Exemple #1
0
        private void DrawPath(bool isGeodesic)
        {
            ClearMap();

            MapPolyline line = new MapPolyline()
            {
                Color = Colors.Red,
                Width = 4
            };

            currentAnimation = new Animations.PathAnimation(path, (coord, pathIdx, frameIdx) =>
            {
                if (frameIdx == 1)
                {
                    //Create the line after the first frame so that we have two points to work with.
                    line.Locations = new LocationCollection()
                    {
                        path[0], coord
                    };
                    shapeLayer.Shapes.Add(line);
                }
                else if (frameIdx > 1)
                {
                    line.Locations.Add(coord);
                }
            }, isGeodesic, 10000);

            currentAnimation.Play();
        }
Exemple #2
0
        private void ClearMap()
        {
            MyMap.Children.Clear();
            shapeLayer.Shapes.Clear();

            if (currentAnimation != null)
            {
                currentAnimation.Stop();
                currentAnimation = null;
            }
        }
Exemple #3
0
        private void MovePinOnPath(bool isGeodesic)
        {
            ClearMap();

            var pin = new Pushpin();

            MapLayer.SetPosition(pin, path[0]);

            MyMap.Children.Add(pin);

            currentAnimation = new Animations.PathAnimation(path, (coord, pathIdx, frameIdx) =>
            {
                MapLayer.SetPosition(pin, coord);
            }, isGeodesic, 10000);

            currentAnimation.Play();
        }
Exemple #4
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.SetView(path[0], zooms[0]);

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

            currentAnimation.Play();
        }