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

Add getLayersOrder() to Map and Style #3279

Merged
merged 4 commits into from
Oct 31, 2023
Merged

Conversation

neodescis
Copy link
Collaborator

@neodescis neodescis commented Oct 28, 2023

Launch Checklist

Closes #3277. Adds a getter for Style's _order "private" property to Style and Map.

  • 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 Oct 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (838bb63) 75.23% compared to head (0b89dea) 75.45%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3279      +/-   ##
==========================================
+ Coverage   75.23%   75.45%   +0.21%     
==========================================
  Files         241      241              
  Lines       19256    19260       +4     
  Branches     4339     4339              
==========================================
+ Hits        14488    14532      +44     
+ Misses       4768     4728      -40     
Files Coverage Δ
src/style/style.ts 84.25% <100.00%> (+0.42%) ⬆️
src/ui/map.ts 83.27% <100.00%> (+0.04%) ⬆️

... and 3 files with indirect coverage changes

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

src/ui/map.ts Show resolved Hide resolved
@HarelM
Copy link
Collaborator

HarelM commented Oct 29, 2023

Mainly nit picking.
Any reason you can think of why this shouldn't be added to the API?
Is there a different workaround with existing API calls? maybe serialize?

@neodescis
Copy link
Collaborator Author

neodescis commented Oct 29, 2023

Mainly nit picking. Any reason you can think of why this shouldn't be added to the API? Is there a different workaround with existing API calls? maybe serialize?

See the linked issue I filed. I was originally using getStyle(), but it explicitly excludes "custom" layers. As far as I can tell, there is no other way to get the full order, custom layers included.

Also, FWIW, there is a similar issue filed in mapbox. The suggestion there was to use _order directly, but that felt wrong.

@neodescis neodescis requested a review from HarelM October 30, 2023 21:14
@HarelM HarelM merged commit 381b1de into maplibre:main Oct 31, 2023
14 checks passed
@neodescis
Copy link
Collaborator Author

Thank you @HarelM !

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.

Need better way to get current layer order
3 participants