forked from organicmaps/organicmaps
[android] Pass current street name to routing info.
This commit is contained in:
parent
9e41822d0f
commit
f15e332dec
4 changed files with 14 additions and 8 deletions
|
@ -1375,7 +1375,7 @@ extern "C"
|
|||
env->GetMethodID(klass, "<init>",
|
||||
"(Ljava/lang/String;Ljava/lang/String;"
|
||||
"Ljava/lang/String;Ljava/lang/String;"
|
||||
"Ljava/lang/String;IIDDII"
|
||||
"Ljava/lang/String;Ljava/lang/String;IIDDII"
|
||||
"[Lcom/mapswithme/maps/routing/SingleLaneInfo;)V");
|
||||
ASSERT(ctorRouteInfoID, (jni::DescribeException()));
|
||||
|
||||
|
@ -1416,9 +1416,9 @@ extern "C"
|
|||
jobject const result = env->NewObject(
|
||||
klass, ctorRouteInfoID, jni::ToJavaString(env, info.m_distToTarget),
|
||||
jni::ToJavaString(env, info.m_targetUnitsSuffix), jni::ToJavaString(env, info.m_distToTurn),
|
||||
jni::ToJavaString(env, info.m_turnUnitsSuffix), jni::ToJavaString(env, info.m_targetName),
|
||||
info.m_turn, info.m_pedestrianTurn, info.m_pedestrianDirectionPos.lat, info.m_pedestrianDirectionPos.lon,
|
||||
info.m_exitNum, info.m_time, jLanes);
|
||||
jni::ToJavaString(env, info.m_turnUnitsSuffix), jni::ToJavaString(env, info.m_sourceName),
|
||||
jni::ToJavaString(env, info.m_targetName), info.m_turn, info.m_pedestrianTurn,
|
||||
info.m_pedestrianDirectionPos.lat, info.m_pedestrianDirectionPos.lon, info.m_exitNum, info.m_time, jLanes);
|
||||
ASSERT(result, (jni::DescribeException()));
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -18,8 +18,10 @@ public class RoutingInfo
|
|||
public final String turnUnits;
|
||||
|
||||
public final int totalTimeInSeconds;
|
||||
// The next street according to the navigation route.
|
||||
public final String streetName;
|
||||
// Current street name.
|
||||
public final String currentStreet;
|
||||
// The next street name.
|
||||
public final String nextStreet;
|
||||
// For vehicle routing.
|
||||
public final VehicleTurnDirection vehicleTurnDirection;
|
||||
public final int exitNum;
|
||||
|
@ -115,7 +117,7 @@ public class RoutingInfo
|
|||
SHARP_RIGHT
|
||||
}
|
||||
|
||||
public RoutingInfo(String distToTarget, String units, String distTurn, String turnSuffix, String targetName,
|
||||
public RoutingInfo(String distToTarget, String units, String distTurn, String turnSuffix, String currentStreet, String nextStreet,
|
||||
int vehicleTurnOrdinal, int pedestrianTurnOrdinal, double pedestrianDirectionLat, double pedestrianDirectionLon, int exitNum,
|
||||
int totalTime, SingleLaneInfo[] lanes)
|
||||
{
|
||||
|
@ -123,7 +125,8 @@ public class RoutingInfo
|
|||
this.targetUnits = units;
|
||||
this.turnUnits = turnSuffix;
|
||||
this.distToTurn = distTurn;
|
||||
this.streetName = targetName;
|
||||
this.currentStreet = currentStreet;
|
||||
this.nextStreet = nextStreet;
|
||||
this.totalTimeInSeconds = totalTime;
|
||||
this.vehicleTurnDirection = VehicleTurnDirection.values()[vehicleTurnOrdinal];
|
||||
this.lanes = lanes;
|
||||
|
|
|
@ -146,6 +146,8 @@ namespace location
|
|||
// If there is something to pronounce the size of m_turnNotifications may be one or even more
|
||||
// depends on the number of notifications to prononce.
|
||||
vector<string> m_turnNotifications;
|
||||
// Current street name.
|
||||
string m_sourceName;
|
||||
// The next street name.
|
||||
string m_targetName;
|
||||
|
||||
|
|
|
@ -193,6 +193,7 @@ void RoutingSession::GetRouteFollowingInfo(FollowingInfo & info) const
|
|||
info.m_turn = turn.m_turn;
|
||||
info.m_exitNum = turn.m_exitNum;
|
||||
info.m_time = m_route.GetCurrentTimeToEndSec();
|
||||
info.m_sourceName = turn.m_sourceName;
|
||||
info.m_targetName = turn.m_targetName;
|
||||
info.m_completionPercent = 100.0 *
|
||||
m_route.GetCurrentDistanceFromBeginMeters() / m_route.GetTotalDistanceMeters();
|
||||
|
|
Loading…
Add table
Reference in a new issue