Back to results for “Maps & Location”
.NET MAUI › Maps & Location

How do you add pins and move the map region in MAUI Maps?

Intermediate

Answer

Add Pin objects to Map.Pins with a Location, Label, and Address, and call MoveToRegion with a MapSpan centered on a location and radius. You can handle pin taps via the InfoWindowClicked/MarkerClicked events.
map.Pins.Add(new Pin { Label = "HQ",
    Location = new Location(37.79, -122.40) });
map.MoveToRegion(MapSpan.FromCenterAndRadius(
    new Location(37.79, -122.40), Distance.FromKilometers(2)));
Real-world example A delivery app drops a pin at the destination and centers the map on it with a 2km view.

Common follow-ups: What is a MapSpan? | How do you handle a pin tap?