惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Hackread – Cybersecurity News, Data Breaches, AI and More
U
Unit 42
Vercel News
Vercel News
Martin Fowler
Martin Fowler
云风的 BLOG
云风的 BLOG
爱范儿
爱范儿
MongoDB | Blog
MongoDB | Blog
J
Java Code Geeks
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
C
Check Point Blog
N
Netflix TechBlog - Medium
Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏
博客园_首页
WordPress大学
WordPress大学
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
Last Week in AI
Last Week in AI
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
Jina AI
Jina AI
V
Visual Studio Blog
小众软件
小众软件

.NET Blog

Share your .NET story with the community - .NET Blog Use C# unions and closed hierarchies in ASP.NET Core - .NET Blog Announcing .NET 11 Release Candidate 1 - .NET Blog .NET Conf 2026 Community Days Call for Presenters Is Open - .NET Blog .NET and .NET Framework September 2026 servicing releases updates - .NET Blog Test what you ship: MSTest and Native AOT - .NET Blog How Uno Platform uses .NET, MCP, and AI to build high quality apps - .NET Blog .NET Conf 2026 - .NET Blog From dotnet run to Foundry Hosted Agent in 3 lines of C# - .NET Blog Explore new features available in C# 15 preview - .NET Blog Routing and Failover for Microsoft.Extensions.AI - .NET Blog Instructions Hygiene - What Frontier Models Still Need You to Say - .NET Blog .NET 11 Preview 7 is now available! - .NET Blog .NET and .NET Framework August 2026 servicing releases updates - .NET Blog Test reporting in Microsoft.Testing.Platform: from red build to root cause - .NET Blog Beyond Chat: live Speech-to-Text with Foundry Local and C# - .NET Blog Strengthening NuGet Supply Chain Security: Reducing API Key Lifetime - .NET Blog From generated code to trusted code with a unit-test agent - .NET Blog Announcing v2.0 of the official MCP C# SDK - .NET Blog Analyze MSBuild Binary Logs with Copilot in VS Code - .NET Blog Announcing .NET Modernization for Beginners - .NET Blog .NET and .NET Framework July 2026 servicing releases updates - .NET Blog CoreCLR Progress and the Mono Timeline for .NET MAUI - .NET Blog .NET 11 Preview 6 is now available! - .NET Blog Modernize .NET applications in the GitHub Copilot app - .NET Blog MCP Beyond the Chat Window: Build Diagnostics in CI - .NET Blog .NET 8 and .NET 9 will reach End of Support on November 10, 2026 - .NET Blog SkiaSharp 4.0 is here: announcing the first stable release - .NET Blog Packaging and Package Identity for .NET apps with WinApp CLI on Windows - .NET Blog AI-Powered MSBuild Investigation with the Microsoft Binlog MCP Server - .NET Blog
Pin Clustering in .NET MAUI Maps
David Ortinau · 2026-04-16 · via .NET Blog

April 15th, 2026

likecelebrate4 reactions

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 3, 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. Pins with no identifier share a default group.

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 3 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.

Category

Topics

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