Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation SDK for Android #346

Merged
merged 4 commits into from
Feb 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mapbox/libandroid-services/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies {

// Android Support libraries
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:support-compat:25.1.0'

// LOST
compile 'com.mapzen.android:lost:2.1.2'
Expand Down
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;

}
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);
}
Loading