Fix route intermediate points in GPX
This commit is contained in:
parent
30c8af48ff
commit
3d5703e421
1 changed files with 15 additions and 2 deletions
|
@ -40,6 +40,7 @@ import net.osmand.router.RouteSegmentResult;
|
||||||
import net.osmand.router.RoutingConfiguration;
|
import net.osmand.router.RoutingConfiguration;
|
||||||
import net.osmand.router.RoutingContext;
|
import net.osmand.router.RoutingContext;
|
||||||
import net.osmand.router.TurnType;
|
import net.osmand.router.TurnType;
|
||||||
|
import net.osmand.util.Algorithms;
|
||||||
import net.osmand.util.MapUtils;
|
import net.osmand.util.MapUtils;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
|
@ -732,8 +733,20 @@ public class RouteProvider {
|
||||||
pt.lon = ps.get(k).getLongitude();
|
pt.lon = ps.get(k).getLongitude();
|
||||||
if(k < psNames.size()) {
|
if(k < psNames.size()) {
|
||||||
pt.name = psNames.get(k) +"";
|
pt.name = psNames.get(k) +"";
|
||||||
pt.name = k == ps.size() - 1? ctx.getString(R.string.destination_point, pt.name ) :
|
if(k == ps.size() - 1) {
|
||||||
ctx.getString(R.string.target_point, pt.name );
|
String target = ctx.getString(R.string.destination_point, "" );
|
||||||
|
if(pt.name.startsWith(target)) {
|
||||||
|
pt.name = ctx.getString(R.string.destination_point, pt.name );
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
String prefix = (k + 1) +". ";
|
||||||
|
if(Algorithms.isEmpty(pt.name)) {
|
||||||
|
pt.name = ctx.getString(R.string.target_point, pt.name );
|
||||||
|
}
|
||||||
|
if(pt.name.startsWith(prefix)) {
|
||||||
|
pt.name = prefix + pt.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
pt.desc = pt.name;
|
pt.desc = pt.name;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue