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

styler: QML upload, base64 encoded SVG icons #5008

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open

Conversation

FilipLeitner
Copy link
Collaborator

@FilipLeitner FilipLeitner commented Jun 18, 2024

Description

Allow usage of base64 encoded SVG icons provided via QML*
*expected to include data type in source attribute of options and prop element

Related issues or pull requests

closes #4996

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Dependency updates
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe)
  • I am unsure (we'll look into it together)

Do you introduce a breaking change?

  • Yes
  • No
  • I am unsure (no worries, we'll find out)

Checklist

  • I understand and agree that the changes in this PR will be licensed under the [MIT License]
  • I have followed the guidelines for contributing
  • The proposed change fits to the content of the code of conduct
  • I have added or updated tests and documentation, and the test suite passes (run npm test locally)
  • I'm lost; why do I have to check so many boxes? Please help!

this.qml = styleString;
this.qml = styleString.replace(
/base64:/g,
'data:image/svg+xml;base64,',
Copy link
Collaborator Author

@FilipLeitner FilipLeitner Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to be fixed. Its not right to assume all base64 would be SVG icon.

  • we should problably do this for SLDs as well

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QMLs will include source attribute on both Option (new fromat) and prop (necessary backwards comaptiblity) elements containing base64. It can be then used to adjust the value as needed.

For now we will parse via prop as Geostyler still takes the value from that attribute. See 02e923f

Move base64 icon fix to separate function and file
@FilipLeitner FilipLeitner marked this pull request as ready for review June 24, 2024 12:04
FilipLeitner and others added 2 commits June 25, 2024 08:20
Apply suggestions from code review

Co-authored-by: jmacura <jmacura@users.noreply.github.com>
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.

SVG symbols in WFS
2 participants