小编Dol*_*eno的帖子

Swift iOS谷歌地图,协调路径

我正在尝试在我的应用程序中创建一个函数,该函数将引导用户使用我创建的标记.这是我正在使用的代码,它运行良好,它获取用户当前位置并在地图上显示它.但是如何获得标记的指示?

任何芒果都会有所帮助

class Karta: UIViewController, CLLocationManagerDelegate {
    @IBOutlet var mapView: GMSMapView!

    let locationManager = CLLocationManager()

    override func viewDidLoad() {
        super.viewDidLoad()

        //allow app to track user
        locationManager.delegate = self
        locationManager.requestWhenInUseAuthorization()

        //set out a marker on the map
        var marker = GMSMarker()
        marker.position = CLLocationCoordinate2DMake(56.675907, 12.858798)
        marker.appearAnimation = kGMSMarkerAnimationPop
        marker.icon = UIImage(named: "flag_icon")
        marker.map = mapView
     }

    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        if segue.identifier == "Types Segue" {
            let navigationController = segue.destinationViewController as UINavigationController
        }
    }

    func locationManager(manager: CLLocationManager!, didChangeAuthorizationStatus …
Run Code Online (Sandbox Code Playgroud)

directions google-maps-sdk-ios swift

3
推荐指数
3
解决办法
3万
查看次数

标签 统计

directions ×1

google-maps-sdk-ios ×1

swift ×1