Merge pull request #7211 from osmandapp/transportStopImprovements
Fix local transport stop
This commit is contained in:
commit
1ed55dc741
1 changed files with 20 additions and 5 deletions
|
@ -123,12 +123,14 @@ public class TransportStopController extends MenuController {
|
|||
private void processTransportStop(List<TransportStopRoute> routesOnTheSameExit, List<TransportStopRoute> routesNearby) {
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
List<TransportIndexRepository> reps = mapActivity.getMyApplication()
|
||||
.getResourceManager().searchTransportRepositories(transportStop.getLocation().getLatitude(),
|
||||
transportStop.getLocation().getLongitude());
|
||||
|
||||
boolean useEnglishNames = mapActivity.getMyApplication().getSettings().usingEnglishNames();
|
||||
OsmandApplication app = mapActivity.getMyApplication();
|
||||
List<TransportIndexRepository> reps = app.getResourceManager().searchTransportRepositories(transportStop.getLocation().getLatitude(),
|
||||
transportStop.getLocation().getLongitude());
|
||||
|
||||
boolean useEnglishNames = app.getSettings().usingEnglishNames();
|
||||
if (transportStop.getTransportStopAggregated() == null) {
|
||||
processTransportStopAggregated(app, transportStop);
|
||||
}
|
||||
for (TransportIndexRepository t : reps) {
|
||||
if (t.acceptTransportStop(transportStop)) {
|
||||
ArrayList<TransportStop> transportStopsSameExit = new ArrayList<TransportStop>(transportStop.getLocalTransportStops());
|
||||
|
@ -273,6 +275,19 @@ public class TransportStopController extends MenuController {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static void processTransportStopAggregated(OsmandApplication app, TransportStop transportStop) {
|
||||
TransportStopAggregated stopAggregated = new TransportStopAggregated();
|
||||
transportStop.setTransportStopAggregated(stopAggregated);
|
||||
stopAggregated.addLocalTransportStop(transportStop);
|
||||
|
||||
LatLon loc = transportStop.getLocation();
|
||||
List<TransportStop> transportStops = findTransportStopsAt(app, loc.getLatitude(), loc.getLongitude(), SHOW_STOPS_RADIUS_METERS);
|
||||
|
||||
for (TransportStop stop : transportStops) {
|
||||
stopAggregated.addNearbyTransportStop(stop);
|
||||
}
|
||||
}
|
||||
|
||||
public static TransportStopAggregated processTransportStopsForAmenity(List<TransportStop> transportStops, Amenity amenity) {
|
||||
TransportStopAggregated stopAggregated = new TransportStopAggregated();
|
||||
stopAggregated.setAmenity(amenity);
|
||||
|
|
Loading…
Reference in a new issue