0

I have an array of Marker (google maps markers) with longitude and latitude. I want to create some sort of radar like view that'll display these markers as points where I'm looking toward their directions with an angle of 45°.

Do you guys have any idea how I can say "This marker is behind me, this marker is in front of me". I guess I should apply cos and sin considering my orientation, but that's too blurry atm.

Hope you'll help :) Thanks

1 Answers1

1

I assume you already know your location and orientation. You can then calculate the directions of the array of markers using computeHeading() method of Google maps Geometry Library on your current location and the points. Then you can adjust those values based on your current orientation.

  • I know my location in latitude/longitude and I know the distance in meters between the markers and my position. But I don't know my orientation :s – Fabrice Froehly Aug 01 '18 at 08:08
  • This answer [link](https://stackoverflow.com/a/20340147) can help you get the device heading. Also edited my original answer. Its the `computeHeading()`method. – Ponnarasu N Aug 01 '18 at 09:08
  • That's what I was looking for ! Now need to convert markers using this orientation. I'll post the answer later during the day when I'll have it, thanks ! – Fabrice Froehly Aug 01 '18 at 09:19