MKMapview变换仅旋转地图内容
我需要根据从 CoreLocation 获得的 CLLocations 的过程来变换旋转 MKMapview。 我基本上已经有了这个:
mapview.transform = CGAffineTransformMakeRotation(degreesToRadians(course));
但是,这不好,因为这会旋转整个地图并带有注释。现在我可以修复注释,但问题是它也会旋转 Google 徽标!
在搜索关于这个问题的所有其他帖子后,主要答案是谷歌徽标不可能做到这一点,但事实是,我看到一些应用程序(例如 Trapster)实际上做到了这一点,它们旋转地图,但谷歌徽标是总是在同一个地方。 所以我的问题是,是否有一个我不知道的新功能纯粹旋转地图的内容,或者所有这些应用程序都旋转地图视图,修复注释的旋转,并且可能将自己的谷歌图像添加到包含的视图中地图视图? 谢谢!
I need to transform-rotate a MKMapview based on the course of the CLLocations I get from CoreLocation.
I basically have this already:
mapview.transform = CGAffineTransformMakeRotation(degreesToRadians(course));
However, this is not good since this rotates the entire map, with annotations. Now I can fix the annotations, but the problem is it also rotates the Google logo!
After searching all other posts here on this problem the main answer was this is not possible with the google logo but the thing is, I have seen some Apps (Trapster for example) that actually do this, they rotate the map but the google logo is always in the same place.
So my question is, is there a new function I don't know about that purely rotates the content of the map, or do all these apps rotate the mapview, fix rotations of the annotations and perhaps add their own google image to the view containing the mapview?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许你可以通过使用mapView.subviews找到正确的视图来做到这一点。
如果我这样做:
我会回复:
我猜其中之一就是谷歌徽标和地图本身......
Probably you could do by finding the right view with mapView.subviews.
If I do:
I get back:
I would guess one of these is the google logo and the map itself...