Vertical alignment in format expression#5043
Merged
HarelM merged 55 commits intomaplibre:mainfrom Jan 28, 2025
Merged
Conversation
8 tasks
…into vertical-alignment-in-format-expression
…into vertical-alignment-in-format-expression
HarelM
reviewed
Jan 27, 2025
HarelM
reviewed
Jan 27, 2025
HarelM
reviewed
Jan 27, 2025
HarelM
reviewed
Jan 27, 2025
HarelM
reviewed
Jan 27, 2025
Collaborator
|
Added a few nitpicking, otherwise looks good, thanks! |
Contributor
Author
HarelM
reviewed
Jan 28, 2025
HarelM
reviewed
Jan 28, 2025
…into vertical-alignment-in-format-expression
HarelM
approved these changes
Jan 28, 2025
HarelM
reviewed
Jan 28, 2025
HarelM
reviewed
Jan 28, 2025
Collaborator
|
Did a last review and added a minor comment about the render test. |
8 tasks
ToHold
pushed a commit
to ToHold/maplibre-gl-js
that referenced
this pull request
Oct 31, 2025
* add support for `top` alingment * add support for "center" alignment * add comments * render tests * handle vertical text * cleanout * update top alignment * cleanout * refactor shaping * Fix vertical alignment * fix bbox size * adjust line spacing * vertical placement * cleanout * handle text offset * minor fix * const glyph height * align when no big image * use section.scale when multiplying on image * fix big image case * fix vertical * simplify imageOffset calculation * code simplification * improve readability * cleaning - removing dead code * fix only images case * cleaning + update render tests * bump maplibre-style-spec version * update bundle size * use style spec type * fix verticalAlign rendering tests * improve justifyLine readabilty * refactor getRectAndMetrics * use switch in getVerticalAlignFactor * split calculateLineContentSize fn to improve readability * Revert "split calculateLineContentSize fn to improve readability" This reverts commit b87ecdd. * clearing * improve calculateLineContentSize return type * move isVertical outside shaping fn * remove redundant imageName variable * small shapeLines code simplification * split shapeLines fn * fix lint * add tests for vertical align * fix lint in test file * move type definitions to the top of the file * simplify shapeLines adding sectionAttributes object * add return type to TaggedString.getMaxImageSize * add changelog * update render test files "baseline" -> "bottom" --------- Co-authored-by: Zbigniew Matysek <zbigniew.matysek@tomtom.com>
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Related to issue: maplibre-style-spec
This PR introduces implementation of vertical align property in format expression. It enables to specify how each section should be positioned in relation to biggest element in line. There are three possible options:
How to compare
To easily compare between current behaviour and new changes we build small comparison app. Please download
test.zip, unpack and run eg. with VSC Live Server extension.maplibre-gl-dev-MAIN.jsfile contains current maplibre-gl-js version. We've changed export variable tomaplibreglMain.maplibre-gl-dev.jscontains maplibre-gl-js with changes from this PR.Download test package:
test.zip
Visual comparison
Screen.Recording.2024-11-13.at.17.55.12.mov
Launch Checklist
CHANGELOG.mdunder the## mainsection.Authors: @zbigniewmatysek-tomtom @stanislawpuda-tomtom