Google Map iOS中的中心坐标

在iOS的MapKit中,我们有一个属性,可返回地图坐标的中心。

    mapView.centerCoordinate.latitude
    mapView.centerCoordinate.longitude

在Google的iOS版Map Sdk中有没有办法做到这一点?

aijelun917 回答:Google Map iOS中的中心坐标

这里mapViewGMSMapView。您需要使用Google地图的projection属性。

let lat = mapView.projection.coordinate(for: mapView.center).latitude
let lng = mapView.projection.coordinate(for: mapView.center).longitude

print("center Lat & Lng = \(lat),\(lng)") 
本文链接:https://www.f2er.com/3139303.html

大家都在问