This commit is contained in:
2015-12-24 14:02:33 +01:00
parent 2e9538c58d
commit 855448a00c
15 changed files with 41 additions and 51 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ namespace NavCityBreda.Helpers
foreach(JToken t in waypoints)
{
if(!ValidateWaypointObject(t, out error))
throw new FileLoadException("Invalid Waypoint information in " + datafile + ", " + error);
throw new FileLoadException("Invalid Waypoint (#" + (count+1) + ") information in " + datafile + ", " + error);
Waypoint w;
+10 -9
View File
@@ -36,11 +36,12 @@ namespace NavCityBreda.Helpers
return timestr;
}
public static async Task<MapLocation> FindLocation(string location, Geopoint reference)
public static async Task<Geopoint> FindLocation(string location, Geopoint reference)
{
MapLocationFinderResult result = await MapLocationFinder.FindLocationsAsync(location, reference);
MapLocation from = result.Locations.First();
return from;
MapLocation from = result.Locations.FirstOrDefault();
Geopoint p = from.Point;
return p;
}
public static async Task<MapRoute> FindWalkingRoute(Geopoint from, Geopoint to)
@@ -59,9 +60,9 @@ namespace NavCityBreda.Helpers
public static async Task<MapRoute> FindWalkingRoute(string from, string to, Geopoint reference)
{
MapLocation f = await FindLocation(from, reference);
MapLocation t = await FindLocation(to, reference);
MapRoute m = await FindWalkingRoute(f.Point, t.Point);
Geopoint f = await FindLocation(from, reference);
Geopoint t = await FindLocation(to, reference);
MapRoute m = await FindWalkingRoute(f, t);
return m;
}
@@ -81,9 +82,9 @@ namespace NavCityBreda.Helpers
public static async Task<MapRoute> FindDrivingRoute(string from, string to, Geopoint reference)
{
MapLocation f = await FindLocation(from, reference);
MapLocation t = await FindLocation(to, reference);
MapRoute m = await FindDrivingRoute(f.Point, t.Point);
Geopoint f = await FindLocation(from, reference);
Geopoint t = await FindLocation(to, reference);
MapRoute m = await FindDrivingRoute(f, t);
return m;
}
-2
View File
@@ -92,8 +92,6 @@ namespace NavCityBreda.Model
_position = await geo.GetGeopositionAsync();
_status = PositionStatus.Initializing;
return "Connected";
case GeolocationAccessStatus.Denied:
+1 -1
View File
@@ -54,7 +54,7 @@ namespace NavCityBreda.Model
Id = _namekey + "_" + Order;
Icon = new MapIcon();
Icon.Location = Location;
Icon.Location = Position;
Icon.NormalizedAnchorPoint = new Point(0.5, 1.0);
Icon.Title = Name;
Icon.ZIndex = 500;
+1 -1
View File
@@ -76,7 +76,7 @@ namespace NavCityBreda.Model
public async Task<String> CalculateRoute()
{
_route = await Util.FindWalkingRoute(_waypoints.Select(p => p.Location).ToList());
_route = await Util.FindWalkingRoute(_waypoints.Select(p => p.Position).ToList());
return "success";
}
+1 -1
View File
@@ -183,7 +183,7 @@ namespace NavCityBreda.Model
if (App.Geo.Position == null) return "error";
_currentlandmark = _currentroute.Landmarks.FirstOrDefault(p => !p.Visited);
_routetolandmark = await Util.FindWalkingRoute(App.Geo.Position.Coordinate.Point, _currentlandmark.Location);
_routetolandmark = await Util.FindWalkingRoute(App.Geo.Position.Coordinate.Point, _currentlandmark.Position);
_currentroutelegs = _routetolandmark.Legs.ToList() as List<MapRouteLeg>;
_currentroutelegcount = 0;
_currentmaneuvercount = 0;
+5 -5
View File
@@ -11,7 +11,7 @@ namespace NavCityBreda.Model
{
public class Waypoint
{
public Geopoint Location { get; protected set; }
public Geopoint Position { get; protected set; }
protected string _namekey;
public string Name { get { return Util.Loader.GetString( _namekey ); } }
@@ -20,14 +20,14 @@ namespace NavCityBreda.Model
public Waypoint(Geopoint p, string name, int num)
{
Location = p;
Position = p;
_namekey = name;
Order = num;
}
public Waypoint(double la, double lo, string name, int num)
{
Location = new Geopoint(new BasicGeoposition() { Altitude = 0, Latitude = la, Longitude = lo });
Position = new Geopoint(new BasicGeoposition() { Altitude = 0, Latitude = la, Longitude = lo });
_namekey = name;
Order = num;
}
@@ -37,10 +37,10 @@ namespace NavCityBreda.Model
Waypoint r = obj as Waypoint;
MapIcon i = obj as MapIcon;
if (r != null && r.Name == this.Name && r.Location == this.Location)
if (r != null && r.Name == this.Name && r.Position == this.Position)
return true;
if (i != null && i.Title == this.Name && i.Location == this.Location)
if (i != null && i.Title == this.Name && i.Location == this.Position)
return true;
return false;
+1 -1
View File
@@ -15,7 +15,7 @@
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="NavCityBreda.App">
<uap:VisualElements DisplayName="Nav City Breda" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Tourist navigation app for the cirty Breda." BackgroundColor="transparent">
<uap:VisualElements DisplayName="Nav City Breda" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Tourist navigation app for the city Breda." BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" ShortName="ags_logo">
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
+1 -1
View File
@@ -86,7 +86,7 @@ namespace NavCityBreda.ViewModels
private async void LoadStreet()
{
address = await Util.FindAddress(landmark.Location);
address = await Util.FindAddress(landmark.Position);
NotifyPropertyChanged(nameof(Address));
}
}
-2
View File
@@ -95,8 +95,6 @@ namespace NavCityBreda.ViewModels
switch(App.Geo.Status)
{
case PositionStatus.Disabled:
NotifyPropertyChanged(Source);
NotifyPropertyChanged(Accuracy);
return Util.Loader.GetString("Disabled");
case PositionStatus.Initializing:
return Util.Loader.GetString("Initializing");
+2 -2
View File
@@ -160,7 +160,7 @@ namespace NavCityBreda.Views
foreach (Landmark l in r.Landmarks)
{
if (!l.Visited)
GeofenceMonitor.Current.Geofences.Add(new Geofence(l.Id, new Geocircle(l.Location.Position, 35), MonitoredGeofenceStates.Entered, true));
GeofenceMonitor.Current.Geofences.Add(new Geofence(l.Id, new Geocircle(l.Position.Position, 35), MonitoredGeofenceStates.Entered, true));
l.UpdateIcon();
await Task.Delay(TimeSpan.FromMilliseconds(3));
Map.MapElements.Add(l.Icon);
@@ -205,7 +205,7 @@ namespace NavCityBreda.Views
await Map.TryTiltToAsync(55);
}
if (App.CompassTracker.Heading.HeadingTrueNorth.HasValue)
if (App.CompassTracker.Heading != null && App.CompassTracker.Heading.HeadingTrueNorth.HasValue)
{
await Task.Delay(TimeSpan.FromMilliseconds(300));
await Map.TryRotateToAsync((double)App.CompassTracker.Heading.HeadingTrueNorth);
+2 -1
View File
@@ -59,7 +59,8 @@
<StackPanel Grid.Row="4" Name="LandmarkListPanel" Margin="10">
<TextBlock Text="{Binding LandmarksTitle}" Style="{StaticResource Header}"/>
<ListView x:Name="LandmarkList" ItemsSource="{Binding Landmarks}" IsItemClickEnabled="True" ItemClick="LandmarkList_ItemClick">
<ListView x:Name="LandmarkList" ItemsSource="{Binding Landmarks}" IsItemClickEnabled="True" ItemClick="LandmarkList_ItemClick"
ScrollViewer.HorizontalScrollMode="Disabled" ScrollViewer.VerticalScrollMode="Disabled">
<ListView.ItemTemplate>
<DataTemplate x:Name="ListViewDataTemplate">
<StackPanel Orientation="Horizontal">
+4 -1
View File
@@ -7,6 +7,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<ScrollViewer>
<Grid Grid.Row="2" Name="RouteListPanel">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -15,7 +16,8 @@
<TextBlock Margin="17,10,5,10" Text="{Binding Description}" TextWrapping="WrapWholeWords" Grid.Row="0"/>
<ListView x:Name="RouteList" Grid.Row="1" ItemsSource="{Binding Routes}" Margin="0,10,0,0" IsItemClickEnabled="True" ItemClick="RouteList_ItemClick">
<ListView x:Name="RouteList" Grid.Row="1" ItemsSource="{Binding Routes}" Margin="0,10,0,0" IsItemClickEnabled="True" ItemClick="RouteList_ItemClick"
ScrollViewer.HorizontalScrollMode="Disabled" ScrollViewer.VerticalScrollMode="Disabled">
<ListView.ItemTemplate>
<DataTemplate x:Name="ListViewDataTemplate">
<StackPanel Margin="5,0,0,0">
@@ -27,4 +29,5 @@
</ListView>
</Grid>
</ScrollViewer>
</Page>
+12 -19
View File
@@ -7,24 +7,17 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid>
<ScrollViewer>
<StackPanel HorizontalAlignment="Stretch">
<StackPanel Margin="10">
<TextBlock FontSize="20" Text="{Binding Language}" Margin="0,0,0,10"/>
<ComboBox Name="Language" SelectionChanged="Language_SelectionChanged" HorizontalAlignment="Stretch">
<ComboBoxItem>English</ComboBoxItem>
<ComboBoxItem>Nederlands</ComboBoxItem>
<!-- <ComboBoxItem>Deutsch</ComboBoxItem> -->
<!-- <ComboBoxItem>日本語</ComboBoxItem> -->
</ComboBox>
<ProgressRing IsActive="False" Name="LanguageLoading" />
</StackPanel>
<TextBlock Text="Settings - Add TileMapOption" Grid.Row="0" Margin="10"/>
<ScrollViewer>
<StackPanel HorizontalAlignment="Stretch">
<StackPanel Margin="10">
<TextBlock FontSize="20" Text="{Binding Language}" Margin="0,0,0,10"/>
<ComboBox Name="Language" SelectionChanged="Language_SelectionChanged" HorizontalAlignment="Stretch">
<ComboBoxItem>English</ComboBoxItem>
<ComboBoxItem>Nederlands</ComboBoxItem>
<!-- <ComboBoxItem>Deutsch</ComboBoxItem> -->
<!-- <ComboBoxItem>日本語</ComboBoxItem> -->
</ComboBox>
</StackPanel>
</ScrollViewer>
</Grid>
</StackPanel>
</ScrollViewer>
</Page>
-4
View File
@@ -60,8 +60,6 @@ namespace NavCityBreda.Views
private void Language_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
LanguageLoading.IsActive = true;
switch(Language.SelectedIndex)
{
default:
@@ -84,8 +82,6 @@ namespace NavCityBreda.Views
Settings.ChangeLanguage("ja");
break;
}
LanguageLoading.IsActive = false;
}
}
}