Fix transport stops

This commit is contained in:
Victor Shcherb 2016-08-02 11:23:08 +02:00
parent a9b04a4466
commit 531d49d360
2 changed files with 17 additions and 14 deletions

View file

@ -159,7 +159,7 @@ public class TransportStopController extends MenuController {
for (TransportIndexRepository t : reps) {
if (t.acceptTransportStop(transportStop)) {
boolean empty = transportStop.getReferencesToRoutes() != null && transportStop.getReferencesToRoutes().length > 0;
boolean empty = transportStop.getReferencesToRoutes() == null || transportStop.getReferencesToRoutes().length == 0;
if(!empty) {
addRoutes(useEnglishNames, t, transportStop, transportStop, 0);
}

View file

@ -202,21 +202,24 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa
if(route != null) {
objects = route.getForwardStops();
}
for (TransportStop o : objects) {
float x = tb.getPixXFromLatLon(o.getLocation().getLatitude(), o.getLocation().getLongitude());
float y = tb.getPixYFromLatLon(o.getLocation().getLatitude(), o.getLocation().getLongitude());
if (objects != null) {
for (TransportStop o : objects) {
float x = tb.getPixXFromLatLon(o.getLocation().getLatitude(), o.getLocation().getLongitude());
float y = tb.getPixYFromLatLon(o.getLocation().getLatitude(), o.getLocation().getLongitude());
if (intersects(boundIntersections, x, y, iconSize, iconSize)) {
canvas.drawBitmap(stopSmall, x - stopSmall.getWidth() / 2, y - stopSmall.getHeight() / 2, paintIcon);
} else {
fullObjects.add(o);
if (intersects(boundIntersections, x, y, iconSize, iconSize)) {
canvas.drawBitmap(stopSmall, x - stopSmall.getWidth() / 2, y - stopSmall.getHeight() / 2,
paintIcon);
} else {
fullObjects.add(o);
}
}
for (TransportStop o : fullObjects) {
float x = tb.getPixXFromLatLon(o.getLocation().getLatitude(), o.getLocation().getLongitude());
float y = tb.getPixYFromLatLon(o.getLocation().getLatitude(), o.getLocation().getLongitude());
Bitmap b = stopBus;
canvas.drawBitmap(b, x - b.getWidth() / 2, y - b.getHeight() / 2, paintIcon);
}
}
for (TransportStop o : fullObjects) {
float x = tb.getPixXFromLatLon(o.getLocation().getLatitude(), o.getLocation().getLongitude());
float y = tb.getPixYFromLatLon(o.getLocation().getLatitude(), o.getLocation().getLongitude());
Bitmap b = stopBus;
canvas.drawBitmap(b, x - b.getWidth() / 2, y - b.getHeight() / 2, paintIcon);
}
}