maplibre-style-spec
maplibre-style-spec copied to clipboard
Allow data-driven styling for line-dasharray
⚠️ Must be merged BEFORE https://github.com/maplibre/maplibre-gl-js/pull/5812.
This PR updates the style specification and validation logic to allow the line-dasharray property to be data-driven, as part of resolving https://github.com/maplibre/maplibre-gl-js/issues/1235.
Example usage:
"paint": {
"line-dasharray": [
"case",
["==", ["get", "road_type"], "trail"], ["literal", [1, 1]],
["==", ["get", "road_type"], "highway"], ["literal", [4, 2]],
["literal", [2, 2]]
]
}
Launch Checklist
- [x] Set
property-typeofline-dasharraytocross-faded-data-driven - [ ] Fix test failures
- [ ] Set
jsversion indata-driven styling - [ ] Update docs to explain that, in practice,
line-dasharrayonly works withliteralexpressions - [x] Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
- [x] Briefly describe the changes in this PR.
- [x] 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.mdunder the## mainsection.
Was this closed by mistake?
Looks like it was auto-closed because I changed the branch name. Will fix!
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 95.33%. Comparing base (8dc8c06) to head (0131e0a).
Additional details and impacted files
@@ Coverage Diff @@
## main #1100 +/- ##
=======================================
Coverage 95.33% 95.33%
=======================================
Files 114 114
Lines 7401 7401
Branches 2245 2245
=======================================
Hits 7056 7056
Misses 345 345
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@lucaswoj , thanks for the work on this so far! I'm working on something that depends on this fix, so just wondering if you have a rough idea of when it might be released?
Thank you! I’m going to put in another block of work on the PR next week. It should then be ready to move into code review. After that, the timeline is largely out of my hands. Hopefully the maintainers are motivated to review, merge, and release this feature!
Woohoo! All render tests on https://github.com/maplibre/maplibre-gl-js/pull/5812 are now passing. I think there are a few edge cases that are broken but untested. However this is a big step closer to marking this "ready for review."
Thanks for all your hard work on this project! I’m also interested in this feature, as the commenter above mentioned. Is there anything blocking the merge that we could help with? I’m not very experienced in this area, but happy to assist if possible.
@lucaswoj , how far is this PR? is it ready for review, or are there missing pieces to the validation logic still?
@lucaswoj , how far is this PR? is it ready for review, or are there missing pieces to the validation logic still?
This PR is ready for review
This looks great! thanks! I'll merge this and release a new version just after https://github.com/maplibre/maplibre-gl-js/pull/5812 is approved to avoid creating an "invalid" maplibre-gl-js version.