当我在房间里移动时,如何在Google Map上获取iPhone的当前位置?

时间:2018-11-20 07:01:46

标签: dictionary service sdk location gmsmapview

我是Google Map SDK的新手,我实现了CLLocationManagerDeletage的可选功能:

func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation])
{
    guard let location = locations.first else {
        return
    }

   print(location) //this code is what I want.

    viewMap.camera = GMSCameraPosition(target: location.coordinate, zoom: 15, bearing: 0, viewingAngle: 0)


    locationManager.stopUpdatingLocation()

}

但是它不会打印位置。

0 个答案:

没有答案