Merge branch 'Beta-Build' of https://github.com/1461748123/Pokemon-Go-Rocket-API into Beta-Build
Brian [2016-08-02 08:05:06]
Merge branch 'Beta-Build' of https://github.com/1461748123/Pokemon-Go-Rocket-API into Beta-Build
diff --git a/PokemonGo/RocketAPI/Window/RouteOptimizer.cs b/PokemonGo/RocketAPI/Window/RouteOptimizer.cs
index 8f8a73e..8b4f343 100644
--- a/PokemonGo/RocketAPI/Window/RouteOptimizer.cs
+++ b/PokemonGo/RocketAPI/Window/RouteOptimizer.cs
@@ -46,13 +46,7 @@ namespace PokemonGo.RocketAPI.Window
{
List<FortData> p = new List<FortData>((List<FortData>)o);
routeOverlay.Markers.Clear();
- List<PointLatLng> routePoint = new List<PointLatLng>();
- foreach (var pokeStop in p)
- {
- var pokeStopLoc = new PointLatLng(pokeStop.Latitude, pokeStop.Longitude);
-
- routePoint.Add(pokeStopLoc);
- }
+ List<PointLatLng> routePoint = (from pokeStop in p where pokeStop != null select new PointLatLng(pokeStop.Latitude, pokeStop.Longitude)).ToList();
routeOverlay.Routes.Clear();
routeOverlay.Routes.Add(new GMapRoute(routePoint, "Walking Path"));
}), pokeStops);
@@ -147,4 +141,4 @@ namespace PokemonGo.RocketAPI.Window
return (float)(Math.Acos(Math.Sin(lat1) * Math.Sin(lat2) + Math.Cos(lat1) * Math.Cos(lat2) * Math.Cos(dLng)) * R);
}
}
-}
\ No newline at end of file
+}
You may download the files in Public Git.