diff --git a/tutorials/map-with-marker/map-with-marker/ViewController.m b/tutorials/map-with-marker/map-with-marker/ViewController.m index c0937168..8a97597c 100644 --- a/tutorials/map-with-marker/map-with-marker/ViewController.m +++ b/tutorials/map-with-marker/map-with-marker/ViewController.m @@ -25,23 +25,22 @@ @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; - // Do any additional setup after loading the view. - // Create a GMSCameraPosition that tells the map to display the - // coordinate -33.86,151.20 at zoom level 6. - GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86 - longitude:151.20 - zoom:6]; - GMSMapView *mapView = [GMSMapView mapWithFrame:self.view.frame camera:camera]; - mapView.myLocationEnabled = YES; - [self.view addSubview:mapView]; - - // Creates a marker in the center of the map. - GMSMarker *marker = [[GMSMarker alloc] init]; - marker.position = CLLocationCoordinate2DMake(-33.86, 151.20); - marker.title = @"Sydney"; - marker.snippet = @"Australia"; - marker.map = mapView; + // Do any additional setup after loading the view. + // Create a GMSCameraPosition that tells the map to display the + // coordinate -33.86,151.20 at zoom level 6. + GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86 + longitude:151.20 + zoom:6]; + GMSMapView *mapView = [GMSMapView mapWithFrame:self.view.frame camera:camera]; + mapView.myLocationEnabled = YES; + [self.view addSubview:mapView]; + + // Creates a marker in the center of the map. + GMSMarker *marker = [[GMSMarker alloc] init]; + marker.position = CLLocationCoordinate2DMake(-33.86, 151.20); + marker.title = @"Sydney"; + marker.snippet = @"Australia"; + marker.map = mapView; } - @end // [END maps_ios_map_with_marker] diff --git a/tutorials/map-with-marker/map-with-marker/ViewController.swift b/tutorials/map-with-marker/map-with-marker/ViewController.swift index 7c93313f..948876d3 100644 --- a/tutorials/map-with-marker/map-with-marker/ViewController.swift +++ b/tutorials/map-with-marker/map-with-marker/ViewController.swift @@ -25,8 +25,8 @@ class ViewController: UIViewController { // Create a GMSCameraPosition that tells the map to display the // coordinate -33.86,151.20 at zoom level 6. let camera = GMSCameraPosition.camera(withLatitude: -33.86, longitude: 151.20, zoom: 6.0) - let mapView = GMSMapView.map(withFrame: self.view.frame, camera: camera) - self.view.addSubview(mapView) + let mapView = GMSMapView.map(withFrame: view.frame, camera: camera) + view.addSubview(mapView) // Creates a marker in the center of the map. let marker = GMSMarker() @@ -34,6 +34,6 @@ class ViewController: UIViewController { marker.title = "Sydney" marker.snippet = "Australia" marker.map = mapView - } + } } // [END maps_ios_map_with_marker]