How to use delegates in Google map API for IOS 6 [closed]

筅森魡賤 提交于 2020-01-13 06:50:09

问题


In my iphone app I am using google map SDK for showing nearby restaurants.I am able to show the places. I have some doubts..

1. How can I find out the center coordinates of the map ??

2. How to revert back to current position ?

3.How to find out the map is moved- ie center coordinates changed(just like regionChanged delegate in MKMapView)


回答1:


This should probably be three separate questions, however:

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.

Use the [mapView:didChangeCameraPosition:] delegate method.



来源:https://stackoverflow.com/questions/15669308/how-to-use-delegates-in-google-map-api-for-ios-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!