Skip to content

Commit

Permalink
Bump version number, first stab at addressing map directions off-by-ones
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil McAlister committed Sep 22, 2017
1 parent 753f543 commit a12a457
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Trippit/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="10707NeilApps.Trippit" Publisher="CN=B458EF9C-1F3A-4DD2-AB1A-76FB5056CF30" Version="1.0.7.0" />
<Identity Name="10707NeilApps.Trippit" Publisher="CN=B458EF9C-1F3A-4DD2-AB1A-76FB5056CF30" Version="1.0.8.0" />
<mp:PhoneIdentity PhoneProductId="2a6ba796-659e-4f60-90c5-77b040426db2" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>ms-resource:Trippit.Localization/AppResources/AppName</DisplayName>
Expand Down
14 changes: 14 additions & 0 deletions Trippit/ViewModels/TripResultViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Trippit.Services;
using Trippit.Services.SettingsServices;
using Trippit.Styles;
using Windows.Devices.Geolocation;
using Windows.Storage;
using Windows.UI.Xaml.Navigation;

Expand Down Expand Up @@ -166,6 +167,19 @@ private void ShowTripDetails(TripItinerary model)
}
})
.ToList();

// Add one extra point at the beginning if this is a walk leg to account for legs starting too far away
if (leg.Mode == ApiEnums.ApiMode.Walk && legIndex > 0)
{
BasicGeoposition? previousLegLastPoint = ColoredMapLines.LastOrDefault()?.LastOrDefault()?.Coordinates;
if (previousLegLastPoint != null)
{
coloredPoints.Insert(0, new ColoredMapLinePoint(previousLegLastPoint.Value, HslColors.GetModeColor(ApiEnums.ApiMode.Walk), true));
}
}

// Add one extra point at the end to account for legs ending too early
coloredPoints.Add(new ColoredMapLinePoint(leg.EndCoords, HslColors.GetModeColor(leg.Mode), leg.Mode == ApiEnums.ApiMode.Walk));
var mapLine = new ColoredMapLine(coloredPoints, legIds[legIndex]);
ColoredMapLines.Add(mapLine);
legIndex++;
Expand Down

0 comments on commit a12a457

Please # to comment.