Showing posts with label Swift. Show all posts
Showing posts with label Swift. Show all posts

Install Google Maps dengan Pod di Swift

Buat File Pod dan Isi :
pod 'GoogleMaps'
Jalan perintah pod install di terminal :
pod install


Install Google Maps dengan Pod di Swift
IOS Google Maps

Berikut contoh instalasi Google Maps dengan Pod :

Controller :
import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var mapView: GMSMapView!
    override func viewDidLoad() {
        super.viewDidLoad()
       
        let camera : GMSCameraPosition = GMSCameraPosition.cameraWithLatitude(-7.798657, longitude: 110.365746, zoom: 15.0)
        mapView.camera = camera
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}
Tambahkan pada AppDelegate,swift :
    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        GMSServices.provideAPIKey("Key")
        // Override point for customization after application launch.
        return true
    }

Selengkapnya bisa dilihat di  https://youtu.be/s8sTx0vsRR8