MapView

Embeds an interactive map in the tree, backed by a UIKit map view.

ShowsUserLocation needs NSLocationWhenInUseUsageDescription in the app plist.

public class MapView : Control

Properties

ClusterMarker

Builds a custom view for a cluster from its pin count, or null for the native counted marker.

Only used while ClustersPins is on.

Type: Func<int, View>?

public Func<int, View>? ClusterMarker { get; set; }

ClustersPins

Whether nearby pins collapse into a single counted marker that splits apart on zoom.

Type: bool

public bool ClustersPins { get; set; }

Kind

The base imagery the map draws.

Type: MapKind

public MapKind Kind { get; set; }

Overlays

The shapes drawn on the map beneath its pins.

Type: BindableList<MapOverlay>

public BindableList<MapOverlay> Overlays { get; set; }

PinCommand

Command invoked with the tapped pin.

Type: ICommand?

public ICommand? PinCommand { get; set; }

Pins

The markers dropped on the map.

Type: BindableList<MapPin>

public BindableList<MapPin> Pins { get; set; }

PitchEnabled

Whether the user can tilt the map into a 3D pitch.

Type: bool

public bool PitchEnabled { get; set; }

Region

The visible extent, updated as the user pans and zooms.

Type: Bindable<MapRegion>

public Bindable<MapRegion> Region { get; set; }

RotateEnabled

Whether the user can rotate the map.

Type: bool

public bool RotateEnabled { get; set; }

ScrollEnabled

Whether the user can pan the map.

Type: bool

public bool ScrollEnabled { get; set; }

ShowsCompass

Whether the compass appears when the map is rotated.

Type: bool

public bool ShowsCompass { get; set; }

ShowsScale

Whether a distance scale appears while zooming.

Type: bool

public bool ShowsScale { get; set; }

ShowsTraffic

Whether live traffic is drawn.

Type: bool

public bool ShowsTraffic { get; set; }

ShowsUserLocation

Whether the blue dot marking the user's location is shown.

Type: bool

public bool ShowsUserLocation { get; set; }

ZoomEnabled

Whether the user can zoom the map.

Type: bool

public bool ZoomEnabled { get; set; }

Methods

MeasureOverride

Content measurement. Panels recurse; controls delegate to the native SizeThatFits.

protected override Size MeasureOverride(
  Size availableSize)
ParameterSummary
Size availableSizeThe size available for the view's content.

Returns

  • Size: The desired content size.

SetRegion

Moves the map to a region.

public void SetRegion(
  MapRegion region,
  bool animated)
ParameterSummary
MapRegion regionThe extent to show.
bool animatedWhether the move animates.