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

fix: [issue-2868] after enabling terrain, the _update marker method was not called #2996

Merged
merged 5 commits into from
Sep 6, 2023

Conversation

sebastianoscarlopez
Copy link
Contributor

@sebastianoscarlopez sebastianoscarlopez commented Aug 17, 2023

Fixes #2868.

We need to update the marker position after the terrain is loaded; when the map is fully loaded an idle event is fired.

image

So the approach was that after the terrain event is detected by the marker wait till an idle event is reached.

issue-2868.mp4

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.
  • Write tests for all new functionality.
  • Document any changes to public APIs.
  • Post benchmark scores.
  • Add an entry to CHANGELOG.md under the ## main section.

@codecov-commenter
Copy link

codecov-commenter commented Aug 17, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (998533e) 75.03% compared to head (a6c549c) 75.03%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2996   +/-   ##
=======================================
  Coverage   75.03%   75.03%           
=======================================
  Files         240      240           
  Lines       19127    19131    +4     
  Branches     4316     4318    +2     
=======================================
+ Hits        14351    14355    +4     
  Misses       4776     4776           
Files Changed Coverage Δ
src/ui/marker.ts 96.45% <100.00%> (+0.05%) ⬆️

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

@jashanbhullar
Copy link

I tested this, works fine on the turning terrain on and off but doesn't work on the first render of the map.

Screencast.from.20-08-23.09.22.32.AM.IST.webm

@sebastianoscarlopez
Copy link
Contributor Author

I tested this, works fine on the turning terrain on and off but doesn't work on the first render of the map.

Screencast.from.20-08-23.09.22.32.AM.IST.webm

Thanks @jashanbhullar good catch. I'll try to fix the first render.

@sebastianoscarlopez sebastianoscarlopez force-pushed the issue/2868 branch 3 times, most recently from 1d24746 to 601df9b Compare August 25, 2023 14:36
@sebastianoscarlopez
Copy link
Contributor Author

First sorry for delaying it, I had little spare time.
I think it's ready, it always works, even in the first renders.

@HarelM
Copy link
Collaborator

HarelM commented Aug 25, 2023

Great!! Can you add some tests to it? Maybe a browser integration test, or at least a unit test?

@sebastianoscarlopez sebastianoscarlopez force-pushed the issue/2868 branch 2 times, most recently from c91e184 to a7c28c2 Compare August 27, 2023 22:02
@sebastianoscarlopez sebastianoscarlopez changed the title fix: [issue-2869] after enabling terrain, the _update marker method was not called fix: [issue-2868] after enabling terrain, the _update marker method was not called Aug 27, 2023
@sebastianoscarlopez
Copy link
Contributor Author

integration browser test was added. If this test is run in the current main branch it will throw this error.

image

note: I needed to use the idle event, my assumption is that is okay to use it in the test.

@sebastianoscarlopez sebastianoscarlopez marked this pull request as ready for review August 30, 2023 02:38
@sebastianoscarlopez
Copy link
Contributor Author

Hi @HarelM, please let me know if this fix and its test code are good enough or how it can be improved.

@HarelM
Copy link
Collaborator

HarelM commented Sep 4, 2023

The code looks good, please add a change log entry, and a unit test if possible would be great so that the code in this class continues to be fully covered.

@sebastianoscarlopez sebastianoscarlopez force-pushed the issue/2868 branch 3 times, most recently from 1b85af8 to b85f674 Compare September 5, 2023 13:21
@sebastianoscarlopez
Copy link
Contributor Author

@HarelM please take a look at it.

@HarelM
Copy link
Collaborator

HarelM commented Sep 5, 2023

I did, the location of the changelog entry is still incorrect and should be placed above the 3.3.1 heading.

@sebastianoscarlopez
Copy link
Contributor Author

I did, the location of the changelog entry is still incorrect and should be placed above the 3.3.1 heading.

I'm so dumb 🤦

@HarelM
Copy link
Collaborator

HarelM commented Sep 5, 2023

Not sure why we keep this test, but there's a need to fix it. i.e. change the expected build size...

auto-merge was automatically disabled September 5, 2023 21:12

Head branch was pushed to by a user without write access

@HarelM HarelM enabled auto-merge (squash) September 6, 2023 01:57
auto-merge was automatically disabled September 6, 2023 06:01

Head branch was pushed to by a user without write access

@HarelM HarelM enabled auto-merge (squash) September 6, 2023 06:11
@HarelM HarelM merged commit 6ccf70c into maplibre:main Sep 6, 2023
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.

Marker displacement when switching between 2D and 3D view
4 participants