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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,19 @@ Mapbox welcomes participation and contributions from everyone.

### main

- Added `StepIntersection#formOfWay` property which provides a list representing the "form of way" values for all roads at the step intersection. [#1611](https://github.com/mapbox/mapbox-java/pull/1611)
- Added `StepIntersection#geometries` property which provides a list representing the geometry of each road at the step intersection. [#1611](https://github.com/mapbox/mapbox-java/pull/1611)
- Added `StepIntersection#access` property which provides a list representing the access type for each road at the step intersection. [#1611](https://github.com/mapbox/mapbox-java/pull/1611)
- Added `StepIntersection#elevated` property which provides a list indicating whether each road at the step intersection is elevated. [#1611](https://github.com/mapbox/mapbox-java/pull/1611)
- Added `StepIntersection#bridge` property which provides a list indicating whether each road at the step intersection is a bridge. [#1611](https://github.com/mapbox/mapbox-java/pull/1611)
- Added a new voice unit value: `DirectionsCriteria#BRITISH_IMPERIAL`. This value is now included in `DirectionsCriteria#VoiceUnitCriteria`. [#1611](https://github.com/mapbox/mapbox-java/pull/1611)


### v7.5.0 - July 31, 2025

- Updated `auto-value-gson` to version [0.0.3](https://github.com/mapbox/auto-value-gson/releases/tag/mapbox-v0.0.3) and `gson` to version 2.13.1. [#1615](https://github.com/mapbox/mapbox-java/pull/1615)


### v7.4.0 - April 11, 2025

- Added `IntersectionLanes#access` property which provides lane access attributes, such as allowed vehicle types for designated lanes. [#1608](https://github.com/mapbox/mapbox-java/pull/1608)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,13 @@ public final class DirectionsCriteria {
*/
public static final String METRIC = "metric";

/**
* Change the units to british imperial for voice and visual information.
* Note that this won't change other results such as raw distance measurements which will
* always be returned in meters.
*/
public static final String BRITISH_IMPERIAL = "british_imperial";

/**
* Returned route starts at the first provided coordinate in the list. Used specifically for the
* Optimization API.
Expand Down Expand Up @@ -594,7 +601,8 @@ private DirectionsCriteria() {
@Retention(RetentionPolicy.CLASS)
@StringDef( {
IMPERIAL,
METRIC
METRIC,
BRITISH_IMPERIAL
})
public @interface VoiceUnitCriteria {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,8 @@ public List<String> includeList() {

/**
* A type of units to return in the text for voice instructions.
* Can be {@link DirectionsCriteria#IMPERIAL} (default) or {@link DirectionsCriteria#METRIC}.
* Can be {@link DirectionsCriteria#IMPERIAL} (default), {@link DirectionsCriteria#METRIC},
* or {@link DirectionsCriteria#BRITISH_IMPERIAL}.
* Must be used in conjunction with {@link RouteOptions#steps()}=true and
* {@link RouteOptions#steps()}=true
* and {@link RouteOptions#voiceInstructions()}=true.
Expand Down Expand Up @@ -946,6 +947,76 @@ public List<String> paymentMethodsList() {
@Nullable
public abstract Boolean suppressVoiceInstructionLocalNames();

/**
* Defines whether to return "form of way" values for roads at each {@link StepIntersection}.
* See {@link StepIntersection#formOfWay()} for details.
* Requires {@link RouteOptions#steps()} to be set to true.
*
* @return boolean representing the `intersectionLinkFormOfWay` value
*/
@SerializedName("intersection_link_form_of_way")
@Nullable
public abstract Boolean intersectionLinkFormOfWay();

/**
* A comma-separated list of road classes for which intersection geometry data should be included
* at each {@link StepIntersection}. See {@link StepIntersection#geometries()} for details.
* Possible values include:
* - "motorway"
* - "trunk"
* - "primary"
* - "secondary"
* - "tertiary"
* - "unclassified"
* - "residential"
* - "service_other"
* Geometry data will be provided for each intersection along the requested route.
* The geometry format is affected by {@link RouteOptions#geometries}.
* Requires {@link RouteOptions#steps()} to be set to true.
* Be aware that enabling this option can significantly increase the response size
* and the memory required to store the response object. Use this option selectively, for example,
* if geometry is only needed for motorways, specify only "motorway".
*
* @return a comma-separated list of road classes for which intersection geometry data
* should be included
*/
@SerializedName("intersection_link_geometry")
@Nullable
public abstract String intersectionLinkGeometry();

/**
* Defines whether to return "access" values for roads at each {@link StepIntersection}.
* See {@link StepIntersection#access()} for details.
* Requires {@link RouteOptions#steps()} to be set to true.
*
* @return boolean representing the `intersectionLinkAccess` value
*/
@SerializedName("intersection_link_access")
@Nullable
public abstract Boolean intersectionLinkAccess();

/**
* Defines whether to return "elevated" status for roads at each {@link StepIntersection}.
* See {@link StepIntersection#elevated()} for details.
* Requires {@link RouteOptions#steps()} to be set to true.
*
* @return boolean representing the `intersectionLinkElevated` value
*/
@SerializedName("intersection_link_elevated")
@Nullable
public abstract Boolean intersectionLinkElevated();

/**
* Defines whether to return "bridge" status for roads at each {@link StepIntersection}.
* See {@link StepIntersection#bridges()} for details.
* Requires {@link RouteOptions#steps()} to be set to true.
*
* @return boolean representing the `intersectionLinkBridge` value
*/
@SerializedName("intersection_link_bridge")
@Nullable
public abstract Boolean intersectionLinkBridge();

/**
* Gson type adapter for parsing Gson to this class.
*
Expand Down Expand Up @@ -1088,6 +1159,11 @@ public URL toUrl(@NonNull String accessToken) {
"suppress_voice_instruction_local_names",
suppressVoiceInstructionLocalNames()
);
appendQueryParameter(sb, "intersection_link_form_of_way", intersectionLinkFormOfWay());
appendQueryParameter(sb, "intersection_link_geometry", intersectionLinkGeometry());
appendQueryParameter(sb, "intersection_link_access", intersectionLinkAccess());
appendQueryParameter(sb, "intersection_link_elevated", intersectionLinkElevated());
appendQueryParameter(sb, "intersection_link_bridge", intersectionLinkBridge());

Map<String, SerializableJsonElement> unrecognized = unrecognized();
if (unrecognized != null) {
Expand Down Expand Up @@ -1553,7 +1629,8 @@ public Builder annotationsList(@Nullable List<String> annotations) {

/**
* A type of units to return in the text for voice instructions.
* Can be {@link DirectionsCriteria#IMPERIAL} (default) or {@link DirectionsCriteria#METRIC}.
* Can be {@link DirectionsCriteria#IMPERIAL} (default), {@link DirectionsCriteria#METRIC},
* or {@link DirectionsCriteria#BRITISH_IMPERIAL}.
* Must be used in conjunction with {@link RouteOptions#steps()}=true and
* {@link RouteOptions#steps()}=true
* and {@link RouteOptions#voiceInstructions()}=true.
Expand Down Expand Up @@ -2127,6 +2204,113 @@ public abstract Builder suppressVoiceInstructionLocalNames(
@Nullable Boolean suppressVoiceInstructionLocalNames
);

/**
* Defines whether to return "form of way" values for roads at each {@link StepIntersection}.
* See {@link StepIntersection#formOfWay()} for details.
* Requires {@link RouteOptions#steps()} to be set to true.
*
* @param intersectionLinkFormOfWay whether to return "form of way" values
* @return this builder
*/
@NonNull
public abstract Builder intersectionLinkFormOfWay(
@Nullable Boolean intersectionLinkFormOfWay
);

/**
* A comma-separated list of road types for which intersection geometry data should be included
* at each {@link StepIntersection}. See {@link StepIntersection#geometries()} for details.
* Requires {@link RouteOptions#steps()} to be set to true.
* Possible values include:
* - "motorway"
* - "trunk"
* - "primary"
* - "secondary"
* - "tertiary"
* - "unclassified"
* - "residential"
* - "service_other"
* Geometry data will be provided for each intersection along the requested route.
* Be aware that enabling this option can significantly increase the response size
* and the memory required to store the response object. Use this option selectively,
* for example, if geometry is only needed for motorways, specify only "motorway".
*
* @param intersectionLinkGeometry a comma-separated list of road types for which intersection
* geometry data should be included
* @return this builder
*/
@NonNull
public abstract Builder intersectionLinkGeometry(
@Nullable String intersectionLinkGeometry
);

/**
* A comma-separated list of road types for which intersection geometry data should be included
* at each {@link StepIntersection}. See {@link StepIntersection#geometries()} for details.
* Requires {@link RouteOptions#steps()} to be set to true.
* Possible values include:
* - "motorway"
* - "trunk"
* - "primary"
* - "secondary"
* - "tertiary"
* - "unclassified"
* - "residential"
* - "service_other"
* Geometry data will be provided for each intersection along the requested route.
* Be aware that enabling this option can significantly increase the response size
* and the memory required to store the response object. Use this option selectively,
* for example, if geometry is only needed for motorways, specify only "motorway".
*
* @param intersectionLinkGeometry a list of road types for which intersection
* geometry data should be included
* @return this builder
*/
@NonNull
public Builder intersectionLinkGeometry(@Nullable List<String> intersectionLinkGeometry) {
String result = FormatUtils.join(",", intersectionLinkGeometry);
return intersectionLinkGeometry(result);
}

/**
* Defines whether to return "access" values for roads at each {@link StepIntersection}.
* See {@link StepIntersection#access()} for details.
* Requires {@link RouteOptions#steps()} to be set to true.
*
* @param intersectionLinkAccess whether to return "access" values
* @return this builder
*/
@NonNull
public abstract Builder intersectionLinkAccess(
@Nullable Boolean intersectionLinkAccess
);

/**
* Defines whether to return "elevated" status for roads at each {@link StepIntersection}.
* See {@link StepIntersection#elevated()} for details.
* Requires {@link RouteOptions#steps()} to be set to true.
*
* @param intersectionLinkElevated whether to return "elevated" status
* @return this builder
*/
@NonNull
public abstract Builder intersectionLinkElevated(
@Nullable Boolean intersectionLinkElevated
);

/**
* Defines whether to return "bridge" status for roads at each {@link StepIntersection}.
* See {@link StepIntersection#bridges()} for details.
* Requires {@link RouteOptions#steps()} to be set to true.
*
* @param intersectionLinkBridge whether to return "bridge" status
* @return this builder
*/
@NonNull
public abstract Builder intersectionLinkBridge(
@Nullable Boolean intersectionLinkBridge
);

/**
* Use this method to add request parameters,
* which are not present in the model yet but are supported on the Directions API,
Expand Down
Loading