谷歌地图中的当前位置是错误的

时间:2018-05-27 08:07:26

标签: ios swift xcode google-maps

我在我的应用中使用googlemaps来显示用户的当前位置..

这是我的代码:

 self.locationManger.requestWhenInUseAuthorization()
    self.locationManger.requestAlwaysAuthorization()

    var currentlocation: CLLocation!

    if (CLLocationManager.authorizationStatus() == CLAuthorizationStatus.authorizedWhenInUse || CLLocationManager.authorizationStatus() == CLAuthorizationStatus.authorized){
        currentlocation = locationManger.location
    }

    let camera = GMSCameraPosition.camera(withLatitude: currentlocation.coordinate.latitude, longitude: currentlocation.coordinate.longitude, zoom: 15)
    mapView.camera=camera
    mapView.isMyLocationEnabled = true
    mapView.settings.myLocationButton = true
    mapView.padding = UIEdgeInsets(top: 0, left: 0, bottom: 90, right: 0)

这就是我得到的:

enter image description here

问题是引脚不在我当前的实际位置..如截图所示..我当前位置在红色圆圈中,而黄色圆圈中的引脚...我做错了什么?< / p>

0 个答案:

没有答案