Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Warning
CommunityToolkit.Maui.Maps was deprecated in the toolkit's last .NET 10 release and is removed in the .NET 11 release. The package has no .NET 11 version. The Map control for Windows that it provided used Bing Maps for Enterprise, which Microsoft is retiring. For more information, see Deprecate Map Control in favor of MAUI Map implementation.
.NET MAUI includes its own Map control in the Microsoft.Maui.Controls.Maps package. It supports Android, iOS, Mac Catalyst, and Windows. On Windows, it uses the WinUI 3 MapControl, which is backed by Azure Maps. For details on how to work with the control, see the .NET MAUI Map documentation.
Migrate to the .NET MAUI Map
- Remove the
CommunityToolkit.Maui.Mapspackage from your project. - Add the
Microsoft.Maui.Controls.Mapspackage to your project.CommunityToolkit.Maui.Mapsreferenced it for you, so your project might not reference it directly yet. - Remove
using CommunityToolkit.Maui.Maps;and the call toUseMauiCommunityToolkitMapsfrom MauiProgram.cs. - Call
UseMauiMapson theMauiAppBuilderfor every platform. - On Windows, set your Azure Maps subscription key. Without a valid key, the map shows no map data.
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMauiMaps();
#if WINDOWS
builder.ConfigureEssentials(essentials => essentials.UseMapServiceToken("YOUR_AZURE_MAPS_SUBSCRIPTION_KEY"));
#endif
Windows limitations
On Windows, the .NET MAUI Map doesn't support:
IsShowingUser- Polygons, polylines and circles in
MapElements - Pin labels and info windows
- The
MapClickedevent
It supports MoveToRegion, the Street, Satellite and Hybrid map types, traffic, scrolling, zooming and pins.
.NET MAUI Community Toolkit