-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bring over updated RouteUtils version from @cammace * bring over updated navigation logic authored by @cammace * change Constants.OSRM_PRECISION_V5 to Constants.PRECISION_6 in tests * move offroute point outside threshold range in test
- Loading branch information
Showing
15 changed files
with
1,357 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
mapbox/libandroid-services/src/main/java/com/mapbox/services/android/Constants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,82 @@ | ||
package com.mapbox.services.android; | ||
|
||
import com.mapbox.services.Experimental; | ||
|
||
/** | ||
* Namespace to avoid constants collision. | ||
* | ||
* This is partly an experimental API. Experimental APIs are quickly evolving and | ||
* might change or be removed in minor versions. | ||
*/ | ||
public class Constants { | ||
|
||
private static final String PACKAGE_NAME = "com.mapbox.services.android"; | ||
|
||
/* | ||
* Direction constants | ||
*/ | ||
|
||
@Experimental public static final String STEP_MANEUVER_TYPE_TURN = "turn"; | ||
@Experimental public static final String STEP_MANEUVER_TYPE_NEW_NAME = "new name"; | ||
@Experimental public static final String STEP_MANEUVER_TYPE_DEPART = "depart"; | ||
@Experimental public static final String STEP_MANEUVER_TYPE_ARRIVE = "arrive"; | ||
@Experimental public static final String STEP_MANEUVER_TYPE_MERGE = "merge"; | ||
@Experimental public static final String STEP_MANEUVER_TYPE_ON_RAMP = "on ramp"; | ||
@Experimental public static final String STEP_MANEUVER_TYPE_OFF_RAMP = "off ramp"; | ||
@Experimental public static final String STEP_MANEUVER_TYPE_FORK = "fork"; | ||
@Experimental public static final String STEP_MANEUVER_TYPE_END_OF_ROAD = "end of road"; | ||
@Experimental public static final String STEP_MANEUVER_TYPE_USE_LANE = "use lane"; | ||
@Experimental public static final String STEP_MANEUVER_TYPE_CONTINUE = "continue"; | ||
@Experimental public static final String STEP_MANEUVER_TYPE_ROUNDABOUT = "roundabout"; | ||
@Experimental public static final String STEP_MANEUVER_TYPE_ROTARY = "rotary"; | ||
@Experimental public static final String STEP_MANEUVER_TYPE_ROUNDABOUT_TURN = "roundabout turn"; | ||
@Experimental public static final String STEP_MANEUVER_TYPE_NOTIFICATION = "notification"; | ||
|
||
/* | ||
* Navigation constants | ||
*/ | ||
|
||
@Experimental public static final int NONE_ALERT_LEVEL = 0; | ||
@Experimental public static final int DEPART_ALERT_LEVEL = 1; | ||
@Experimental public static final int LOW_ALERT_LEVEL = 2; | ||
@Experimental public static final int MEDIUM_ALERT_LEVEL = 3; | ||
@Experimental public static final int HIGH_ALERT_LEVEL = 4; | ||
@Experimental public static final int ARRIVE_ALERT_LEVEL = 5; | ||
@Experimental public static final int METERS_TO_INTERSECTION = 50; | ||
@Experimental public static final int DEFAULT_ANGLE_TOLERANCE = 45; | ||
|
||
/** | ||
* Threshold user must be in within to count as completing a step. One of two heuristics used to know when a user | ||
* completes a step, see `RouteControllerManeuverZoneRadius`. The users `heading` and the `finalHeading` are | ||
* compared. If this number is within `RouteControllerMaximumAllowedDegreeOffsetForTurnCompletion`, the user has | ||
* completed the step. | ||
*/ | ||
@Experimental public static final int MAXIMUM_ALLOWED_DEGREE_OFFSET_FOR_TURN_COMPLETION = 30; | ||
|
||
/** | ||
* Radius in meters the user must enter to count as completing a step. One of two heuristics used to know when a user | ||
* completes a step, see `RouteControllerMaximumAllowedDegreeOffsetForTurnCompletion`. | ||
*/ | ||
@Experimental public static final int MANEUVER_ZONE_RADIUS = 40; | ||
|
||
/** | ||
* Number of seconds left on step when a `medium` alert is emitted. | ||
*/ | ||
@Experimental public static final int MEDIUM_ALERT_INTERVAL = 70; | ||
|
||
/** | ||
* Number of seconds left on step when a `high` alert is emitted. | ||
*/ | ||
@Experimental public static final int HIGH_ALERT_INTERVAL = 15; | ||
|
||
/** | ||
* Distance in meters for the minimum length of a step for giving a `high` alert. | ||
*/ | ||
@Experimental public static final int MINIMUM_DISTANCE_FOR_HIGH_ALERT = 100; | ||
|
||
/** | ||
* Distance in meters for the minimum length of a step for giving a `medium` alert. | ||
*/ | ||
@Experimental public static final int MINIMUM_DISTANCE_FOR_MEDIUM_ALERT = 400; | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
...ces/src/main/java/com/mapbox/services/android/navigation/v5/AlertLevelChangeListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.mapbox.services.android.navigation.v5; | ||
|
||
import com.mapbox.services.Experimental; | ||
import com.mapbox.services.api.navigation.v5.RouteProgress; | ||
|
||
/** | ||
* This is an experimental API. Experimental APIs are quickly evolving and | ||
* might change or be removed in minor versions. | ||
*/ | ||
@Experimental | ||
public interface AlertLevelChangeListener { | ||
void onAlertLevelChange(int alertLevel, RouteProgress routeProgress); | ||
} |
Oops, something went wrong.