Skip to content

Commit a3f2dc8

Browse files
authored
Resole an Issue with Setting Language (#316)
1 parent d0616c8 commit a3f2dc8

7 files changed

Lines changed: 37 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 0.2.1
2+
* Fix issue with setting the language in Android
3+
14
## 0.2.0
25
* Update MapBox Android Version
36
* Resolve issue where Navigation Does Not Dismiss Activity on Cancel

android/src/main/kotlin/com/eopeter/fluttermapboxnavigation/TurnByTurn.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ open class TurnByTurn(
127127
.coordinatesList(this.addedWaypoints.coordinatesList())
128128
.waypointIndicesList(this.addedWaypoints.waypointsIndices())
129129
.waypointNamesList(this.addedWaypoints.waypointsNames())
130+
.language(navigationLanguage)
130131
.alternatives(true)
132+
.steps(true)
131133
.build(),
132134
callback = object : NavigationRouterCallback {
133135
override fun onRoutesReady(

android/src/main/kotlin/com/eopeter/fluttermapboxnavigation/activity/NavigationActivity.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ class NavigationActivity : AppCompatActivity() {
198198
.waypointNamesList(waypointSet.waypointsNames())
199199
.language(FlutterMapboxNavigationPlugin.navigationLanguage)
200200
.alternatives(FlutterMapboxNavigationPlugin.showAlternateRoutes)
201+
.steps(true)
201202
.build(),
202203
callback = object : NavigationRouterCallback {
203204
override fun onCanceled(routeOptions: RouteOptions, routerOrigin: RouterOrigin) {

example/lib/app.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ class _SampleNavigationAppState extends State<SampleNavigationApp> {
8181

8282
_navigationOption = MapBoxNavigation.instance.getDefaultOptions();
8383
_navigationOption.simulateRoute = true;
84+
_navigationOption.language = "pt-BR";
8485
//_navigationOption.initialLatitude = 36.1175275;
8586
//_navigationOption.initialLongitude = -115.1839524;
8687
MapBoxNavigation.instance.registerRouteEventListener(_onEmbeddedRouteEvent);

ios/flutter_mapbox_navigation.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
Pod::Spec.new do |s|
66
s.name = 'flutter_mapbox_navigation'
7-
s.version = '0.2.0'
7+
s.version = '0.2.1'
88
s.summary = 'Add Turn By Turn Navigation to Your Flutter Application Using MapBox. Never leave your app when you need to navigate your users to a location.'
99
s.description = <<-DESC
1010
Add Turn By Turn Navigation to Your Flutter Application Using MapBox. Never leave your app when you need to navigate your users to a location.

lib/src/models/options.dart

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ import 'package:flutter_mapbox_navigation/src/models/voice_units.dart';
1010
/// 'do not change this configuration option'.
1111
///
1212
class MapBoxOptions {
13-
MapBoxOptions.from(MapBoxOptions option) {
14-
simulateRoute = option.simulateRoute;
15-
}
1613

1714
MapBoxOptions({
1815
this.initialLatitude,
@@ -39,13 +36,40 @@ class MapBoxOptions {
3936
this.showEndOfRouteFeedback = true,
4037
});
4138

39+
MapBoxOptions.from(MapBoxOptions option) {
40+
initialLatitude = option.initialLatitude;
41+
initialLongitude = option.initialLongitude;
42+
language = option.language;
43+
zoom = option.zoom;
44+
bearing = option.bearing;
45+
tilt = option.tilt;
46+
alternatives = option.alternatives;
47+
mode = option.mode;
48+
units = option.units;
49+
allowsUTurnAtWayPoints = option.allowsUTurnAtWayPoints;
50+
enableRefresh = option.enableRefresh;
51+
voiceInstructionsEnabled = option.voiceInstructionsEnabled;
52+
bannerInstructionsEnabled = option.bannerInstructionsEnabled;
53+
longPressDestinationEnabled = option.longPressDestinationEnabled;
54+
simulateRoute = option.simulateRoute;
55+
isOptimized = option.isOptimized;
56+
mapStyleUrlDay = option.mapStyleUrlDay;
57+
mapStyleUrlNight = option.mapStyleUrlNight;
58+
padding = option.padding;
59+
animateBuildRoute = option.animateBuildRoute;
60+
showReportFeedbackButton = option.showReportFeedbackButton;
61+
showEndOfRouteFeedback = option.showEndOfRouteFeedback;
62+
}
63+
4264
/// The initial Latitude of the Map View
4365
double? initialLatitude;
4466

4567
/// The initial Longitude of the Map View
4668
double? initialLongitude;
4769

48-
/// 2-letter ISO 639-1 code for language. This property affects the sentence
70+
/// 2-letter ISO 639-1 code for language and optionally append the ISO-3166
71+
/// country code for specific dialect like pt-BR for Brazilian Portuguese
72+
/// This property affects the sentence
4973
/// contained within the RouteStep.instructions property, but it does not
5074
/// affect any road names contained in that property or other properties
5175
/// such as RouteStep.name. Defaults to 'en' if an unsupported language

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flutter_mapbox_navigation
22
description: >
33
Add Turn By Turn Navigation to Your Flutter Application Using MapBox.
44
Never leave your app when you need to navigate your users to a location.
5-
version: 0.2.0
5+
version: 0.2.1
66
homepage: "https://www.eopeter.com"
77
repository: "https://github.com/eopeter/flutter_mapbox_navigation"
88

0 commit comments

Comments
 (0)