-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
p: mapsGoogle Maps pluginGoogle Maps pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.
Description
The behavior of the GoogleMap() widget differs on Android vs iOS. When wrapped in a ClipRRect() to add a borderRadius, the maps displays as expected on Android but not iOS.
Included below is an example project and screenshot displaying the issue:

class _MyHomePageState extends State<MyHomePage> {
final Completer<GoogleMapController> _controller = Completer();
final CameraPosition _googleHQ = CameraPosition(
bearing: 0,
target: LatLng(37.422, -122.084),
tilt: 45,
zoom: 16,
);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Container(
height: 300,
width: 300,
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(50.0)),
child: GoogleMap(
mapType: MapType.hybrid,
initialCameraPosition: _googleHQ,
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
),
),
),
)
);
}
}
Full test project can be found here: https://github.com/jamespfinn/flutter_maps_clip_test
Be sure to set your maps api key.
AdamJonsson, amalrkrishna, franvera, jamespfinn, RockerFlower and 6 more
Metadata
Metadata
Assignees
Labels
p: mapsGoogle Maps pluginGoogle Maps pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.