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

SVG support on ImageLayer? #4175

Open
Philip2809 opened this issue May 27, 2024 · 3 comments
Open

SVG support on ImageLayer? #4175

Philip2809 opened this issue May 27, 2024 · 3 comments
Labels
enhancement New feature or request PR is more than welcomed Extra attention is needed

Comments

@Philip2809
Copy link
Contributor

User Story & Rationale

As someone making indoor features with big buildings PNG floormaps can be really big and when using PNGs with sizes over 12k pixels the map comes to a halt. To fix this, the floormaps are in SVG format, could the map be made to support SVGs in the imageLayer?

Impact

This be benefit the users that need the ability to zoom in on a big image, on an SVG you could zoom in as much as you want, but on a PNG the image would start to become pixelated.

@Philip2809 Philip2809 changed the title SVG as ImageLayer? SVG support on ImageLayer? May 27, 2024
@HarelM
Copy link
Member

HarelM commented May 27, 2024

The image source is converting the image to non vector image in order to pass it to the GPU.
Supporting SVG in webgl seems like a huge lift and I'm not sure it's worth the effort.
I would advise to create a raster source, so that this image can be seen well in multiple zoom.
I think that the image source can play a role in converting an image to tiles and show the relevant tile in the relevant zoom, but that isn't exactly the same as SVG...
Another approach you can use is simply use an HTML element that shows a SVG on the map.

In any case, if you have a use case worth investing time and resources you are more than welcome to push it forward!

@HarelM HarelM added enhancement New feature or request PR is more than welcomed Extra attention is needed labels May 27, 2024
@Philip2809
Copy link
Contributor Author

I understand, thanks for answer.
Do you mean we have an SVG and render it to raster tiles with different zooms?
Can you get an HTML layer on the map with features there is today, if not I feel this can be very difficult to do, especially if you allow pitch, maybe this can be done with rotate3d and translate3d?

@HarelM
Copy link
Member

HarelM commented May 28, 2024

Not sure about pitch, html popup can be placed in a position and this position is translated when the map moves.
You might need other features to make it pitch and stretch, not sure.

Do you mean we have an SVG and render it to raster tiles with different zooms?

Yes, I think it's the "easiest" solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR is more than welcomed Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants