Skip to content

Conversation

@lucaswoj
Copy link
Contributor

@lucaswoj lucaswoj commented Apr 25, 2025

⚠️ Must be merged BEFORE maplibre/maplibre-gl-js#5812.

This PR updates the style specification and validation logic to allow the line-dasharray property to be data-driven, as part of resolving maplibre/maplibre-gl-js#1235.

Example usage:

"paint": {
  "line-dasharray": [
    "case",
    ["==", ["get", "road_type"], "trail"], ["literal", [1, 1]],
    ["==", ["get", "road_type"], "highway"], ["literal", [4, 2]],
    ["literal", [2, 2]]
  ]
}

Before PR Review

  • Set property-type of line-dasharray to cross-faded-data-driven
  • Fix test failures
  • Update docs to explain that, in practice, line-dasharray only works with literal expressions
  • 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.
  • Write tests for all new functionality.
  • Add an entry to CHANGELOG.md under the ## main section.

After PR Review

  • Set js version in data-driven styling

@lucaswoj lucaswoj closed this May 6, 2025
@lucaswoj lucaswoj deleted the data-drive-line-dasharray branch May 6, 2025 22:53
@HarelM
Copy link
Collaborator

HarelM commented May 7, 2025

Was this closed by mistake?

@lucaswoj
Copy link
Contributor Author

lucaswoj commented May 7, 2025

Looks like it was auto-closed because I changed the branch name. Will fix!

@lucaswoj lucaswoj restored the data-drive-line-dasharray branch May 7, 2025 18:05
@lucaswoj lucaswoj reopened this May 7, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jun 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ 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           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lucaswoj lucaswoj force-pushed the data-drive-line-dasharray branch from cdcc53d to e629f54 Compare June 28, 2025 19:14
@hbrooks-dsit
Copy link

@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?

@lucaswoj
Copy link
Contributor Author

lucaswoj commented Jul 17, 2025 via email

@lucaswoj
Copy link
Contributor Author

Woohoo! All render tests on maplibre/maplibre-gl-js#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."

@humutkazan
Copy link

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.

@birkskyum
Copy link
Member

@lucaswoj , how far is this PR? is it ready for review, or are there missing pieces to the validation logic still?

@lucaswoj lucaswoj marked this pull request as ready for review September 24, 2025 15:50
@lucaswoj
Copy link
Contributor Author

@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

@birkskyum birkskyum requested a review from HarelM September 24, 2025 15:55
@lucaswoj lucaswoj force-pushed the data-drive-line-dasharray branch from 55a2079 to 0131e0a Compare September 24, 2025 16:20
@HarelM
Copy link
Collaborator

HarelM commented Sep 25, 2025

This looks great! thanks!
I'll merge this and release a new version just after maplibre/maplibre-gl-js#5812 is approved to avoid creating an "invalid" maplibre-gl-js version.

@HarelM HarelM merged commit c3db60c into maplibre:main Sep 27, 2025
6 checks passed
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.

6 participants