public override void ViewDidLoad () { base.ViewDidLoad (); var camera = CameraPosition.FromCamera (-33.868, 151.2086, 12); mapView = MapView.FromCamera (CGRect.Empty, camera); mapView.Settings.CompassButton = true; mapView.Settings.MyLocationButton = true; // Listen to the myLocation property of GMSMapView. mapView.AddObserver (this, new NSString ("myLocation"), NSKeyValueObservingOptions.New, IntPtr.Zero); View = mapView; // Ask for My Location data after the map has already been added to the UI. InvokeOnMainThread (()=> mapView.MyLocationEnabled = true); }
public override void ViewDidLoad() { base.ViewDidLoad (); var camera = CameraPosition.FromCamera (-33.868, 151.2086, 12); mapView = MapView.FromCamera (RectangleF.Empty, camera); mapView.Settings.CompassButton = true; mapView.Settings.MyLocationButton = true; // Listen to the myLocation property of GMSMapView. mapView.AddObserver (this, new NSString ("myLocation"), NSKeyValueObservingOptions.New, IntPtr.Zero); View = mapView; // Ask for My Location data after the map has already been added to the UI. InvokeOnMainThread (()=> mapView.MyLocationEnabled = true); // Perform any additional setup after loading the view, typically from a nib. switcher = new UISegmentedControl (new [] {"Normal", "Satellite", "Hybrid", "Terrain"}) { AutoresizingMask = UIViewAutoresizing.FlexibleBottomMargin | UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleBottomMargin, SelectedSegment = 0, ControlStyle = UISegmentedControlStyle.Bar }; NavigationItem.TitleView = switcher; // Listen to touch events on the UISegmentedControl. switcher.ValueChanged += HandleValueChanged; }