Added ability to determine the subway logo

This commit is contained in:
PaulStets 2018-03-01 12:28:12 +02:00
parent 2b28c2ac3c
commit 0fc2b0ea53

View file

@ -1,5 +1,7 @@
package net.osmand.plus.mapcontextmenu.controllers;
import android.graphics.drawable.Drawable;
import net.osmand.data.Amenity;
import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
@ -29,6 +31,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
public class AmenityMenuController extends MenuController {
@ -185,6 +188,19 @@ public class AmenityMenuController extends MenuController {
}
}
@Override
public Drawable getRightIcon() {
Map<String, String> addTypes = amenity.getAdditionalInfo();
if (addTypes != null && addTypes.containsKey("subway_region")) {
String region = "subway_" + addTypes.remove("subway_region");
amenity.setAdditionalInfo(addTypes);
if (RenderingIcons.containsBigIcon(region)) {
return RenderingIcons.getBigIcon(getMapActivity(), region);
}
}
return null;
}
private void processTransportStop() {
routes = new ArrayList<>();
List<TransportIndexRepository> reps = getMapActivity().getMyApplication()