你可以试试这个
从您的
didUpdateLocations
代表:
GMSCameraUpdate *move = [GMSCameraUpdate setTarget:location.coordinate zoom:17];
[self.myMapView animateWithCameraUpdate:move];
将其移动到一个新函数,以便稍后调用。
在里面
did更新位置
设置新用户位置,然后调用
[locationManager stopUpdatingLocation]
然后调用新的自定义函数来设置相机。
在新的自定义函数中,更改:
[self.myMapView animateWithCameraUpdate:move];
收件人:
CLLocationCoordinate2D target = myLocation; //2d coord
self.myMapView.camera = [GMSCameraPosition cameraWithTarget:target zoom:17];