Skip to content

Commit

Permalink
cherry-pick upstream#847 (#99)
Browse files Browse the repository at this point in the history
* cherry-pick upstream#847

https: //github.com/flutter-mapbox-gl/maps/pull/847
Co-Authored-By: metafounder <25162264+metafounder@users.noreply.github.com>
  • Loading branch information
m0nac0 and metafounder authored May 22, 2022
1 parent e927c44 commit a4ad66e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ios/Classes/MapboxMapController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ class MapboxMapController: NSObject, FlutterPlatformView, MGLMapViewDelegate, Ma
guard let bytes = arguments["bytes"] as? FlutterStandardTypedData else { return }
guard let sdf = arguments["sdf"] as? Bool else { return }
guard let data = bytes.data as? Data else { return }
guard let image = UIImage(data: data) else { return }
guard let image = UIImage(data: data, scale: UIScreen.main.scale) else { return }
if sdf {
mapView.style?.setImage(image.withRenderingMode(.alwaysTemplate), forName: name)
} else {
Expand Down
4 changes: 3 additions & 1 deletion maplibre_gl_web/lib/src/mapbox_map_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ class MaplibreMapController extends MapLibreGlPlatform
// ignore: undefined_prefixed_name
ui.platformViewRegistry.registerViewFactory(
'plugins.flutter.io/mapbox_gl_$identifier', (int viewId) {
_mapElement = DivElement();
_mapElement = DivElement()
..style.width = '100%'
..style.height = '100%';
callback(viewId);
return _mapElement;
});
Expand Down

0 comments on commit a4ad66e

Please sign in to comment.