MKMapview变换仅旋转地图内容

发布于 2024-12-07 08:50:34 字数 431 浏览 1 评论 0原文

我需要根据从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

相权↑美人 2024-12-14 08:50:34

也许你可以通过使用mapView.subviews找到正确的视图来做到这一点。

如果我这样做:

for (UIView *aView in mapView.subviews){
    NSLog(@"view class: %@", aView.class);
}

我会回复:

view class: UILabel
view class: UIView
view class: UIImageView
view class: UILabel

我猜其中之一就是谷歌徽标和地图本身......

Probably you could do by finding the right view with mapView.subviews.

If I do:

for (UIView *aView in mapView.subviews){
    NSLog(@"view class: %@", aView.class);
}

I get back:

view class: UILabel
view class: UIView
view class: UIImageView
view class: UILabel

I would guess one of these is the google logo and the map itself...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文