Skip to content

Commit 2d0f464

Browse files
Add BRITISH_IMPERIAL voice unit
1 parent 963fa94 commit 2d0f464

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Mapbox welcomes participation and contributions from everyone.
99
- 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)
1010
- 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)
1111
- 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)
12+
- 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)
1213

1314

1415
### v7.5.0 - July 31, 2025

services-directions-models/src/main/java/com/mapbox/api/directions/v5/DirectionsCriteria.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,13 @@ public final class DirectionsCriteria {
239239
*/
240240
public static final String METRIC = "metric";
241241

242+
/**
243+
* Change the units to british imperial for voice and visual information.
244+
* Note that this won't change other results such as raw distance measurements which will
245+
* always be returned in meters.
246+
*/
247+
public static final String BRITISH_IMPERIAL = "british_imperial";
248+
242249
/**
243250
* Returned route starts at the first provided coordinate in the list. Used specifically for the
244251
* Optimization API.
@@ -594,7 +601,8 @@ private DirectionsCriteria() {
594601
@Retention(RetentionPolicy.CLASS)
595602
@StringDef( {
596603
IMPERIAL,
597-
METRIC
604+
METRIC,
605+
BRITISH_IMPERIAL
598606
})
599607
public @interface VoiceUnitCriteria {
600608
}

services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/RouteOptions.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,8 @@ public List<String> includeList() {
506506

507507
/**
508508
* A type of units to return in the text for voice instructions.
509-
* Can be {@link DirectionsCriteria#IMPERIAL} (default) or {@link DirectionsCriteria#METRIC}.
509+
* Can be {@link DirectionsCriteria#IMPERIAL} (default), {@link DirectionsCriteria#METRIC},
510+
* or {@link DirectionsCriteria#BRITISH_IMPERIAL}.
510511
* Must be used in conjunction with {@link RouteOptions#steps()}=true and
511512
* {@link RouteOptions#steps()}=true
512513
* and {@link RouteOptions#voiceInstructions()}=true.
@@ -1628,7 +1629,8 @@ public Builder annotationsList(@Nullable List<String> annotations) {
16281629

16291630
/**
16301631
* A type of units to return in the text for voice instructions.
1631-
* Can be {@link DirectionsCriteria#IMPERIAL} (default) or {@link DirectionsCriteria#METRIC}.
1632+
* Can be {@link DirectionsCriteria#IMPERIAL} (default), {@link DirectionsCriteria#METRIC},
1633+
* or {@link DirectionsCriteria#BRITISH_IMPERIAL}.
16321634
* Must be used in conjunction with {@link RouteOptions#steps()}=true and
16331635
* {@link RouteOptions#steps()}=true
16341636
* and {@link RouteOptions#voiceInstructions()}=true.

0 commit comments

Comments
 (0)