Skip to content
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

Vertical alignment in format expression #5043

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

stanislawpuda-tomtom
Copy link

@stanislawpuda-tomtom stanislawpuda-tomtom commented Nov 13, 2024

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:

  • "baseline" default: text baseline or image bottom are in line - this is current behaviour.
  • "center": image center or text center are in line.
  • "top": image top and text top are in

How to run:

This code requires maplibre-style-spec with vertical align support. Checkout this PR maplibre/maplibre-style-spec#900, run npm run build and copy content from /dist to /node_modules/@maplibre/maplibre-gl-style-spec/dist.

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.js file contains current maplibre-gl-js version. We've changed export variable to maplibreglMain.
  • maplibre-gl-dev.js contains 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

  • 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.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality.
  • Document any changes to public APIs.
  • Post benchmark scores.
  • Add an entry to CHANGELOG.md under the ## main section.

Authors: @zbigniewmatysek-tomtom @stanislawpuda-tomtom

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.

2 participants