iOS iPhone在MKMapView上显示用户在空间中的方向和方向,如指南针应用程序 [英] iOS iPhone show user direction and orientation in space like the compass app on MKMapView

查看:323
本文介绍了iOS iPhone在MKMapView上显示用户在空间中的方向和方向,如指南针应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当指南针应用程序使用地图视图显示它的位置时,会有一个小圆锥体显示手机指向的方向。但是,我无法使用显示用户位置的MKMapView重现它。开发人员可以使用这种视锥功能,还是我必须自己实现?

When the compass app uses a map view to display it's location, there's a little cone that displays the direction in which the phone is pointing. However, I was unable to reproduce it using MKMapView that shows user's location. Is this cone of sight feature available to developers, or will I have to implement one myself?

谢谢!

推荐答案

我遇到了类似的情况。我认为我们没有图书馆或设置来显示蓝色图标上的方向(至少我的搜索没有成功)。

I faced a similar situation. I don't think we have library or settings to display the direction on the blue icon (at least my search was not successful).

然而,使用CLHeading创建我们自己的方向指示器并不困难(参考TommyG的回答)。

However it is not difficult to create our own direction indicator using the CLHeading (reference in TommyG's answer).

我所做的是在地图中显示蓝色图标,并在不同视图中提供一个小箭头以指示方向。

What I did was to display the blue icon as in the map and provide a small arrow in a different view to indicate the direction.

希望这在某种程度上有所帮助

Hope this helps in some way

这篇关于iOS iPhone在MKMapView上显示用户在空间中的方向和方向,如指南针应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆