See Also: MKMapView Members
The MonoTouch.MapKit.MKMapView provides a zoomable map interface upon which the application developer can add information-bearing MonoTouch.MapKit.MKAnnotations and area-based MonoTouch.MapKit.MKOverlays.
In iOS 7 and later, maps support 3D imagery when the MKMapView.MapType property is MKMapType.Standard. To view 3D imagery, the MKMapView.ShowsBuilding property must be true and the MKMapView.Camera and and MKMapView.PitchEnabled properties must be set to create a non-vertical perspective. The iOS simulator does not render 3D buildings. The following example shows how a camera can be set to provide 3D imagery:
C# Example
var target = new CLLocationCoordinate2D(37.7952, -122.4028); var viewPoint = new CLLocationCoordinate2D(37.8009, -122.4100); //Enable 3D buildings mapView.ShowsBuildings = true; mapView.PitchEnabled = true; var camera = MKMapCamera.CameraLookingAtCenterCoordinate(target, viewPoint, 500); mapView.Camera = camera;
iOS distinguishes between the MonoTouch.MapKit.MKOverlay, which represents the geometry of an overlay, and it's visual presentation. Prior to iOS 7, overlays were rendered using MonoTouch.MapKit.MKOverlayViews. In iOS 7, these classes have been deprecated, and overlays now use the more efficient subclasses of MonoTouch.MapKit.MKOverlayRenderer.
To create an overlay and its renderer, application developers must add the overlay to the MonoTouch.MapKit.MKMapView and return the renderer either using the MKMapView.OverlayRenderer property or by overriding the MKMapViewDelegate.OverlayRenderer method.
C# Example
MKPolygon hotelOverlay = MKPolygon.FromCoordinates(coordinates); mkMap.AddOverlay (hotelOverlay); var polygon = MKPolygon.FromCoordinates(coordinates); var renderer = new MKPolygonRenderer(polygon) { FillColor = UIColor.Red, Alpha = 0.5f }; mkMap.OverlayRenderer = (view, overlay) => renderer;