Skip to content

Commit

Permalink
add telem absolute distance to destination track support
Browse files Browse the repository at this point in the history
  • Loading branch information
Guardiola31337 committed Oct 26, 2017
1 parent 2dfe04b commit d11429b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -803,4 +803,13 @@ private Object addSdkVersion() {
public void addLocationEngineName(@NonNull String locationEngineName, Hashtable<String, Object> eventWithAttributes) {
eventWithAttributes.put(MapboxNavigationEvent.KEY_LOCATION_ENGINE, locationEngineName);
}

// For internal use only
// This is an experimental API. Experimental APIs are quickly evolving and
// might change or be removed in minor versions.
@Experimental
public void addAbsoluteDistanceToDestination(int absoluteDistanceToDestination,
Hashtable<String, Object> eventWithAttributes) {
eventWithAttributes.put(MapboxNavigationEvent.KEY_ABSOLUTE_DISTANCE_TO_DESTINATION, absoluteDistanceToDestination);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ private void sendEventsWrapped(Vector<Hashtable<String, Object>> events, Callbac
jsonObject.putOpt(MapboxNavigationEvent.KEY_STEP, evt.get(MapboxNavigationEvent.KEY_STEP));
jsonObject.putOpt(MapboxNavigationEvent.KEY_STEP_COUNT, evt.get(MapboxNavigationEvent.KEY_STEP_COUNT));
jsonObject.putOpt(MapboxNavigationEvent.KEY_LOCATION_ENGINE, evt.get(MapboxNavigationEvent.KEY_LOCATION_ENGINE));
jsonObject.putOpt(MapboxNavigationEvent.KEY_ABSOLUTE_DISTANCE_TO_DESTINATION,
evt.get(MapboxNavigationEvent.KEY_ABSOLUTE_DISTANCE_TO_DESTINATION));

// Step metadata
jsonObject.putOpt(MapboxNavigationEvent.KEY_UPCOMING_INSTRUCTION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public class MapboxNavigationEvent {
public static final String KEY_STEP = "step";
public static final String KEY_STEP_COUNT = "stepCount";
public static final String KEY_LOCATION_ENGINE = "locationEngine";
public static final String KEY_ABSOLUTE_DISTANCE_TO_DESTINATION = "absoluteDistanceToDestination";

// Step metadata
public static final String KEY_UPCOMING_INSTRUCTION = "upcomingInstruction";
Expand Down

0 comments on commit d11429b

Please sign in to comment.