如何在iOS的Google Maps SDK中设置CenterMapView的位置 [英] How to setCenter mapview with location in google maps sdk for iOS

查看:114
本文介绍了如何在iOS的Google Maps SDK中设置CenterMapView的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在iOS的Google Maps sdk中使用位置设置CenterMapview? 使用mapkit,我们可以执行setCenter:Location. 如何使用适用于iOS的Google Maps sdk做到这一点.

How to setCenter mapview with location in google maps sdk for iOS? With mapkit we can do setCenter:Location. How do this with google maps sdk for iOS.

推荐答案

使用GMSCameraPosition构造函数创建新相机

Create a new camera with the GMSCameraPosition constructor

+ (GMSCameraPosition *)cameraWithTarget:(CLLocationCoordinate2D)target zoom:(CGFloat)zoom

然后使用方法

- (void)animateToCameraPosition:(GMSCameraPosition *)cameraPosition;


您也可以只使用


You can also just use

- (void)animateToLocation:(CLLocationCoordinate2D)location;

但是,如果您想进一步控制摄像机的最终外观,则前一个允许您在摄像机构造函数中更改缩放,方位和视角.

but the previous allows you to change the zoom, bearing, and viewing angle within the camera constructor if you want more control over the final appearance of the camera.

这篇关于如何在iOS的Google Maps SDK中设置CenterMapView的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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