osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.59k stars 1.01k forks source link

Radius ruler widget displays illogical distance from tap #20757

Open ossilator opened 1 week ago

ossilator commented 1 week ago

Description

under some circumstances, the reference point for the radius ruler's distance widget is assumed to be the screen center, despite the ruler's actual center being at the bottom, thus yielding a wrong distance.

Steps to reproduce

Actual result

while dragging, the distance is wrong because a wrong reference point is used.

Expected result

the ruler's center point is used, like when not dragging the map.

Your Environment (required)

OsmAnd Version: 4.8.5
Android version: 13 (hyperos 1.0.5)
Device model: xiaomi redmi note 11s (fleur)
yuriiurshuliak commented 1 week ago

I was unable to reproduce this bug on my end. I tested by enabling the radius ruler widget and using the Distance by tap tool to compare the distances, and they were approximately the same in all cases.

Could you please provide detailed steps to reproduce the issue? We also need a video showing how the error occurs, along with the specific conditions and coordinates where you observe the incorrect distance calculation.

Additionally, how did you determine that the distance is being calculated incorrectly?

You might also find this guide helpful: https://osmand.net/docs/user/widgets/radius-ruler/#center--bottom-position

OsmAnd~ 4.9.0#3136m, released: 2024-09-06

ossilator commented 1 week ago

the bug is blatantly obvious, because the distance jumps from zero to the distance to the screen center as indicated by the ruler circles, as soon as the map is dragged, and jumps back as soon as the drag is released. no tool whatsoever is necessary to see it.

i can't describe the conditions more clearly than i already did. but they don't seem to be too critical, as this has been happening on my previous phone (galaxy S5) for years already.

how can i quickly fake the current position? i don't want to post a video that reveals my home address.

yuriiurshuliak commented 1 week ago

To simulate GPS locations on your device, you can use various apps. Here's how you can do it and some recommended apps for Android platform:

  1. Enable Developer Options:

2.Install a GPS Spoofing App: After enabling mock locations, you can use one of these apps to simulate GPS locations:

ossilator commented 1 week ago

there you go: https://github.com/user-attachments/assets/c8eeeda5-318f-4588-83a6-b19f334c5102 the tap/drag gesture at the center has somewhat low contrast, but it's good enough.

yuriiurshuliak commented 6 days ago

Based on the video, I observed that while using the radius ruler widget, the displayed information appears to be incorrect when the map is moved manually. However, once you stop moving the map and release your finger, the information updates correctly.

This behavior seems to be intentional, as the widgets likely function accurately when the map is stationary and not being manipulated by touch.

ossilator commented 6 days ago

your observation is correct and consistent with my description.

but i don't see how your reasoning for this being intentional makes any sense. why would anyone want that behavior? it serves no obvious purpose, and it is certainly surprising and disruptive.

vshcherb commented 4 days ago

@yuriiurshuliak it's intentional and documented, it's distance from finger to my location.

ossilator commented 4 days ago

@vshcherb that comment is a tad confusing ...

the "base" function of the widget is to show the distance between the current location and the ruler origin (== display position, which is actually a somewhat confusing name). it maintains this function even if the map is dragged as long as the ruler origin is at the screen center. the odd one out is bottom origin plus dragging, which makes it look very much like a bug.

in no case i see it implementing "distance from finger to my location". and while such a function as such sounds somewhat useful, it seems redundant enough with actually existing functionality that disrupting other functions for its sake would seem like a bad idea.

vshcherb commented 3 days ago

As this functionality implemented as it was always for Map Markers, Radius ruler widget displays location from map center to my location, so it's logical that hold & touch changes map center to the selected point on the map. As I know we don't plan to make this optional

ossilator commented 3 days ago

i don't think that it's "logical", as it makes for a rather "jumpy" experience, while not adding much value - you can just drag your finger to the ruler origin instead. and the inconsistency between different origins disqualifies the current behavior anyway.