<分区>
在我的 iPhone 应用程序中,我使用谷歌地图 SDK 来显示附近的餐馆。我能够显示地点。 我有一些疑问..
<强>1。我怎样才能找到 map 的中心坐标??
<强>2。如何恢复到当前位置?
3.如何发现 map 移动了——即中心坐标改变了(就像MKMapView中的regionChanged delegate)
<分区>
在我的 iPhone 应用程序中,我使用谷歌地图 SDK 来显示附近的餐馆。我能够显示地点。 我有一些疑问..
<强>1。我怎样才能找到 map 的中心坐标??
<强>2。如何恢复到当前位置?
3.如何发现 map 移动了——即中心坐标改变了(就像MKMapView中的regionChanged delegate)
最佳答案
然而,这可能应该是三个独立的问题:
1.
GMSMapView* _mapView = ...;
CLLocationCoordinate2D centre = _mapView.camera.target;
2.
GMSMapView* _mapView = ...;
CLLocationCoordinate2D currentPosition = _mapView.myLocation.coordinate;
CGFloat currentZoom = _mapView.camera.zoom;
GMSCameraPosition* camera =
[GMSCameraPosition cameraWithTarget: currentPosition zoom: currentZoom];
_mapView.camera = camera;
3.
使用 [mapView:didChangeCameraPosition:]
委托(delegate)方法。
关于iphone - 如何在适用于 IOS 6 的 Google map API 中使用委托(delegate),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15669308/