Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-01-12 08:58:57 +01:00
commit 5c63456b23
2 changed files with 8 additions and 22 deletions

View file

@ -42,6 +42,7 @@ public class PointDescription {
public static final String POINT_TYPE_WORLD_REGION = "world_region";
public static final String POINT_TYPE_GPX_ITEM = "gpx_item";
public static final String POINT_TYPE_WORLD_REGION_SHOW_ON_MAP = "world_region_show_on_map";
public static final String POINT_TYPE_BLOCKED_ROAD = "blocked_road";
public static final PointDescription LOCATION_POINT = new PointDescription(POINT_TYPE_LOCATION, "");

View file

@ -13,10 +13,6 @@ import net.osmand.data.PointDescription;
import net.osmand.data.RotatedTileBox;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.osmedit.OpenstreetmapPoint;
import net.osmand.plus.osmedit.OsmEditingPlugin;
import net.osmand.plus.osmedit.OsmNotesPoint;
import net.osmand.plus.osmedit.OsmPoint;
import java.util.List;
import java.util.Map;
@ -129,35 +125,24 @@ public class ImpassableRoadsLayer extends OsmandMapLayer implements ContextMenuL
@Override
public LatLon getObjectLocation(Object o) {
if (o instanceof OsmPoint) {
return new LatLon(((OsmPoint)o).getLatitude(),((OsmPoint)o).getLongitude());
if(o instanceof RouteDataObject) {
RouteDataObject route = (RouteDataObject) o;
Location location = missingRoadLocations.get(route.getId());
return new LatLon(location.getLatitude(), location.getLongitude());
}
return null;
}
@Override
public String getObjectDescription(Object o) {
if(o instanceof OsmPoint) {
OsmPoint point = (OsmPoint) o;
return OsmEditingPlugin.getEditName(point);
}
return null;
}
@Override
public PointDescription getObjectName(Object o) {
if(o instanceof OsmPoint) {
OsmPoint point = (OsmPoint) o;
String name = "";
String type = "";
if (point.getGroup() == OsmPoint.Group.POI){
name = ((OpenstreetmapPoint) point).getName();
type = PointDescription.POINT_TYPE_OSM_NOTE;
} else if (point.getGroup() == OsmPoint.Group.BUG) {
name = ((OsmNotesPoint) point).getText();
type = PointDescription.POINT_TYPE_OSM_BUG;
}
return new PointDescription(type, name);
if(o instanceof RouteDataObject) {
RouteDataObject route = (RouteDataObject) o;
return new PointDescription(PointDescription.POINT_TYPE_BLOCKED_ROAD, route.getName());
}
return null;
}