Frage

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)

Client need feature exactly like the app LOVOO

How can I do this ? Please help me.

enter image description here

War es hilfreich?

Lösung 2

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).

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.

Andere Tipps

I've created a similar LOVOO like Radar view for iOS. It's available on github.

https://github.com/abm-adnan/Radar

iOS Radar View

In case you also require the live camera image and augmentations on top of that, you can use Wikitude SDK, which includes a customizable radar widget (see the example here). You can use it also without the camera image, however the library could be too much for your case.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top