Skip to content

Update Maps documentation for .NET 11 new features #3208

@jfversluis

Description

@jfversluis

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 MapElementClick event on Map control
  • Fired when a user taps on a Circle, Polygon, or Polyline
  • Event args include the tapped MapElement

2. MapLongClicked Event (PR dotnet/maui#33792)

  • New MapLongClicked event on Map control
  • 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 LastUserLocation property on Map — returns the last known user Location
  • New UserLocationChanged event — fires when the user location updates

4. Pin Clustering (PR dotnet/maui#33831)

  • New Map.IsClusteringEnabled property
  • When enabled, nearby pins are automatically grouped into clusters
  • Supported on iOS and Android

5. Custom Pin Icons (PR dotnet/maui#33950)

  • 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

8. Custom Map Styles (PR dotnet/maui#33991)

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions