File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed
maplibre/lib/src/platform/ios Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ class _ControllerPageState extends State<ControllerPage> {
7878 latitudeSouth: 45.806154 ,
7979 latitudeNorth: 47.902069 ,
8080 ),
81+ padding: const EdgeInsets .all (50 ),
8182 );
8283 debugPrint ('fitBounds end' );
8384 } on PlatformException catch (error) {
Original file line number Diff line number Diff line change @@ -71,6 +71,19 @@ extension LngLatBoundsExt on LngLatBounds {
7171 }
7272}
7373
74+ /// Internal extensions on [EdgeInsets] .
75+ extension EdgeInsetsExt on EdgeInsets {
76+ /// Convert an [EdgeInsets] to a [UIEdgeInsets] .
77+ UIEdgeInsets toUIEdgeInsets () {
78+ final insets = Struct .create <UIEdgeInsets >()
79+ ..top = top
80+ ..left = left
81+ ..bottom = bottom
82+ ..right = right;
83+ return insets;
84+ }
85+ }
86+
7487/// Internal extensions on [MLNCoordinateBounds] .
7588extension MLNCoordinateBoundsExt on MLNCoordinateBounds {
7689 /// Convert a [MLNCoordinateBounds] to a [LngLatBounds] .
Original file line number Diff line number Diff line change @@ -101,8 +101,12 @@ final class MapLibreMapStateIos extends MapLibreMapStateNative
101101 EdgeInsets padding = EdgeInsets .zero,
102102 }) async {
103103 final ffiBounds = bounds.toMLNCoordinateBounds ();
104- // TODO support padding with Struct UIEdgeInsets
105- _mapView.setVisibleCoordinateBounds (ffiBounds, animated: true );
104+ final ffiPadding = padding.toUIEdgeInsets ();
105+ _mapView.setVisibleCoordinateBounds$1 (
106+ ffiBounds,
107+ edgePadding: ffiPadding,
108+ animated: true ,
109+ );
106110 }
107111
108112 @override
You can’t perform that action at this time.
0 commit comments