Exemplo n.º 1
0
        private void ChangeMission(string mission)
        {
            // Stop animating the current mission.
            _animationTimer.Stop();

            // Get mission data.
            _missionData = GetMissionData(mission);

            // Draw mission route on the inset.
            // Create a collection of points to hold the mission.
            PointCollection points = new PointCollection(SpatialReferences.Wgs84);

            // Add all of the points from the mission to the point collection.
            points.AddPoints(_missionData.Select(m => m.ToMapPoint()));

            // Create a polyline to symbolize the route from the point collection.
            _routeGraphic.Geometry = new Polyline(points);

            // Update animation parameters.
            _frameCount = _missionData.Length;
            _keyframe   = 0;

            // Set the _playButton button back to the currently 'playing' state
            _playButton.Title = "Pause";

            // Restart the animation.
            _animationTimer.Start();
        }
        private async Task ChangeMission(string mission)
        {
            // Stop animating the current mission
            _animationTimer.Stop();

            // Get mission data
            _missionData = GetMissionData(mission);

            // Draw mission route on the inset
            // Create a collection of points to hold the mission
            PointCollection points = new PointCollection(SpatialReferences.Wgs84);

            // Add all of the points from the mission to the point collection
            points.AddPoints(_missionData.Select(m => m.ToMapPoint()));
            // Create a polyline to symbolize the route from the point collection
            Polyline route = new Polyline(points);

            // Update the route graphic's geometry with the newly created route polyline
            _routeGraphic.Geometry = route;
            // Update the inset map's scale
            await InsetMapView.SetViewpointScaleAsync(100000);

            // Update animation parameters
            _frameCount = _missionData.Length;
            _keyframe   = 0;

            // Set the MissionPlayPause button back to the currently 'playing' state
            MissionPlayPause.Content = "Pause";

            // Restart the animation
            _animationTimer.Start();
        }
        private async Task ChangeMission(string mission)
        {
            // Stop animating the current mission.
            _animationTimer.Stop();

            // Get mission data.
            _missionData = GetMissionData(mission);

            // Draw mission route on the inset.
            // Create a collection of points to hold the mission.
            PointCollection points = new PointCollection(SpatialReferences.Wgs84);

            // Add all of the points from the mission to the point collection.
            points.AddPoints(_missionData.Select(m => m.ToMapPoint()));

            // Create a polyline to symbolize the route from the point collection.
            _routeGraphic.Geometry = new Polyline(points);

            // Update the inset map's scale.
            await _insetMapView.SetViewpointScaleAsync(100000);

            // Update animation parameters.
            _frameCount = _missionData.Length;
            _keyframe   = 0;

            // Restart the animation.
            _animationTimer.Start();
        }