Friday, 28 June 2019

A Dart implementation of Leaflet.markercluster for Flutter

flutter tutorial,flutter,flutter tutorial for beginners,flutter app,flutter tutorials,flutter sdk,tutorial,flutter course,learn flutter,flutter tutorial ios,flutter firebase tutorial,flutter widgets,flutter app development tutorial,flutter ios,flutter dart,flutter android,google flutter,flutter sdk tutorial,flutter tutorial app,google flutter tutorial,flutter sqflite tutorial,flutter tutorial deutsch,flutter tutorial android

Flutter Map Marker Cluster

A Dart implementation of Leaflet.markercluster for Flutter apps. This is a plugin for flutter_map package.

Usage

Add flutter_map and flutter_map_marker_cluster to your pubspec:
dependencies:
  flutter_map: any
  flutter_map_marker_cluster: any # or the latest version on Pub
YAML
Add it in you FlutterMap and configure it using 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,
            );
          },
        ),
      ],
    );
  }


GitHub


Provides beautiful animated marker clustering functionality for flutter_map. Inspired by Leaflet.markercluster — Read More
Latest commit to the master branch on 7-11-2019
Download as zip