Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ public class DirectionsCriteria {
*/
public static final String OVERVIEW_FALSE = "false";

public static final String WEIGHT_NAME_ROUTABILITY = "routability";

public static final String WEIGHT_NAME_DISTANCE = "distance";
public static final String WEIGHT_NAME_DURATION = "duration";


/**
* The duration, in seconds, between each pair of coordinates.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.mapbox.services.api.directions.v5.models;

import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
Expand All @@ -12,6 +14,9 @@ public class DirectionsRoute {
private double distance;
private double duration;
private String geometry;
private double weight;
@SerializedName("weight_name")
private String weightName;
private List<RouteLeg> legs;

public DirectionsRoute() {
Expand All @@ -38,6 +43,22 @@ public void setDistance(double distance) {
this.distance = distance;
}

public String getWeightName() {
return weightName;
}

public void setWeightName(String weightName) {
this.weightName = weightName;
}

public double getWeight() {
return weight;
}

public void setWeight(double weight) {
this.weight = weight;
}

/**
* The estimated travel time from origin to destination.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class LegStep {
@SerializedName("rotary_pronunciation")
private String rotaryPronunciation;
private StepManeuver maneuver;

private double weight;
private List<StepIntersection> intersections;

public LegStep() {
Expand All @@ -39,6 +41,26 @@ public LegStep(String name, String rotaryName, StepManeuver maneuver) {
this.maneuver = maneuver;
}

/**
* Specifies a decimal precision of edge weights, default value 1.
*
* @return a decimal precision double value.
* @since 2.1.0
*/
public double getWeight() {
return weight;
}

/**
* Specifies a decimal precision of edge weights, default value 1.
*
* @param weight double value representing the edge weight.
* @since 2.1.0
*/
public void setWeight(double weight) {
this.weight = weight;
}

/**
* The distance traveled from the maneuver to the next {@link LegStep}.
*
Expand Down
Loading