March 18th, 2026
0 reactions

Pin Clustering in .NET MAUI Maps

David Ortinau
Principal Product Manager

If you’ve ever loaded a map with dozens — or hundreds — of pins, you know the result: an overlapping mess that’s impossible to interact with. Starting in .NET MAUI 11 Preview 2, the Map control supports pin clustering out of the box on Android and iOS/Mac Catalyst.

What is pin clustering?

Pin clustering automatically groups nearby pins into a single cluster marker when zoomed out. As you zoom in, clusters expand to reveal individual pins. This is a long-requested feature (#11811) and one that every map-heavy app needs.

Enable clustering

A single property is all it takes:

<maps:Map IsClusteringEnabled="True" />

That’s it. Nearby pins are now grouped into clusters with a count badge showing how many pins are in each group.

Separate clustering groups

Not all pins are the same. You might want coffee shops to cluster independently from parks, or hotels separately from attractions. The ClusteringIdentifier property on Pin makes this possible:

map.Pins.Add(new Pin
{
    Label = "Pike Place Coffee",
    Location = new Location(47.6097, -122.3331),
    ClusteringIdentifier = "coffee"
});

map.Pins.Add(new Pin
{
    Label = "Occidental Square",
    Location = new Location(47.6064, -122.3325),
    ClusteringIdentifier = "parks"
});

Pins with the same identifier cluster together. Pins with different identifiers form independent clusters even when geographically close.

Handle cluster taps

When a user taps a cluster, the ClusterClicked event fires with a ClusterClickedEventArgs that gives you access to the pins in the cluster:

map.ClusterClicked += async (sender, e) =>
{
    string names = string.Join("\n", e.Pins.Select(p => p.Label));
    await DisplayAlert(
        $"Cluster ({e.Pins.Count} pins)",
        names,
        "OK");

    // Suppress default zoom-to-cluster behavior:
    // e.Handled = true;
};

The event args include:

  • Pins — the pins in the cluster
  • Location — the geographic center of the cluster
  • Handled — set to true if you want to handle the tap yourself instead of the default zoom behavior

Platform notes

On Android, clustering uses a custom grid-based algorithm that recalculates when the zoom level changes. No external dependencies are required.

On iOS and Mac Catalyst, clustering leverages the native MKClusterAnnotation support in MapKit, providing smooth, platform-native cluster animations.

Try it out

The Maps sample in maui-samples includes a new Clustering page that demonstrates pin clustering with multiple clustering groups and cluster tap handling.

For the full API reference and additional examples, see the Maps documentation.

Summary

Pin clustering brings a polished, production-ready experience to .NET MAUI Maps. Enable it with a single property, customize it with clustering identifiers, and handle taps with a straightforward event. We’re looking forward to seeing what you build with it.

Get started by installing .NET 11 Preview 2 and updating or installing the .NET MAUI workload.

If you’re on Windows using Visual Studio, we recommend installing the latest Visual Studio 2026 Insiders. You can also use Visual Studio Code and the C# Dev Kit extension with .NET 11.

Author

David Ortinau
Principal Product Manager

David is a Principal Product Manager for .NET at Microsoft, focused on .NET MAUI. A .NET developer since 2002, and versed in a range of programming languages, David has developed web, environmental, and mobile experiences for a wide variety of industries. After several successes with tech startups and running his own software company, David joined Microsoft to follow his passion: crafting tools that help developers create better app experiences. When not at a computer or with his family, David ...

More about author

0 comments