旋转 RMMapView 的内容

发布于 2024-12-21 10:01:17 字数 432 浏览 1 评论 0原文

我正在开发一个使用route-me 项目的应用程序。我想要一个地图视图旋转以适应当前标题。我知道这个问题已经得到处理。 因此,当使用

[self.mapView.contents setRotation:desiredAngle];

RMMapview或

[self.mapView setTransform:CGAffineTransformMakeRotation(desiredAngle)];

在 RMMapview 上放置 SplitViewController 的详细视图控制器时,我会得到一个奇怪的行为。 旋转的是视图,而不是其中包含的地图。从图形上看,这意味着包含地图的正方形旋转,我们可以看到正方形角以前所在的白色区域。 有人可以帮我解决这个问题,或者向我解释一下我一开始没有做对的事情吗? 谢谢

i'm working on a app using the route-me project. I'd like to have a mapView rotating to fit with the current heading. I kwow that the issue has already been dealt with.
Therefore, when is use

[self.mapView.contents setRotation:desiredAngle];

or

[self.mapView setTransform:CGAffineTransformMakeRotation(desiredAngle)];

on a RMMapview i put on the detailViewController of a SplitViewController, i get a weird behavior.
it's the view that rotates and not the map contained in it. Graphically it means that the square containing the map rotates and we can see white area where the square's corners were formerly.
Can someone help me solve this issue or explain me what i didn't get right in the first place.
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

最近可好 2024-12-28 10:01:17

显然,将 mapView 的宽度和高度设置为等于包含视图的对角线可以解决此问题。
要理解为什么我们只需要考虑视图行为并弄清楚如果我们为视图框架采用更大的正方形,则不会出现白色区域。
总而言之,您的地图视图必须足够大,以隐藏用户视线中的(实际)角点。
这不是一个真正的解决方案,更多的是一个解决方法,但这对我来说已经足够了。
希望有帮助

Apparently setting the mapView's width and heigth equal to the diagonal of the containing View solves this issue.
To understand why we just have to think about the view behavior and figure out that the white areas that appear wouldn't if we took a bigger square for the view's frame.
To sum up, your mapView must be big enough to hide its (actual) corners from the user's sight.
Not really a solution, more a workaround but it's enough for me.
Hope it helps

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