Skip to content
Snippets Groups Projects
Commit 1e155ad9 authored by Rhys Evans's avatar Rhys Evans
Browse files

Very minor code cleanup

parent 2fd0f99d
No related branches found
No related tags found
1 merge request!40Resolve "As a user I would like to see a map containing all landmarks for a trail and a suggested path between them, so that I can easily follow the trail"
......@@ -32,16 +32,10 @@ public class PlacesController {
@GetMapping("/checkpoints")
public ModelAndView getLocationPages(){
ModelAndView modelAndView = new ModelAndView("landmarks/locationPage.html");
List<Location> locations = locationRepo.getAllLocation();
// List<Location> approvedLocations = locationRepo.getApprovedLocations2(locations);
List<LocationsCoordinates> locCoords = placeRepo.getAllLocationCoords();
List<Integer> locationIDIndex = new ArrayList<Integer>();
List<Location> locationCoordsWorkaround = new ArrayList<Location>();
for (LocationsCoordinates coord: locCoords){
locationIDIndex.add(coord.getLocationID()-1);
locationCoordsWorkaround.add(locations.get(coord.getLocationID()-1));
}
modelAndView.addObject("location", locationCoordsWorkaround);
List<Location> approvedLocations = locationRepo.getAllApprovedLocations();
modelAndView.addObject("location", approvedLocations);
modelAndView.addObject("locationCoords", locCoords);
return modelAndView;
}
......@@ -68,7 +62,6 @@ public class PlacesController {
}
String trailName=trailsRepo.getTrailNameWithID(approvedLocations.get(locationID).getLocationTrailID()).replace(' ', '-').trim();
System.out.println(trailName);
ModelAndView modelAndView= new ModelAndView("fragments/locationPageFrags :: locationSection");
modelAndView.addObject("locCoord", locCoords.get(locationID));
modelAndView.addObject("trail", trailName);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment