-
-
Notifications
You must be signed in to change notification settings - Fork 780
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
Using text-translate in symbol paint doesn't update collision boxes #210
Comments
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This bug still exists and the issue should stay open. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. |
Wasn't there something related in the terrain3d pull request? @timsluis would you be interested in fixing this? |
Reopening. The collision box logic is not great in general... |
I think I might have fixed this, see #3456 |
@kubapelc thanks for looking into this and sharing your work. I tested it with http://kvaleya.gitlab.io/maplibre/aligndemo2/maplibre-gl-dev.js. Unfortunately the labels all move into the top left corner of the canvas: These are my layout and paint settings: (I removed some text formatting and styling that I think doesn't influence the position – e.g. text-size, text-font, text-field, text-opacity) {
layout: {
'text-variable-anchor': ['left', 'right', 'bottom', 'top'],
'text-radial-offset': 1.25,
'text-optional': true,
'text-overlap': 'cooperative'
},
paint: {
'text-translate': ["interpolate", ["linear", 1],
["zoom"], 8, ["literal", [-2, -1.7]], 17, ["literal", [-20, -17]],
],
}
} |
@mrflix thank you for the layout settings, I'll use them for testing. It seems that variable anchors don't work at all in my branch. I'll try to fix it. Symbols without variable anchors should work though. |
@mrflix Hi, is the bug still present if you use the maplibre build from https://kvaleya.gitlab.io/maplibre/aligndemo3/combineddemo.html ? I had a bug in text-variable-anchor handling that was causing the symbols to be placed in the top left corner, it should now be fixed. |
@kubapelc the click areas seem to be correct now but the text is placed incorrectly: |
@mrflix I fixed another bug with |
I've (hopefully) finished adapting symbols for globe, see the PR mention, and now I'm fairly confident that most reasonable combinations of text, icon, MapLibre build used in globe demo (different build than what is linked in the previous comment). |
When adding a
text-translate
property to a layer the collision boxes won't move together with the labels. Also click and hovers are registered on the original place of the label before the translate.maplibre-gl-js version: 1.15.2
browser: Chrome 91
Steps to Trigger Behavior
text-translate
on the paint property of a layerLink to Demonstration
See: https://codepen.io/timsluis/pen/qBmRYQM
Expected Behavior
Collision boxes are updated.
Actual Behavior
Collision boxes are not updated and labels flow over each other.
The text was updated successfully, but these errors were encountered: