Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve GeolocateControl accuracy circle radius computation #5437

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tricaric
Copy link

Now the GeolocateControl marker is using the center position to calculate the pixel scale, and is updating calculations at each move/rotate/zoom of the map, as those change the position of the accuracy circle, and this affects its pixel size depending on map pitch. This also improves the case of moving the marker "far away" in tilted map (final part of videos)

This should improve/fix #5432

Videos show the GeolocateControl before and after the fix.

Screen.Recording.2025-02-01.at.2.27.14.mov
Screen.Recording.2025-02-01.at.2.39.54.mov

Launch Checklist

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Add an entry to CHANGELOG.md under the ## main section.

…ng map

Using the center position to calculate the pixel scale, and updating calculations at each move/rotate/zoom of the map, as those change the position of the accuracy circle.
Copy link

codecov bot commented Jan 31, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 10 lines in your changes missing coverage. Please review.

Project coverage is 69.56%. Comparing base (bedcb86) to head (6fb1933).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/ui/control/geolocate_control.ts 60.00% 10 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (bedcb86) and HEAD (6fb1933). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (bedcb86) HEAD (6fb1933)
9 8
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5437       +/-   ##
===========================================
- Coverage   91.94%   69.56%   -22.39%     
===========================================
  Files         282      282               
  Lines       39039    39058       +19     
  Branches     6849     1342     -5507     
===========================================
- Hits        35896    27170     -8726     
- Misses       3016    11246     +8230     
- Partials      127      642      +515     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@HarelM
Copy link
Collaborator

HarelM commented Jan 31, 2025

This looks a lot better, thanks!
Do you think the animation of the blue circle should also have a tilt like the accuracy circle?

@tricaric
Copy link
Author

tricaric commented Feb 1, 2025

Do you think the animation of the blue circle should also have a tilt like the accuracy circle?

I think that the central pulsating dot is good as it is, no need to tilt it.

@HarelM
Copy link
Collaborator

HarelM commented Feb 1, 2025

But it looks weird when tilting the map, doesn't it?

@tricaric
Copy link
Author

tricaric commented Feb 2, 2025

But it looks weird when tilting the map, doesn't it?

Yes in tilted maps, or in the globe when near the edge of the globe, it may appear as it's a bit off compared to the accuracy circle. I think that this could be a option of GeolocateControl, to have it as it is now, or to flatten it on the map like the accuracy circle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GeolocateControl marker shrinks when tilting and zooming map
2 participants