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 encoding mismatch #22

Open
benmelz opened this issue Nov 27, 2023 · 0 comments
Open

SVG encoding mismatch #22

benmelz opened this issue Nov 27, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@benmelz
Copy link
Member

benmelz commented Nov 27, 2023

Introduced and missed in #17

So, vitejs/vite#14643 made it so that inlined SVGs are not base64 encoded when possible (sensible move, seems to save on space).

However, when ArcGIS is passed an inlined asset, in this file for example,

defaultSymbol: {type: 'picture-marker', url: squareParkingIcon, width: 12, height: 12},

it has some logic hardcoded that says "oh that's an SVG? cool I'm gonna rewrite that metadata myself, including a base64 marker". Meaning all of the non-encoded icons are marked as encoded and the browser can't load them.

The real solution would be for ArcGIS to... not do that. But I wouldn't hold my breath. I also don't see a "force base64" option for svgs in vite, so I'm thinking that the only practical solution is to forego inlining altogether (ugh).

The "when possible" mentioned earlier is actually "when there's no <text> element in the SVG", which is why the MA icon is still encoded and still works.

@benmelz benmelz added the bug Something isn't working label Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant