-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
setStyle updates text-variable-anchor
inconsistently
#8397
Comments
Note that passing |
@samanpwbb I can't reproduce the bug in the linked test case 🤔 changes are subtle, but if we disable the color change and bump the interval to 1000, labels are clearly updating: |
Yes, there are some subtle changes. I would expect label placement after a setStyle to be deterministic though. Right now, results of setStyle vary based on past label placement calculations. It appears as though once a given label finds a position that works, it will "prefer" that position in the future. Would it be possible to reset the "memory" of past positions after setStyle calls that effect |
text-variable-anchor
doesn't update after setStyletext-variable-anchor
inconsistently
The The problem (I think) stems from preferring previous placement in: mapbox-gl-js/src/symbol/placement.js Lines 342 to 350 in 2ce452d
If the previous placement anchor is not in the current set of |
@asheemmamoowala ah thanks for that reference. This would validate the experience of labels seeming to bias the current anchor, when the current anchor is among the list of selected anchors. However, I'm having trouble understanding why setting a single anchor for
|
Oops, just re-read it. Am I right in understanding that any anchor with a previous placement will always bias for that previous placement, even if it's no longer a favored placement? If so, that seems like unexpected behavior. |
That's correct, this behavior is a bug. The previous placement should only be preferred if the chosen anchor continues to be in the |
Closed by #8473 |
mapbox-gl-js version: 1.0.0
browser: any
Steps to Trigger Behavior
The result is that Studio cannot provide a realistic preview of the user's style as the user changes the
text-variable-anchor
value.Link to Demonstration
https://jsbin.com/riwasomula/1/edit?html,output
Expected Behavior
Expect label placement to change when preferred text anchor changes.
Actual Behavior
text placement does not change.
The text was updated successfully, but these errors were encountered: