コード例 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();
            GMSCamera camera = new GMSCamera(-33.8683, 151.2086, 6);
            mapView = new GMSMapView{Camera =  camera};
            mapView.MyLocationEnabled = true ;
            this.View = mapView;

            var xamarinhq = new GMSMarkerOptions {
                Title = "Xamarin HQ",
                Snippet = "Where the magic happens.",
                Position = new CLLocationCoordinate2D (37.797865, -122.402526)
            };
            mapView.AddMarker (xamarinhq);
        }
コード例 #2
0
        public override void LoadView()
        {
            base.LoadView ();

            GMSCameraPosition camera = GMSCameraPosition.FromCamera (37.797865, -122.402526, 6);
            mapView = GMSMapView.FromCamera(RectangleF.Empty, camera);
            mapView.MyLocationEnabled = true;
            this.View = mapView;

            var xamarinhq = new GMSMarkerOptions {
                Title = "Xamarin HQ",
                Snippet = "Where the magic happens.",
                Position = new CLLocationCoordinate2D (37.797865, -122.402526)
            };
            mapView.AddMarker (xamarinhq);
        }