我通过使用google map Api显示客户机构位置来创建google map 在我的ViewController中,我使用以下代码显示机构。
但是我不知道如何在mapView上获得方向选项。
import UIKit
import GoogleMaps
class viewController: UIViewController
{
@IBOutlet weak var MapView: GMSMapView!
override func viewDidLoad()
{
super.viewDidLoad()
load()
}
func load() {
//map
let camera = GMSCameraPosition.camera(withLatitude: 18.435121, longitude: -78.439278, zoom: 15.0)
MapView.camera = camera
//marker
let marker = GMSMarker()
marker.position = CLLocationCoordinate2D(latitude: 18.435121, longitude: -78.439278)
marker.map = MapView
}
}
在AppDelegate中
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
{
GMSServices.provideAPIKey("APIkey")
}
我想要下面的图片