apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

Add direction the user is facing to Nearby real-time position

Open misaochan opened this issue 7 years ago • 11 comments

AFAIK there was a discussion about this somewhere, but I think it was buried under a more general discussion.

Currently, our users see their real-time position as a dot. Which is great! But it would be much more useful if they could see what direction they were facing, similar to popular map apps. IMO this would make it easier for users to navigate using our Nearby map, without implementing full-on routing.

A brief look at how we can do that: https://stackoverflow.com/questions/14611493/point-arrow-to-direction-the-user-is-facing

misaochan avatar Apr 18 '18 15:04 misaochan

Hi, is anyone working on this? If not i would like to have a look at this.

Maeglad avatar May 08 '18 10:05 Maeglad

@Maeglad Feel free, it is now assigned to you! Please let us know about your progress regularly and ask questions if you need :-)

nicolas-raoul avatar May 08 '18 10:05 nicolas-raoul

Any updates on this @Maeglad ? :)

misaochan avatar Jun 05 '18 09:06 misaochan

I have done logic to calculate bearing from values of magnetic and accelerometer sensor, but right now I'm struggling a bit with rotating marker on map. Marker has no methods to rotate icon. From documentation of mapbox I learned that I should use SymbolLayer and iconRotate property of layer to rotate icon. I'll try it out and keep you updated how it is going. @misaochan

Maeglad avatar Jun 05 '18 11:06 Maeglad

Sounds like good progress, thanks for the update @Maeglad . :)

misaochan avatar Jun 06 '18 07:06 misaochan

I was in middle of testing when black squares started appearing on map screenshot_1529664916 im using emulator with android api 26, strange thing is i was testing same code 4 days ago on same image and there were no black squares. I tried different images but all on every it is same. This issue does not appear on mobile with same code. Anyone has some idea what it could be?

Maeglad avatar Jun 22 '18 11:06 Maeglad

@Maeglad Probably some network problem or problems of the server that provides the tiles.

nicolas-raoul avatar Jun 22 '18 11:06 nicolas-raoul

@nicolas-raoul I would like to work on this. I think we could reuse the code for #5433.

ShashwatKedia avatar Mar 30 '24 04:03 ShashwatKedia

@nicolas-raoul I have implemented the solution, but there seems to be one problem. Whenever I update the direction of the marker by using setRotation property of OSMDroid, the map recenters the user to the current location. So if a person is scrolling the map and simultaneously changing the direction of their phone, they are forcefully recentered in the map.

Note: I have kept a sensitivity of 5 degrees, which means the dirn of the marker will be updated only when user turns their device by 5 degrees. Increasing this value will decrease the chances of marker getting updated while user is scrolling thro the map.

Screencast: https://github.com/commons-app/apps-android-commons/assets/142137555/0b4d8527-14ad-4764-9dfa-1e8e220cf4ce

ShashwatKedia avatar Apr 01 '24 03:04 ShashwatKedia

Interesting! Feel free to send a PR. :-) It potentially might be an OsmDroid bug.

nicolas-raoul avatar Apr 01 '24 04:04 nicolas-raoul

@ShashwatKedia, Can I help you with it!

kanahia1 avatar Apr 03 '24 11:04 kanahia1

@ShashwatKedia I unassign for now, but if you are you still working on this, please let us know. Also, if you have any code even broken feel free to post a patch here. Thanks a lot. :-)

nicolas-raoul avatar Aug 20 '24 08:08 nicolas-raoul