Finished Google Maps API
This commit is contained in:
@@ -7,7 +7,7 @@ public class FlightPath {
|
||||
private ArrayList<FlightPoint> flightPoints;
|
||||
private String departureAirport;
|
||||
private String arrivalAirport;
|
||||
private RoutePath routePath;
|
||||
final private RoutePath routePath = new RoutePath();
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -91,8 +91,7 @@ public class FlightPath {
|
||||
}
|
||||
|
||||
public RoutePath getRoutePath(){
|
||||
if (routePath == null){
|
||||
routePath = new RoutePath();
|
||||
if (routePath.getRoute().size() == 0){
|
||||
for (FlightPoint point: flightPoints){
|
||||
routePath.addPosition(new Position(point.getLatitude(), point.getLongitude()));
|
||||
}
|
||||
|
||||
@@ -22,6 +22,10 @@ public class RoutePath {
|
||||
route.add(position);
|
||||
}
|
||||
|
||||
public ArrayList<Position> getRoute() {
|
||||
return route;
|
||||
}
|
||||
|
||||
public String toJSONArray() {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.append("[");
|
||||
@@ -32,4 +36,5 @@ public class RoutePath {
|
||||
stringBuilder.append("]");
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user