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

Possible to link a SVG library instead of a single svg icon #2404

Open
pelord opened this issue Dec 15, 2023 · 3 comments
Open

Possible to link a SVG library instead of a single svg icon #2404

pelord opened this issue Dec 15, 2023 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@pelord
Copy link

pelord commented Dec 15, 2023

Question

Is it possible, through IconLibrary
https://github.com/geostyler/geostyler/blob/main/src/Component/Symbolizer/IconSelector/IconSelector.tsx#L45

to use a complete library instead of using a single icon (svg)?

ex:

const iconLibraries = [{
  name: 'Google Font Icons',
  icons: [{
    src: '....../path/to/the/whole/library.svg',
  }]
}, [{
  name: 'Material design icons',
  icons: [{
    src: 'https://raw.githubusercontent.com/Templarian/MaterialDesign-Angular-Material/master/mdi.svg'
  }]
}];
@pelord pelord added the question Further information is requested label Dec 15, 2023
@pelord pelord changed the title Possible to link to a SVG library Possible to link a SVG library isnstead of a single svg icon Dec 15, 2023
@pelord pelord changed the title Possible to link a SVG library isnstead of a single svg icon Possible to link a SVG library instead of a single svg icon Dec 15, 2023
@alecarn
Copy link

alecarn commented Dec 15, 2023

Another question, is it possible to use the typographic ligature to render icon?
By example, if we use a set of icons via Google fonts <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined" rel="stylesheet" /> and we got all the icons names, is it something possible to render on the map?

@jansule
Copy link
Contributor

jansule commented Dec 15, 2023

Is it possible, through IconLibrary
https://github.com/geostyler/geostyler/blob/main/src/Component/Symbolizer/IconSelector/IconSelector.tsx#L45

to use a complete library instead of using a single icon (svg)?

Currently this is not possible, but this might actually be a useful feature. This is also slightly related to #2390 where we are thinking of adding a handling for spritesheets.

If you are planning on providing a PR for this, this would get a 👍 from my side.

Another question, is it possible to use the typographic ligature to render icon?

This should theoretically be possible via the <TextEditor>, as long as the font is installed in the browser and the <FontPicker> gets passed the related font name. Then, by adding the character for the related icon to the input field, the icon should be visible. Unfortunately, it is currently not possible to pass through fonts. I just created a ticket for this: #2405.

The downside of this approach, even if it is working, is that users need to know the actual character that represents the icon, as there would be no visual hints.

A PR implementing an approach for the iconLibrary to display font icons would also get a 👍 from my side.

@alecarn
Copy link

alecarn commented Dec 15, 2023

The downside of this approach, even if it is working, is that users need to know the actual character that represents the icon, as there would be no visual hints.

This depends on the implementation, for example if we have access to the name registers for the ligature feature of a specific icons set, we could have an IconSelector and the name logic would be hidden from an user perspective.

We will give a try to the TextEditor, thanks for you answer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants