Finished navigation and camera controls
This commit is contained in:
@@ -243,4 +243,7 @@
|
|||||||
<data name="RouteIn" xml:space="preserve">
|
<data name="RouteIn" xml:space="preserve">
|
||||||
<value>in</value>
|
<value>in</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="LandmarkReached" xml:space="preserve">
|
||||||
|
<value>You have reached a landmark</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -243,4 +243,7 @@
|
|||||||
<data name="RouteIn" xml:space="preserve">
|
<data name="RouteIn" xml:space="preserve">
|
||||||
<value>over</value>
|
<value>over</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="LandmarkReached" xml:space="preserve">
|
||||||
|
<value>U heeft een bezienswaardigheid bereikt</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -63,8 +63,7 @@
|
|||||||
<SplitView.Pane>
|
<SplitView.Pane>
|
||||||
<RelativePanel Name="MySplitviewPane" VerticalAlignment="Stretch"
|
<RelativePanel Name="MySplitviewPane" VerticalAlignment="Stretch"
|
||||||
ManipulationMode="TranslateX"
|
ManipulationMode="TranslateX"
|
||||||
ManipulationCompleted="MySplitviewPane_ManipulationCompleted"
|
ManipulationCompleted="MySplitviewPane_ManipulationCompleted" Style="{ThemeResource DarkModeFix}">
|
||||||
Background="Transparent">
|
|
||||||
|
|
||||||
<ListBox RelativePanel.AlignTopWithPanel="True" SelectionMode="Single" Name="NavList" SelectionChanged="NavList_SelectionChanged" Tapped="NavList_Tapped">
|
<ListBox RelativePanel.AlignTopWithPanel="True" SelectionMode="Single" Name="NavList" SelectionChanged="NavList_SelectionChanged" Tapped="NavList_Tapped">
|
||||||
<ListBoxItem Name="NavListMap">
|
<ListBoxItem Name="NavListMap">
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ namespace NavCityBreda.Model
|
|||||||
});
|
});
|
||||||
_currentlandmark = i;
|
_currentlandmark = i;
|
||||||
LandmarkVisited(i, LandmarkVisitedEventArgs.VisitedStatus.ENTERED);
|
LandmarkVisited(i, LandmarkVisitedEventArgs.VisitedStatus.ENTERED);
|
||||||
Util.SendToastNotification(i.Name, "TRANSLATED MESSAGE");
|
Util.SendToastNotification(i.Name, Util.Loader.GetString("LandmarkReached"));
|
||||||
UpdateRoute();
|
UpdateRoute();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,8 +197,6 @@ namespace NavCityBreda.Model
|
|||||||
|
|
||||||
public async void StartRoute(Route r)
|
public async void StartRoute(Route r)
|
||||||
{
|
{
|
||||||
Util.SendToastNotification("Starting", "TRANSLATED MESSAGE");
|
|
||||||
|
|
||||||
App.Geo.ClearHistory();
|
App.Geo.ClearHistory();
|
||||||
_currentroute = r;
|
_currentroute = r;
|
||||||
await UpdateRoute();
|
await UpdateRoute();
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:local="using:NavCityBreda.Themes">
|
xmlns:local="using:NavCityBreda.Themes">
|
||||||
|
|
||||||
<Style TargetType="TextBlock">
|
<Style TargetType="RelativePanel" x:Key="DarkModeFix">
|
||||||
<Setter Property="Foreground" Value="White"/>
|
<Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeMediumLowBrush}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|||||||
@@ -2,5 +2,9 @@
|
|||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:local="using:NavCityBreda.Themes">
|
xmlns:local="using:NavCityBreda.Themes">
|
||||||
|
|
||||||
|
<Style TargetType="RelativePanel" x:Key="DarkModeFix">
|
||||||
|
<Setter Property="Background" Value="Transparent" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|||||||
@@ -73,6 +73,19 @@ namespace NavCityBreda.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool Tracking
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Settings.Tracking;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
Settings.Tracking = value;
|
||||||
|
NotifyPropertyChanged(nameof(Tracking));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void UpdateMap()
|
public void UpdateMap()
|
||||||
{
|
{
|
||||||
if(App.MainPage != null)
|
if(App.MainPage != null)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<Page.Resources>
|
<Page.Resources>
|
||||||
<convert:BoolToVisibilityConverter x:Key="BoolConverter" />
|
<convert:BoolToVisibilityConverter x:Key="BoolConverter" />
|
||||||
</Page.Resources>
|
</Page.Resources>
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
@@ -21,18 +21,32 @@
|
|||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<StackPanel Grid.Row="0" Background="Gray" Visibility="{Binding Instructions, Converter={StaticResource BoolConverter}}">
|
<StackPanel Grid.Row="0" Background="Gray" Visibility="{Binding Instructions, Converter={StaticResource BoolConverter}}">
|
||||||
<Viewbox StretchDirection="DownOnly" Stretch="UniformToFill" Margin="10,5,10,5">
|
<Viewbox Grid.Column="1" StretchDirection="DownOnly" Stretch="UniformToFill" Margin="10,5,10,5">
|
||||||
<TextBlock FontSize="20" Text="{Binding Landmark}" Foreground="White" />
|
<TextBlock FontSize="20" Text="{Binding Landmark}" Foreground="White" Tapped="LandmarkName_Tapped" />
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<map:MapControl Grid.Row="1" Name="Map" MapElementClick="Map_MapElementClick" ZoomInteractionMode="GestureAndControl" PedestrianFeaturesVisible="True" PanInteractionMode="Auto" TiltInteractionMode="ControlOnly" RotateInteractionMode="GestureAndControl" MapServiceToken="74Y70e71HVjjN7lnx4Eh~3wugTlBDe2DbPGuR_AM2aA~AjMbg-pU2qn4gYf97oH0GZI1oY9Jc4vH-4WyIRyoYQM0Q71CnfbWalEN37bdSgms" />
|
|
||||||
|
|
||||||
<StackPanel Grid.Row="2" Background="LightGray" Visibility="{Binding Instructions, Converter={StaticResource BoolConverter}}">
|
<map:MapControl Grid.Row="1" Name="Map" MapElementClick="Map_MapElementClick" PedestrianFeaturesVisible="True" MapServiceToken="74Y70e71HVjjN7lnx4Eh~3wugTlBDe2DbPGuR_AM2aA~AjMbg-pU2qn4gYf97oH0GZI1oY9Jc4vH-4WyIRyoYQM0Q71CnfbWalEN37bdSgms" />
|
||||||
<Viewbox StretchDirection="DownOnly" Stretch="UniformToFill" Margin="10,5,10,5">
|
|
||||||
|
<Grid Grid.Row="2" Background="LightGray" Visibility="{Binding Instructions, Converter={StaticResource BoolConverter}}">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Button Grid.Column="0" Click="RecalculateRoute_Click" VerticalAlignment="Stretch">
|
||||||
|
<TextBlock FontFamily="Segoe MDL2 Assets" Text="" />
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Viewbox Grid.Column="1" StretchDirection="DownOnly" Stretch="UniformToFill" Margin="10,5,10,5">
|
||||||
<TextBlock FontSize="14" Text="{Binding Maneuver}" />
|
<TextBlock FontSize="14" Text="{Binding Maneuver}" />
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
</StackPanel>
|
|
||||||
|
<ToggleButton Grid.Column="2" Name="TrackUser" Click="TrackUser_Click" IsChecked="{Binding Tracking}" VerticalAlignment="Stretch">
|
||||||
|
<TextBlock FontFamily="Segoe MDL2 Assets" Text="" />
|
||||||
|
</ToggleButton>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Page>
|
</Page>
|
||||||
@@ -37,6 +37,8 @@ namespace NavCityBreda.Views
|
|||||||
MapIcon CurrentPosition;
|
MapIcon CurrentPosition;
|
||||||
MapPolyline CurrentNavigationLine;
|
MapPolyline CurrentNavigationLine;
|
||||||
|
|
||||||
|
private bool Zooming = false;
|
||||||
|
|
||||||
MapVM mapvm;
|
MapVM mapvm;
|
||||||
|
|
||||||
public MapView()
|
public MapView()
|
||||||
@@ -52,10 +54,8 @@ namespace NavCityBreda.Views
|
|||||||
CurrentPosition.Title = "";
|
CurrentPosition.Title = "";
|
||||||
CurrentPosition.ZIndex = 999;
|
CurrentPosition.ZIndex = 999;
|
||||||
CurrentPosition.Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/CurrentLocationRound.png"));
|
CurrentPosition.Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/CurrentLocationRound.png"));
|
||||||
Map.MapElements.Add(CurrentPosition);
|
|
||||||
|
|
||||||
CurrentNavigationLine = new MapPolyline() { StrokeColor = Color.FromArgb(255, 255, 100, 100), StrokeThickness = 6, ZIndex = 100 };
|
CurrentNavigationLine = new MapPolyline() { StrokeColor = Color.FromArgb(255, 125, 255, 150), StrokeThickness = 5, ZIndex = 100 };
|
||||||
//Map.MapElements.Add(CurrentNavigationLine);
|
|
||||||
|
|
||||||
App.Geo.OnPositionUpdate += Geo_OnPositionUpdate;
|
App.Geo.OnPositionUpdate += Geo_OnPositionUpdate;
|
||||||
App.RouteManager.OnStatusUpdate += RouteManager_OnStatusUpdate;
|
App.RouteManager.OnStatusUpdate += RouteManager_OnStatusUpdate;
|
||||||
@@ -63,6 +63,8 @@ namespace NavCityBreda.Views
|
|||||||
App.RouteManager.OnLandmarkVisited += RouteManager_OnLandmarkVisited;
|
App.RouteManager.OnLandmarkVisited += RouteManager_OnLandmarkVisited;
|
||||||
App.CompassTracker.OnSlowHeadingUpdated += CompassTracker_OnHeadingUpdated;
|
App.CompassTracker.OnSlowHeadingUpdated += CompassTracker_OnHeadingUpdated;
|
||||||
Settings.OnLanguageUpdate += Settings_OnLanguageUpdate;
|
Settings.OnLanguageUpdate += Settings_OnLanguageUpdate;
|
||||||
|
|
||||||
|
Track(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Settings_OnLanguageUpdate(EventArgs e)
|
private void Settings_OnLanguageUpdate(EventArgs e)
|
||||||
@@ -80,10 +82,9 @@ namespace NavCityBreda.Views
|
|||||||
{
|
{
|
||||||
Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
|
Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
|
||||||
{
|
{
|
||||||
if (Settings.Tracking && e.Heading.HeadingTrueNorth.HasValue)
|
if (mapvm.Tracking && e.Heading.HeadingTrueNorth.HasValue)
|
||||||
Map.TryRotateToAsync((double)e.Heading.HeadingTrueNorth);
|
Map.TryRotateToAsync((double)e.Heading.HeadingTrueNorth);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RouteManager_OnLandmarkVisited(object sender, LandmarkVisitedEventArgs e)
|
private void RouteManager_OnLandmarkVisited(object sender, LandmarkVisitedEventArgs e)
|
||||||
@@ -128,13 +129,16 @@ namespace NavCityBreda.Views
|
|||||||
Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
|
Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
|
||||||
{
|
{
|
||||||
if (e.Status == RouteManager.RouteStatus.STARTED)
|
if (e.Status == RouteManager.RouteStatus.STARTED)
|
||||||
|
{
|
||||||
DrawRoute();
|
DrawRoute();
|
||||||
|
ZoomRoute();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
RemoveRoute();
|
RemoveRoute();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawRoute()
|
private async void DrawRoute()
|
||||||
{
|
{
|
||||||
if (App.RouteManager.Status != RouteManager.RouteStatus.STARTED) return;
|
if (App.RouteManager.Status != RouteManager.RouteStatus.STARTED) return;
|
||||||
|
|
||||||
@@ -144,9 +148,12 @@ namespace NavCityBreda.Views
|
|||||||
|
|
||||||
GeofenceMonitor.Current.Geofences.Clear();
|
GeofenceMonitor.Current.Geofences.Clear();
|
||||||
Map.MapElements.Clear();
|
Map.MapElements.Clear();
|
||||||
|
await Task.Delay(TimeSpan.FromMilliseconds(10));
|
||||||
Map.MapElements.Add(CurrentPosition);
|
Map.MapElements.Add(CurrentPosition);
|
||||||
Map.MapElements.Add(CurrentNavigationLine);
|
Map.MapElements.Add(CurrentNavigationLine);
|
||||||
|
|
||||||
|
Map.MapElements.Add(Util.GetRouteLine(App.RouteManager.CurrentRoute.RouteObject, Color.FromArgb(200, 100, 100, 255), 50, 3));
|
||||||
|
|
||||||
if (App.Geo.History.Count > 1)
|
if (App.Geo.History.Count > 1)
|
||||||
Map.MapElements.Add(Util.GetRouteLine(App.Geo.History.Select(p => p.Coordinate.Point.Position).ToList(), Color.FromArgb(255, 155, 155, 155), 250, 6));
|
Map.MapElements.Add(Util.GetRouteLine(App.Geo.History.Select(p => p.Coordinate.Point.Position).ToList(), Color.FromArgb(255, 155, 155, 155), 250, 6));
|
||||||
|
|
||||||
@@ -155,59 +162,89 @@ namespace NavCityBreda.Views
|
|||||||
if (!l.Visited)
|
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.Location.Position, 35), MonitoredGeofenceStates.Entered, true));
|
||||||
l.UpdateIcon();
|
l.UpdateIcon();
|
||||||
|
await Task.Delay(TimeSpan.FromMilliseconds(3));
|
||||||
Map.MapElements.Add(l.Icon);
|
Map.MapElements.Add(l.Icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map.MapElements.Add(Util.GetRouteLine(App.RouteManager.CurrentRoute.RouteObject, Color.FromArgb(200, 100, 100, 255), 50, 3));
|
|
||||||
|
|
||||||
ZoomRoute();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RemoveRoute()
|
private void RemoveRoute()
|
||||||
{
|
{
|
||||||
Settings.Tracking = true;
|
Track(false);
|
||||||
Map.MapElements.Clear();
|
Map.MapElements.Clear();
|
||||||
|
GeofenceMonitor.Current.Geofences.Clear();
|
||||||
DrawCurrenPosition(App.Geo.Position.Coordinate.Point);
|
DrawCurrenPosition(App.Geo.Position.Coordinate.Point);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawCurrenPosition(Geopoint p)
|
private void DrawCurrenPosition(Geopoint p)
|
||||||
{
|
{
|
||||||
if (!Map.MapElements.Contains(CurrentPosition))
|
if (!Map.MapElements.Contains(CurrentPosition))
|
||||||
|
{
|
||||||
Map.MapElements.Add(CurrentPosition);
|
Map.MapElements.Add(CurrentPosition);
|
||||||
|
Zoom();
|
||||||
|
}
|
||||||
|
|
||||||
CurrentPosition.Location = p;
|
CurrentPosition.Location = p;
|
||||||
if (Settings.Tracking)
|
if (mapvm.Tracking)
|
||||||
Zoom();
|
Zoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<String> Zoom()
|
private async Task<String> Zoom()
|
||||||
{
|
{
|
||||||
await Task.Delay(TimeSpan.FromMilliseconds(500));
|
if (!Zooming)
|
||||||
await Map.TrySetViewAsync(CurrentPosition.Location, 17);
|
{
|
||||||
|
Zooming = true;
|
||||||
|
|
||||||
if(App.RouteManager.Status == RouteManager.RouteStatus.STARTED)
|
|
||||||
{
|
|
||||||
await Task.Delay(TimeSpan.FromMilliseconds(500));
|
await Task.Delay(TimeSpan.FromMilliseconds(500));
|
||||||
await Map.TryTiltToAsync(40);
|
await Map.TrySetViewAsync(CurrentPosition.Location, 18);
|
||||||
|
|
||||||
|
if (mapvm.Tracking)
|
||||||
|
{
|
||||||
|
if (Map.Pitch != 55)
|
||||||
|
{
|
||||||
|
await Task.Delay(TimeSpan.FromMilliseconds(300));
|
||||||
|
await Map.TryTiltToAsync(55);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (App.CompassTracker.Heading.HeadingTrueNorth.HasValue)
|
||||||
|
{
|
||||||
|
await Task.Delay(TimeSpan.FromMilliseconds(300));
|
||||||
|
await Map.TryRotateToAsync((double)App.CompassTracker.Heading.HeadingTrueNorth);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Map.Pitch != 0)
|
||||||
|
{
|
||||||
|
await Task.Delay(TimeSpan.FromMilliseconds(300));
|
||||||
|
await Map.TryTiltToAsync(0);
|
||||||
|
}
|
||||||
|
if (Map.Heading != 0)
|
||||||
|
{
|
||||||
|
await Task.Delay(TimeSpan.FromMilliseconds(300));
|
||||||
|
await Map.TryRotateToAsync(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
Zooming = false;
|
||||||
|
return "success";
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return "error";
|
||||||
await Task.Delay(TimeSpan.FromMilliseconds(500));
|
|
||||||
await Map.TryTiltToAsync(0);
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void ZoomRoute()
|
private async void ZoomRoute()
|
||||||
{
|
{
|
||||||
Settings.Tracking = false;
|
DisableControls(true);
|
||||||
await Task.Delay(TimeSpan.FromMilliseconds(500));
|
mapvm.Tracking = false;
|
||||||
await Map.TrySetViewBoundsAsync(App.RouteManager.CurrentRoute.Bounds, null, Windows.UI.Xaml.Controls.Maps.MapAnimationKind.Default);
|
TrackUser.IsEnabled = false;
|
||||||
await Task.Delay(TimeSpan.FromMilliseconds(500));
|
await Task.Delay(TimeSpan.FromMilliseconds(500));
|
||||||
await Map.TryRotateToAsync(0);
|
await Map.TryRotateToAsync(0);
|
||||||
await Task.Delay(TimeSpan.FromMilliseconds(1500));
|
await Task.Delay(TimeSpan.FromMilliseconds(300));
|
||||||
|
await Map.TrySetViewBoundsAsync(App.RouteManager.CurrentRoute.Bounds, null, Windows.UI.Xaml.Controls.Maps.MapAnimationKind.Default);
|
||||||
|
await Task.Delay(TimeSpan.FromMilliseconds(1000));
|
||||||
|
mapvm.Tracking = true;
|
||||||
await Zoom();
|
await Zoom();
|
||||||
Settings.Tracking = true;
|
TrackUser.IsEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Map_MapElementClick(MapControl sender, MapElementClickEventArgs args)
|
private void Map_MapElementClick(MapControl sender, MapElementClickEventArgs args)
|
||||||
@@ -225,5 +262,58 @@ namespace NavCityBreda.Views
|
|||||||
|
|
||||||
App.MainPage.Navigate(typeof(LandmarkView), l);
|
App.MainPage.Navigate(typeof(LandmarkView), l);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void LandmarkName_Tapped(object sender, TappedRoutedEventArgs e)
|
||||||
|
{
|
||||||
|
App.MainPage.Navigate(typeof(LandmarkView), App.RouteManager.CurrentLandmark);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RecalculateRoute_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
App.RouteManager.UpdateRoute();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TrackUser_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Track((bool)((ToggleButton)sender).IsChecked);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void Track(bool tracking)
|
||||||
|
{
|
||||||
|
mapvm.Tracking = tracking;
|
||||||
|
|
||||||
|
if(tracking)
|
||||||
|
{
|
||||||
|
DisableControls(true);
|
||||||
|
|
||||||
|
if (CurrentPosition.Location != null)
|
||||||
|
await Zoom();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (CurrentPosition.Location != null)
|
||||||
|
await Zoom();
|
||||||
|
|
||||||
|
DisableControls(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DisableControls(bool disable)
|
||||||
|
{
|
||||||
|
if (disable)
|
||||||
|
{
|
||||||
|
Map.PanInteractionMode = MapPanInteractionMode.Disabled;
|
||||||
|
Map.RotateInteractionMode = MapInteractionMode.Disabled;
|
||||||
|
Map.TiltInteractionMode = MapInteractionMode.Disabled;
|
||||||
|
Map.ZoomInteractionMode = MapInteractionMode.Disabled;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Map.PanInteractionMode = MapPanInteractionMode.Auto;
|
||||||
|
Map.RotateInteractionMode = MapInteractionMode.GestureAndControl;
|
||||||
|
Map.TiltInteractionMode = MapInteractionMode.GestureOnly;
|
||||||
|
Map.ZoomInteractionMode = MapInteractionMode.GestureAndControl;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,14 +69,16 @@ namespace NavCityBreda.Views
|
|||||||
|
|
||||||
Zoom();
|
Zoom();
|
||||||
|
|
||||||
|
await Task.Delay(TimeSpan.FromMilliseconds(10));
|
||||||
|
|
||||||
MapPolyline m = Util.GetRouteLine(route.RouteObject, Color.FromArgb(255, 100, 100, 255), 25, 6);
|
MapPolyline m = Util.GetRouteLine(route.RouteObject, Color.FromArgb(255, 100, 100, 255), 25, 6);
|
||||||
Map.MapElements.Add(m);
|
Map.MapElements.Add(m);
|
||||||
|
|
||||||
foreach (Landmark l in route.Landmarks)
|
foreach (Landmark l in route.Landmarks)
|
||||||
{
|
{
|
||||||
l.UpdateIcon();
|
l.UpdateIcon();
|
||||||
Map.MapElements.Add(l.Icon);
|
|
||||||
await Task.Delay(TimeSpan.FromMilliseconds(3));
|
await Task.Delay(TimeSpan.FromMilliseconds(3));
|
||||||
|
Map.MapElements.Add(l.Icon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user