Skip to content

Commit

Permalink
Fixed Map Localization (with commit from Lobankovanastia)
Browse files Browse the repository at this point in the history
  • Loading branch information
IcyTv committed Nov 15, 2020
1 parent 27473bd commit 40d0419
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ final class MapboxMapController
new MethodChannel(registrar.messenger(), "plugins.flutter.io/mapbox_maps_" + id);
methodChannel.setMethodCallHandler(this);
this.registrarActivityHashCode = registrar.activity().hashCode();
localizationPlugin = new LocalizationPlugin(mapView, mapboxMap, style);
}

@Override
Expand Down
7 changes: 4 additions & 3 deletions lib/src/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ class MapboxMapController extends ChangeNotifier {
/// The returned [Future] completes after the change has been made on the
/// platform side.
Future<void> matchMapLanguageWithDeviceDefault() async {
return MapboxGlPlatform.getInstance(_id)
.matchMapLanguageWithDeviceDefault();
await _globalChannel.invokeMethod("map#matchMapLanguageWithDeviceDefault");
}

/// Updates the distance from the edges of the map view’s frame to the edges
Expand All @@ -294,7 +293,9 @@ class MapboxMapController extends ChangeNotifier {
/// The returned [Future] completes after the change has been made on the
/// platform side.
Future<void> setMapLanguage(String language) async {
return MapboxGlPlatform.getInstance(_id).setMapLanguage(language);
await _globalChannel.invokeMethod('map#setMapLanguage', <String, dynamic>{
'language': language,
});
}

/// Enables or disables the collection of anonymized telemetry data.
Expand Down

0 comments on commit 40d0419

Please sign in to comment.