-
Notifications
You must be signed in to change notification settings - Fork 121
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
Added *-sort-key
support
#1060
base: main
Are you sure you want to change the base?
Added *-sort-key
support
#1060
Conversation
@ahocevar this failing test seems to be caused by a flakey test. I can get this to pass/fail locally by just running |
The test issue should have been fixed a few days ago. Maybe just rebase this pull request? |
This branch is all up to date and has the latest commit # git status | grep "On branch"
On branch feature/add-sort-key-support
# git log --oneline | grep 4d4aeaa
4d4aeaa Merge pull request #1050 from openlayers/dependabot/npm_and_yarn/html-webpack-plugin-5.5.4
# git push origin feature/add-sort-key-support
Everything up-to-date |
At first glance it looks to me like the tests fail correctly because this pull request breaks something. But I don't have time at the moment to give it a closer look. |
I see what's wrong. The current sort ( If I read the |
I'll have another proper look tomorrow @ahocevar. But FYI I still see flakiness with tests. I get passes/fails of the test suite on repeat runs without any changes # npm test
Chrome Headless 119.0.6045.105 (Linux x86_64): Executed 128 of 176 SUCCESS (2.07 secs / 1.928 secs)
TOTAL: 128 SUCCESS
=============================== Coverage summary ===============================
Statements : 62.41% ( 890/1426 )
Branches : 62.91% ( 570/906 )
Functions : 74.11% ( 126/170 )
Lines : 63.09% ( 865/1371 )
# echo $?
0 |
I think within the layer is working correctly, at least it should be will confirm tomorrow. The function uses a secondary index multiplied by a tiny number. export function calcSortIndex(index, sortIndex) {
// The `sortIndex` here is the index within the layer, we multiply that by
// a tiny number so we end up with a small offset within the current layers
// bounds
return index + (sortIndex === undefined ? 0 : sortIndex) * 0.00000000001;
} |
Using a different zIndex for every feature adds a significant performance penalty. Using the layer's |
Ok cool, will change over tomorrow. Regarding tests @ahocevar. I'm seeing some sort of odd object mutation thing (I think) this line seems to differ on some runs of the test suite, ol-mapbox-style/src/stylefunction.js Line 120 in bd5fe28
|
I'm currently reworking decluttering and z-index ordering in OpenLayers. Let's revisit when that is done. |
This PR implements the
*-sort-key
rules.Here is an example with the following layer rule, where
#ff0000
fills have a higher sort order that#0000ff
fills.Previously this resulted in
Now we get the correct result.