轻按标记时如何更改默认的相机行为? [英] How to change default camera behavior when marker is tapped?

查看:66
本文介绍了轻按标记时如何更改默认的相机行为?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Google Maps for iOS SDK的1.2版中,点击标记的默认行为已更改. 发行说明说:点击标记时的默认行为已更新,还可以将摄像机平移到标记的位置"

In release 1.2 of the Google Maps for iOS SDK the default behavior of a tapped marker changed. The release note says: "The default behavior when a marker is tapped has been updated to also pan the camera to the marker's position"

如何恢复以前的行为,即不将相机中心平移到标记的位置?

How can I get the old behavior back, i.e. not panning the camera center to the position of the marker?

推荐答案

将以下方法添加到您的GMSMapView委托实现中. GMSMapView将不再以所选标记为中心,并恢复现有行为.

Add the following method to your GMSMapView delegate implementation. GMSMapView will no longer center on the selected marker and brings back the existing behavior.

- (BOOL) mapView:(GMSMapView *)mapView didTapMarker:(GMSMarker *)marker {
     mapView.selectedMarker = marker;
     return TRUE;
}

这篇关于轻按标记时如何更改默认的相机行为?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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