Search packages, repositories and app categories

flutter_map_marker_cluster cover
Package detailsv8.2.2

flutter_map_marker_cluster

A Dart implementation of Leaflet.makercluster for Flutter apps. Provides beautiful animated marker clustering functionality for flutter_map.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
100K
Likes
224
Pub points
150

Install package

flutter pub add flutter_map_marker_cluster

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package that brings animated marker clustering to flutter_map, inspired by Leaflet.markercluster. It efficiently groups nearby markers into clusters, improving map performance and user experience on maps with dense data. The package supports smooth animations when expanding or collapsing clusters and works seamlessly across all major platforms. Ideal for apps displaying large numbers of location-based points such as business listings, delivery locations, or event markers.

Use cases

  • Displaying high-density location data
  • Improving map performance with many markers
  • Creating interactive map experiences
  • Visualizing geospatial data in real-time
  • Enhancing user navigation on maps

Key features

  • Animated cluster transitions
  • Efficient marker grouping
  • Seamless integration with flutter_map
  • Support for custom cluster styling
  • Cross-platform compatibility

Suitable for

  • Maps with hundreds or thousands of markers
  • Location-based service apps
  • Data visualization dashboards
  • Mobile and web mapping applications
  • Developers using flutter_map

Considerations

  • Requires flutter_map to be installed
  • May impact performance with very large datasets
  • Customization requires understanding of flutter_map configuration
  • Limited built-in styling options without additional code
  • Best used with static or slowly updating data

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Flutter Map Marker Cluster

pub package travis

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

flutter_map package removed old layering system with v3.0.0 use MarkerClusterLayerWidget as member of children parameter list and configure it using MarkerClusterLayerOptions.

 @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Clustering Many Markers Page')),
      drawer: buildDrawer(context, ClusteringManyMarkersPage.route),
      body: FlutterMap(
        options: MapOptions(
          center: LatLng((maxLatLng.latitude + minLatLng.latitude) / 2,
              (maxLatLng.longitude + minLatLng.longitude) / 2),
          zoom: 6,
          maxZoom: 15,
        ),
        children: <Widget>[
          TileLayer(
            urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
          ),
          MarkerClusterLayerWidget(
            options: MarkerClusterLayerOptions(
              maxClusterRadius: 45,
              size: const Size(40, 40),
              alignment: Alignment.center,
              padding: const EdgeInsets.all(50),
              maxZoom: 15,        
              markers: markers,
              builder: (context, markers) {
                return Container(
                  decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(20),
                      color: Colors.blue),
                  child: Center(
                    child: Text(
                      markers.length.toString(),
                      style: const TextStyle(color: Colors.white),
                    ),
                  ),
                );
              },
            ),
          ),
        ],
      ),
    );
  }
Run the example

See the example/ folder for a working example app.

Supporting Me

A donation through my Ko-Fi page would be infinitly appriciated: ko-fi

but, if you can't or won't, a star on GitHub and a like on pub.dev would also go a long way!

Every donation gives me fuel to continue my open-source projects and lets me know that I'm doing a good job.

Categories

Dependencies

Dependency list 3 items

Source repository

Projects using this package