-
Notifications
You must be signed in to change notification settings - Fork 248
Open
Labels
Description
Overview
.NET 11 introduces significant improvements to the .NET MAUI Maps control. The Maps documentation needs to be updated to cover all the new APIs and features.
Tracking epic: dotnet/maui#33787
New Features to Document
1. MapElement Click Events (PR dotnet/maui#29101)
- New
MapElementClickevent onMapcontrol - Fired when a user taps on a
Circle,Polygon, orPolyline - Event args include the tapped
MapElement
2. MapLongClicked Event (PR dotnet/maui#33792)
- New
MapLongClickedevent onMapcontrol - Fired on long-press/hold gesture on the map
- Returns the
Location(lat/lon) of the long press
3. User Location from Map (PR dotnet/maui#33799)
- New
LastUserLocationproperty onMap— returns the last known userLocation - New
UserLocationChangedevent — fires when the user location updates
4. Pin Clustering (PR dotnet/maui#33831)
- New
Map.IsClusteringEnabledproperty - When enabled, nearby pins are automatically grouped into clusters
- Supported on iOS and Android
5. Custom Pin Icons (PR dotnet/maui#33950)
- New
Pin.ImageSourceproperty - Allows setting a custom image for map pins using any
ImageSource
6. Camera & Zoom Improvements (PR dotnet/maui#33982)
MoveToRegion(MapSpan, bool animated)overload — control whether map movement is animatedMapSpan.FromLocations(IEnumerable<Location>)— calculate best-fit zoom for a set of locations- Fix for initial map animation (no more fly-in from Maui, Hawaii when setting initial region)
7. Show Info Window Programmatically (PR dotnet/maui#33985)
- New
Pin.ShowInfoWindow()method - New
Pin.HideInfoWindow()method - Allows programmatic control of pin info windows without user tap
8. Custom Map Styles (PR dotnet/maui#33991)
- New
Map.MapStyleproperty withMapStyleclass MapStyle.DarkModeandMapStyle.LightModepresetsnew MapStyle(string jsonStyle)for custom JSON styles (Android only, using Google Maps Styling)- Android-only: Custom JSON styles are marked with
[UnsupportedOSPlatform]for iOS/MacCatalyst/Windows - Apple platforms only support light/dark mode switching
9. MapElement.IsVisible & ZIndex (PR dotnet/maui#33993)
- New
MapElement.IsVisibleproperty — show/hide map elements without removing from collection - New
MapElement.ZIndexproperty — control draw order/layering of map elements
10. XAML TypeConverters & Map.Region (PR dotnet/maui#33995)
- New
LocationTypeConverter— enables"lat,lon"string syntax in XAML forLocationproperties - New
MapSpanTypeConverter— enables"lat,lon,latDeg,lonDeg"string syntax forMapSpanproperties - New
Map.Regionbindable property — set initial map region declaratively in XAML
Before (verbose XAML):
<maps:Map>
<maps:Map.ItemsSource>
<maps:Pin>
<maps:Pin.Location>
<sensors:Location>
<x:Arguments>
<x:Double>36.9628066</x:Double>
<x:Double>-122.0194722</x:Double>
</x:Arguments>
</sensors:Location>
</maps:Pin.Location>
</maps:Pin>
</maps:Map.ItemsSource>
</maps:Map>After (concise XAML):
<maps:Map Region="36.9628066,-122.0194722,0.05,0.05">
<maps:Map.Pins>
<maps:Pin Location="36.9628066,-122.0194722" Label="Santa Cruz" />
</maps:Map.Pins>
</maps:Map>Pages to Update
Target
These features are targeting .NET 11 Preview 2 milestone.
Reactions are currently unavailable