|
1 | 1 | package com.mapbox.services.api.mapmatching.v5; |
2 | 2 |
|
3 | | -import com.google.gson.Gson; |
4 | 3 | import com.mapbox.services.api.MapboxBuilder; |
5 | 4 | import com.mapbox.services.api.MapboxService; |
6 | 5 | import com.mapbox.services.api.ServicesException; |
@@ -35,7 +34,6 @@ public class MapboxMapMatching extends MapboxService<MapMatchingResponse> { |
35 | 34 | protected Builder builder = null; |
36 | 35 | private MapMatchingService service = null; |
37 | 36 | private Call<MapMatchingResponse> call = null; |
38 | | - private Gson gson; |
39 | 37 |
|
40 | 38 | protected MapboxMapMatching(Builder builder) { |
41 | 39 | this.builder = builder; |
@@ -85,7 +83,8 @@ public Call<MapMatchingResponse> getCall() { |
85 | 83 | builder.getSteps(), |
86 | 84 | builder.getOverview(), |
87 | 85 | builder.getTimestamps(), |
88 | | - builder.getAnnotations() |
| 86 | + builder.getAnnotations(), |
| 87 | + builder.getLanguage() |
89 | 88 | ); |
90 | 89 |
|
91 | 90 | return call; |
@@ -152,6 +151,7 @@ public static class Builder<T extends Builder> extends MapboxBuilder { |
152 | 151 | private String overview = null; |
153 | 152 | private String[] timestamps = null; |
154 | 153 | private String annotations = null; |
| 154 | + private String language; |
155 | 155 |
|
156 | 156 | /** |
157 | 157 | * Constructor |
@@ -378,6 +378,27 @@ public T setBaseUrl(String baseUrl) { |
378 | 378 | return (T) this; |
379 | 379 | } |
380 | 380 |
|
| 381 | + /** |
| 382 | + * Optionally set the language of returned turn-by-turn text instructions. The default is {@code en} for English. |
| 383 | + * |
| 384 | + * @param language The locale in which results should be returned. |
| 385 | + * @return Builder |
| 386 | + * @see <a href="https://www.mapbox.com/api-documentation/#instructions-languages">Supported languages</a> |
| 387 | + * @since 2.2.0 |
| 388 | + */ |
| 389 | + public T setLanguage(String language) { |
| 390 | + this.language = language; |
| 391 | + return (T) this; |
| 392 | + } |
| 393 | + |
| 394 | + /** |
| 395 | + * @return The language the turn-by-turn directions will be in. |
| 396 | + * @since 2.2.0 |
| 397 | + */ |
| 398 | + public String getLanguage() { |
| 399 | + return language; |
| 400 | + } |
| 401 | + |
381 | 402 | /** |
382 | 403 | * Builder method |
383 | 404 | * |
|
0 commit comments