From f906135592aa45d5abfe428bdc8c1945c4b2c297 Mon Sep 17 00:00:00 2001 From: Owen LaRosa Date: Mon, 16 Oct 2023 08:39:02 -0700 Subject: [PATCH 1/3] style: Fix formatting in map with marker snippets --- .../map-with-marker/ViewController.m | 32 ++++++++----------- .../map-with-marker/ViewController.swift | 14 ++++---- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/tutorials/map-with-marker/map-with-marker/ViewController.m b/tutorials/map-with-marker/map-with-marker/ViewController.m index c0937168..54388537 100644 --- a/tutorials/map-with-marker/map-with-marker/ViewController.m +++ b/tutorials/map-with-marker/map-with-marker/ViewController.m @@ -22,26 +22,22 @@ @interface ViewController () @end @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. + 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..2829b0a1 100644 --- a/tutorials/map-with-marker/map-with-marker/ViewController.swift +++ b/tutorials/map-with-marker/map-with-marker/ViewController.swift @@ -18,22 +18,22 @@ import UIKit import GoogleMaps class ViewController: UIViewController { - override func 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. - 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 camera = GMSCameraPosition.camera(withLatitude: -33.86, longitude: 151.2, zoom: 6.0) + let mapView = GMSMapView.map(withFrame: view.frame, camera: camera) + view.addSubview(mapView) + // Creates a marker in the center of the map. let marker = GMSMarker() - marker.position = CLLocationCoordinate2D(latitude: -33.86, longitude: 151.20) + marker.position = CLLocationCoordinate2D(latitude: -33.86, longitude: 151.2) marker.title = "Sydney" marker.snippet = "Australia" marker.map = mapView - } + } } + // [END maps_ios_map_with_marker] From 60d9ce3fa899a71f6ba9466b4ec3715fbb5573c7 Mon Sep 17 00:00:00 2001 From: Owen LaRosa Date: Mon, 16 Oct 2023 09:05:41 -0700 Subject: [PATCH 2/3] style: Make comments and newlines consistent, revert to 2 decimals --- tutorials/map-with-marker/map-with-marker/ViewController.m | 3 +++ .../map-with-marker/map-with-marker/ViewController.swift | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tutorials/map-with-marker/map-with-marker/ViewController.m b/tutorials/map-with-marker/map-with-marker/ViewController.m index 54388537..8a97597c 100644 --- a/tutorials/map-with-marker/map-with-marker/ViewController.m +++ b/tutorials/map-with-marker/map-with-marker/ViewController.m @@ -22,9 +22,12 @@ @interface ViewController () @end @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]; diff --git a/tutorials/map-with-marker/map-with-marker/ViewController.swift b/tutorials/map-with-marker/map-with-marker/ViewController.swift index 2829b0a1..d4307b24 100644 --- a/tutorials/map-with-marker/map-with-marker/ViewController.swift +++ b/tutorials/map-with-marker/map-with-marker/ViewController.swift @@ -18,15 +18,16 @@ import UIKit import GoogleMaps class ViewController: UIViewController { + override func 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. - let camera = GMSCameraPosition.camera(withLatitude: -33.86, longitude: 151.2, zoom: 6.0) + let camera = GMSCameraPosition.camera(withLatitude: -33.86, longitude: 151.20, zoom: 6.0) let mapView = GMSMapView.map(withFrame: view.frame, camera: camera) view.addSubview(mapView) - + // Creates a marker in the center of the map. let marker = GMSMarker() marker.position = CLLocationCoordinate2D(latitude: -33.86, longitude: 151.2) @@ -35,5 +36,4 @@ class ViewController: UIViewController { marker.map = mapView } } - // [END maps_ios_map_with_marker] From edabb5f71992a0a936a9d8bbd167b971b18cd6d8 Mon Sep 17 00:00:00 2001 From: Owen LaRosa Date: Fri, 20 Oct 2023 08:50:55 -0700 Subject: [PATCH 3/3] refactor: Revert decimal place to 2 digits --- tutorials/map-with-marker/map-with-marker/ViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/map-with-marker/map-with-marker/ViewController.swift b/tutorials/map-with-marker/map-with-marker/ViewController.swift index d4307b24..948876d3 100644 --- a/tutorials/map-with-marker/map-with-marker/ViewController.swift +++ b/tutorials/map-with-marker/map-with-marker/ViewController.swift @@ -30,7 +30,7 @@ class ViewController: UIViewController { // Creates a marker in the center of the map. let marker = GMSMarker() - marker.position = CLLocationCoordinate2D(latitude: -33.86, longitude: 151.2) + marker.position = CLLocationCoordinate2D(latitude: -33.86, longitude: 151.20) marker.title = "Sydney" marker.snippet = "Australia" marker.map = mapView