Last active
October 3, 2017 19:22
-
-
Save DejanEnspyra/70dbf5e2783a9d3533228f3913096c27 to your computer and use it in GitHub Desktop.
Initialization Google Maps SDK iOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| import GoogleMaps | |
| class ViewController: UIViewController { | |
| @IBOutlet fileprivate weak var mapView: GMSMapView! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| let camera = GMSCameraPosition.camera(withLatitude: 37.36, longitude: -122.0, zoom: 6.0) | |
| mapView.camera = camera | |
| showMarker(position: camera.target) | |
| } | |
| func showMarker(position: CLLocationCoordinate2D){ | |
| let marker = GMSMarker() | |
| marker.position = position | |
| marker.title = "Palo Alto" | |
| marker.snippet = "San Francisco" | |
| marker.map = mapView | |
| } | |
| } | |
| extension ViewController: GMSMapViewDelegate{ | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment