Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions docs/user-interface/controls/map.md
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,62 @@ The `MapItemTemplateSelector` class defines `DefaultTemplate` and `SanFranTempla

For more information about data template selectors, see [Create a DataTemplateSelector](~/fundamentals/datatemplate.md#create-a-datatemplateselector).

### Pin clustering

When a map displays many pins in a small area, they can overlap and become difficult to interact with. Pin clustering groups nearby pins into a single cluster marker that expands as you zoom in.

To enable clustering, set the `IsClusteringEnabled` property on the <xref:Microsoft.Maui.Controls.Maps.Map> control:

```xaml
<maps:Map IsClusteringEnabled="True" />
```

When `IsClusteringEnabled` is `true`, nearby pins are automatically grouped into cluster markers at lower zoom levels. Zooming in expands clusters to reveal individual pins.

#### Clustering identifiers

By default, all pins share the same clustering group. To create separate clustering groups — for example, to cluster restaurants independently from parks — set the `ClusteringIdentifier` property on each <xref:Microsoft.Maui.Controls.Maps.Pin>:

```csharp
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 `ClusteringIdentifier` cluster together. Pins with different identifiers form separate clusters even when they are geographically close.

#### Handle cluster taps

When a user taps a cluster marker, the `ClusterClicked` event fires. The <xref:Microsoft.Maui.Controls.Maps.ClusterClickedEventArgs> provides:

- `Pins` — a read-only list of the <xref:Microsoft.Maui.Controls.Maps.Pin> objects in the cluster.
- `Location` — the geographic <xref:Microsoft.Maui.Devices.Sensors.Location> of the cluster.
- `Handled` — set to `true` to prevent the default zoom-to-cluster behavior.

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

// Suppress default zoom behavior:
// e.Handled = true;
};
```

> [!NOTE]
> Pin clustering is supported on Android and iOS/Mac Catalyst. On Android, clusters recalculate when the zoom level changes. On iOS/Mac Catalyst, the platform's native `MKClusterAnnotation` support manages cluster display.

## Polygons, polylines, and circles

`Polygon`, `Polyline`, and `Circle` elements allow you to highlight specific areas on a map. A `Polygon` is a fully enclosed shape that can have a stroke and fill color. A `Polyline` is a line that does not fully enclose an area. A `Circle` highlights a circular area of the map:
Expand Down
29 changes: 24 additions & 5 deletions docs/whats-new/dotnet-11.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: What's new in .NET MAUI for .NET 11
description: Learn about the new features introduced in .NET MAUI for .NET 11.
ms.date: 1/27/2026
ms.date: 03/10/2026
---

# What's new in .NET MAUI for .NET 11
Expand All @@ -24,17 +24,36 @@ This is a description of the feature and essential code snippets to adopt it.

.NET MAUI in .NET 11 includes control enhancements and deprecations.

### A specific control
### Map pin clustering

What was added, removed, changed.
The <xref:Microsoft.Maui.Controls.Maps.Map> control now supports pin clustering, which automatically groups nearby pins into cluster markers at lower zoom levels. This long-requested feature is supported on Android and iOS/Mac Catalyst.

New APIs:

- `Map.IsClusteringEnabled` — enables or disables pin clustering.
- `Pin.ClusteringIdentifier` — groups pins into named clusters for independent clustering.
- `Map.ClusterClicked` — event fired when a cluster marker is tapped.
- `ClusterClickedEventArgs` — provides the list of pins in the cluster, the cluster location, and a `Handled` property to suppress default zoom behavior.

```xaml
<maps:Map IsClusteringEnabled="True"
ClusterClicked="OnClusterClicked" />
```

For more information, see [Pin clustering](~/user-interface/controls/map.md?view=net-maui-11.0&preserve-view=true#pin-clustering).

> [!div class="nextstepaction"]
> [Explore the sample](/samples/dotnet/maui-samples/userinterface-map-clustering)

## Platform features

.NET MAUI's platform features have received some updates in .NET 11.

### Feature description
### `maui` CLI

.NET MAUI 11 introduces the `maui` CLI, a unified command-line tool for managing your development environment. Key commands include `maui doctor`, `maui android install`, and `maui apple install`, with structured `--json` output for CI/CD and AI agent integration.

Description...
For more information, see [.NET MAUI CLI reference](~/get-started/maui-cli.md?view=net-maui-11.0&preserve-view=true).

## .NET for Android

Expand Down
Loading