dependencies: flutter_map: any flutter_map_marker_cluster: any # or the latest version on Pub
MarkerClusterGroupLayerOptions
.
Widget build(BuildContext context) { return FlutterMap( options: new MapOptions( plugins: [ MarkerClusterPlugin(), ], ), layers: [ TileLayerOptions( urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', subdomains: ['a', 'b', 'c'], ), MarkerClusterLayerOptions( maxClusterRadius: 120, height: 40, width: 40, fitBoundsOptions: FitBoundsOptions( padding: EdgeInsets.all(50), ), markers: markers, polygonOptions: PolygonOptions( borderColor: Colors.blueAccent, color: Colors.black12, borderStrokeWidth: 3), builder: (context, markers) { return FloatingActionButton( child: Text(markers.length.toString()), onPressed: null, ); }, ), ], ); }
Android Studio Setup Open Android Studio and select Configure->Plugins 2. Click Browse repositories… ...