Skip to content

Instantly share code, notes, and snippets.

@MBAustin
Created November 27, 2016 08:23
Show Gist options
  • Select an option

  • Save MBAustin/ad3c26b3991e1eb38c6b573d7bc00e8d to your computer and use it in GitHub Desktop.

Select an option

Save MBAustin/ad3c26b3991e1eb38c6b573d7bc00e8d to your computer and use it in GitHub Desktop.
/**
* Plot selected lines on map
*/
private void plotLines() {
StationManager stationManager = StationManager.getInstance();
Station stationObject = stationManager.getSelected();
if (stationObject != null) {
for (Line line : stationObject.getLines()) {
int color = line.getColour();
Set<Branch> setOfLineBranches = line.getBranches();
for (Branch lineBranch : setOfLineBranches) {
Polyline plotLine = new Polyline(mapView.getContext());
List<LatLon> listOfLatLonFromBranch = lineBranch.getPoints();
List<GeoPoint> geoPointConversions = new ArrayList<>();
for (LatLon latlonObject : listOfLatLonFromBranch) {
double branchLat = latlonObject.getLatitude();
double branchLon = latlonObject.getLongitude();
GeoPoint geoPointConversion = new GeoPoint(branchLat, branchLon);
geoPointConversions.add(geoPointConversion);
}
plotLine.setWidth(getLineWidth(mapView.getZoomLevel()));
plotLine.setPoints(geoPointConversions);
plotLine.setColor(color);
tubeLineOverlays.add(plotLine);
updateOverlays();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment