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
- New
MapElementClick event on Map control
- Fired when a user taps on a
Circle, Polygon, or Polyline
- Event args include the tapped
MapElement
- New
MapLongClicked event on Map control
- Fired on long-press/hold gesture on the map
- Returns the
Location (lat/lon) of the long press
- New
LastUserLocation property on Map — returns the last known user Location
- New
UserLocationChanged event — fires when the user location updates
- New
Map.IsClusteringEnabled property
- When enabled, nearby pins are automatically grouped into clusters
- Supported on iOS and Android
- New
Pin.ImageSource property
- 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 animated
MapSpan.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
- New
Map.MapStyle property with MapStyle class
MapStyle.DarkMode and MapStyle.LightMode presets
new 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.IsVisible property — show/hide map elements without removing from collection
- New
MapElement.ZIndex property — 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 for Location properties
- New
MapSpanTypeConverter — enables "lat,lon,latDeg,lonDeg" string syntax for MapSpan properties
- New
Map.Region bindable 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.
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)
MapElementClickevent onMapcontrolCircle,Polygon, orPolylineMapElement2. MapLongClicked Event (PR dotnet/maui#33792)
MapLongClickedevent onMapcontrolLocation(lat/lon) of the long press3. User Location from Map (PR dotnet/maui#33799)
LastUserLocationproperty onMap— returns the last known userLocationUserLocationChangedevent — fires when the user location updates4. Pin Clustering (PR dotnet/maui#33831)
Map.IsClusteringEnabledproperty5. Custom Pin Icons (PR dotnet/maui#33950)
Pin.ImageSourcepropertyImageSource6. 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 locations7. Show Info Window Programmatically (PR dotnet/maui#33985)
Pin.ShowInfoWindow()methodPin.HideInfoWindow()method8. Custom Map Styles (PR dotnet/maui#33991)
Map.MapStyleproperty withMapStyleclassMapStyle.DarkModeandMapStyle.LightModepresetsnew MapStyle(string jsonStyle)for custom JSON styles (Android only, using Google Maps Styling)[UnsupportedOSPlatform]for iOS/MacCatalyst/Windows9. MapElement.IsVisible & ZIndex (PR dotnet/maui#33993)
MapElement.IsVisibleproperty — show/hide map elements without removing from collectionMapElement.ZIndexproperty — control draw order/layering of map elements10. XAML TypeConverters & Map.Region (PR dotnet/maui#33995)
LocationTypeConverter— enables"lat,lon"string syntax in XAML forLocationpropertiesMapSpanTypeConverter— enables"lat,lon,latDeg,lonDeg"string syntax forMapSpanpropertiesMap.Regionbindable property — set initial map region declaratively in XAMLBefore (verbose XAML):
After (concise XAML):
Pages to Update
Target
These features are targeting .NET 11 Preview 2 milestone.