Google地图中心缩放 [英] Google Maps Center while zooming

查看:351
本文介绍了Google地图中心缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的iOS应用程序中使用Google地图,并且已将标记固定在视图的中心以获取中心位置。现在,缩放标记的位置在其他位置,当前位置在其他位置。我想要实现的是在放大或缩小我的位置时应位于地图的中心查看我该如何实现它。任何帮助都会很棒。
在此先感谢..

I am using google maps in my ios app and I have fixed the marker in the centre of the view so as to get the centre location. Now, while zooming the marker is somewhere else and the current location is somewhere else.what I want to achieve is while zoomingIn or out my location should be in the centre of the map View how can I achieve it. Any help would be great. Thanks in advance..

推荐答案

您可以添加这行 allowScrollGesturesDuringRotateOrZoom 到您的GMSMapview。此设置控制是否可以在偏离中心的位置执行旋转和缩放手势并滚动。

You can add this line allowScrollGesturesDuringRotateOrZoom to your GMSMapview. This setting controls whether rotate and zoom gestures can be performed off-center and scrolled around.

mapView.settings.allowScrollGesturesDuringRotateOrZoom = NO

有关更多信息,请查看 page and this SO问题

For more information, check this page and this SO question.

这篇关于Google地图中心缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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