如何在IOS 6的Google Map API中使用委托 [英] How to use delegates in Google map API for IOS 6

查看:85
本文介绍了如何在IOS 6的Google Map API中使用委托的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的iPhone应用程序中,我正在使用google map SDK来显示附近的餐馆.我能够显示地点. 我有些疑问.

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.如何找出地图的中心坐标?

2.如何还原到当前位置?

3.如何查找地图是否已移动-即中心坐标已更改(就像MKMapView中的regionChanged委托一样)

推荐答案

这可能应该是三个独立的问题,

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.

使用[mapView:didChangeCameraPosition:]委托方法.

这篇关于如何在IOS 6的Google Map API中使用委托的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆