public override void LoadView () { base.LoadView (); var camera = CameraPosition.FromCamera (latitude: 30.2652898, longitude: -97.7386826, zoom: 17, bearing: 15, viewingAngle: 15); mapView = MapView.FromCamera (View.Bounds, camera); mapView.MapType = MapViewType.Normal; mapView.MyLocationEnabled = true; //mapView.Frame = View.Frame; var hiltonOptions = new MarkerOptions(); hiltonOptions.Position = new MonoTouch.CoreLocation.CLLocationCoordinate2D(30.2652898, -97.7386826); hiltonOptions.Title = "Evolve 2013"; hiltonOptions.Snippet = "Austin, TX"; mapView.AddMarker(hiltonOptions); View.Add (mapView); satelliteSwitch = new UISwitch (); satelliteSwitch.Frame = new RectangleF(11.0f, 11.0f, satelliteSwitch.Frame.Width, satelliteSwitch.Frame.Height); satelliteSwitch.On = false; View.Add (satelliteSwitch); currentLocNow = UIButton.FromType (UIButtonType.RoundedRect); currentLocNow.Frame = new RectangleF(50, 100, 100, 20); currentLocNow.Center = new PointF (View.Frame.Width/2, View.Frame.Height - 20.0f); currentLocNow.SetTitle ("ShowMyLoc", UIControlState.Normal); View.AddSubview (currentLocNow); }
public override void LoadView () { base.LoadView (); CameraPosition camera = CameraPosition.FromCamera (37.797865, -122.402526, 6); mapView = MapView.FromCamera (RectangleF.Empty, camera); mapView.MyLocationEnabled = true; mapView.AddMarker (new MarkerOptions { Title = "Xamarin HQ", Snippet = "Where the magic happens.", Position = new CLLocationCoordinate2D (37.797865, -122.402526) }); View = mapView; }