private void NavigateToStart() { // Creates a new Bing Maps task. BingMapsTask task = new BingMapsTask(); task.Center = StartCoordinates.ToGeoCoordinate(); task.SearchTerm = String.Format("{0}", StartCoordinates.ToString(WF.Player.Core.GeoCoordinateUnit.DecimalDegrees)); task.ZoomLevel = 2; // Starts the task. task.Show(); }
private void RefreshLocatedContent() { if (Cartridge == null) { return; } // Starting point. if (Cartridge.IsPlayAnywhere) { // Start pushpin -> hidden // Player marker -> visible // Map center -> player position // Sets the start location from device location, so that the map center reflects // the player position. if (Model.Core.DeviceLocation == null) { // No location yet: display a default. StartCoordinates = WF.Player.Core.ZonePoint.Zero; } else { // Change the current coordinates if it is far enough from the last one. if (StartCoordinates == null || Model.Core.DeviceLocation.GetDistanceTo(StartCoordinates.ToGeoCoordinate()) > 50) { StartCoordinates = Model.Core.DeviceLocation.ToZonePoint(); } } IsStartPushpinVisible = false; VectorToStartingCoordinate = null; } else { // Start pushpin -> visible // Player marker -> visible // Map center -> start location StartCoordinates = Cartridge.StartingLocation; IsStartPushpinVisible = true; VectorToStartingCoordinate = Model.Core.DeviceLocation == null ? null : Model.Core.DeviceLocation.ToZonePoint().GetVectorTo(StartCoordinates); } }