本文介绍了像 LOVOO 一样的雷达视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个基于位置的 iOS 应用程序.其中有一个功能可以在雷达视图中找到用户的朋友.我从后端获取朋友的纬度和经度.现在我尝试了很多东西来像指南针一样在雷达视图中显示它们(意味着当我在雷达中旋转朋友的点时也会旋转)

Hi I am developing a location based iOS application. In which there is a feature to find user's friends in a radar view. I am getting friends latitude and longitude from backend.Now I tried so many thing to show them in a radar view like a compass (means when I rotate the friend's spots in radar also rotates)

客户需要与应用程序完全相同的功能 LOVOO

Client need feature exactly like the app LOVOO

我该怎么做?请帮帮我.

How can I do this ?Please help me.

推荐答案

如果您不担心地球表面的曲率,那么这将变得非常简单.

If you are not worried about the curvature of the earth's surface then this turns into something really easy.

您将所有纬度和经度更改为基于极坐标的系统(角度和大小来自您自己的纬度和经度).然后你会得到设备的罗盘方位.然后根据设备的角度调整所有朋友"的角度.然后在地图上绘制所有内容(将极坐标转换回笛卡尔坐标).然后在设备的罗盘方位发生变化(或朋友的位置更新)时进行更新.

You change all of the latitude and longitudes into a polar coordinate based system (angle and magnitude from your own latitude and longitude). Then you get the device's compass bearing. Then you adjust all of the "friend's" angles based off your device's angle. Then plot everything out on your map (translating your polar coordinates back to cartesian). Then update whenever the device's compass bearing changes (or friend's location updates).

需要大量数学运算,但过程非常简单,您应该能够通过一次 Google 搜索获得所有转化信息.

It's a lot of math, but the process is pretty straight forward and you should be able to get all of the conversion information with a single google search.

这篇关于像 LOVOO 一样的雷达视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-30 13:40