【发布时间】:2018-03-01 14:26:03
【问题描述】:
我正在为 IOS 使用谷歌地图 SDK。我已经使用 GMSCoordinateBounds() 方法设置了地图的边界。
我在地图边界处滚动时遇到了一些问题。 不确定,这是 IOS 原生行为还是与代码相关的东西。
实际行为: 在边界处经历粗暴行为。 在界限内工作正常。
预期行为: 它应该在边界处停止滚动或放大效果,以避免粗暴行为。
这是我的代码
var mapView = GMSMapView()
var defaultCamera = GMSCameraPosition()
defaultCamera = GMSCameraPosition(target: CLLocationCoordinate2D(latitude: 12.3019, longitude: 104.0923),
zoom: zoomLevels[0],
bearing: defaultCamera.bearing,
viewingAngle: defaultCamera.viewingAngle)
mapView.delegate = self
mapView.mapStyle = MapUtils().style
mapView.camera = defaultCamera
mapView.setMinZoom(10, maxZoom: 21)
// enable google map view handle other gesture
mapView.settings.consumesGesturesInView = false
mapView.settings.rotateGestures = false
mapView.settings.tiltGestures = false
mapView.settings.allowScrollGesturesDuringRotateOrZoom = false
// override double tap to zoom in
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(googleMapDoubleTap))
tapGesture.numberOfTapsRequired = 2
mapView.addGestureRecognizer(tapGesture)
self.myLocationMarker.map = self.mapView
任何帮助将不胜感激。 提前谢谢..
【问题讨论】:
标签: ios google-maps google-maps-sdk-ios