public void InitMap() { _clLocationManager = new CLLocationManager(); _clLocationManager.RequestAlwaysAuthorization(); _clLocationManager.RequestWhenInUseAuthorization(); _mapView.ShowsUserLocation = true; _mapView.ScrollEnabled = _mapView.ZoomEnabled = true; _mapView.ShowsCompass = true; _mapDelegate = new MapViewDelegate(_mapView, _clLocationManager) { }; _mapView.Delegate = _mapDelegate; }
public override void ViewDidLoad() { base.ViewDidLoad(); //map - should be switched with separate reusable map view /OSMMapView/ MapViewDelegate mapDelegate = new MapViewDelegate(); mapView.Delegate = mapDelegate; string template = "http://tile.openstreetmap.org/{z}/{x}/{y}.png"; MKTileOverlay overlay = new MKTileOverlay(template); overlay.CanReplaceMapContent = true; mapView.AddOverlay(overlay, MKOverlayLevel.AboveLabels); // Center the map, for development purposes MKCoordinateRegion region = mapView.Region; region.Span.LatitudeDelta = 0.05; region.Span.LongitudeDelta = 0.05; region.Center = new CLLocationCoordinate2D(51.7166700, 8.7666700); mapView.Region = region; // Disable rotation programatically because value of designer is somehow ignored mapView.RotateEnabled = false; //tableView exhibitsTableView.RowHeight = 44; //exhibitsTableView.RegisterNibForCellReuse(UINib.FromName("ExhibitTableViewCell", null), // ExhibitTableViewCell.key); ExhibitsTableViewSource source = new ExhibitsTableViewSource(); source.Exhibits = LoadExhibitsData(); exhibitsTableView.Source = source; }
public MapRenderer() { _renderHelper = new MapRenderHelper <MKPointAnnotation, MKPolylineEx>(this); _mapViewDelegate = new MapViewDelegate(this); }