如何在ios中的谷歌地图中添加倾斜效果?
我在代码中添加了以下行以倾斜谷歌地图:如何在ios中的谷歌地图中添加倾斜效果?,ios,objective-c,google-maps,Ios,Objective C,Google Maps,我在代码中添加了以下行以倾斜谷歌地图: GMSCameraPosition* camera = [GMSCameraPosition cameraWithTarget:currentPosition zoom:20 bearing:self.locationManager.heading.trueHeading viewingAngle:30]; _googleMapView.camera = camera; self.googleMapView.settings.tilt
GMSCameraPosition* camera =
[GMSCameraPosition cameraWithTarget:currentPosition zoom:20 bearing:self.locationManager.heading.trueHeading viewingAngle:30];
_googleMapView.camera = camera;
self.googleMapView.settings.tiltGestures = YES;
但它不起作用。通过添加上述代码,我在谷歌地图视图中找不到任何倾斜效果。这里我添加了两幅图像。我得到的地图与第二幅图像类似。但是,我需要像第一幅图像一样的地图。
请提供帮助。不要直接设置“googleMapView.camera”属性,而是使用以下方法:
[_googleMapView animateToCameraPosition:camera];
编辑:
如果只想更改相机倾斜,也可以使用以下选项:
[_googleMapView animateToViewingAngle:30.0]
只需注意角度需要在30到45度之间(如果您想要直下视图,则为0)。在Swift 4.2中 您可以使用函数倾斜google mapview
googleMapView.animate(toViewingAngle: 45)
你可以发布你需要的gif或视频吗?当然可以。我已经添加了图像。我可以在模拟器中获得倾斜视图,还是应该在设备上检查它?@Thomas