-
Notifications
You must be signed in to change notification settings - Fork 819
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
Width and height attributes on SVG symbols #2430
Comments
I ran into this problem as well, but didn't know about the solution. Thanks! I agree we should fix the icons on our side. |
They could be at least consistent, but it's not clear which form should we use until @nebulon42 tell us why he prefers %. |
I wanted to have full previews in Github for my Osmic repository and I wanted that the size can be controlled in Carto via attributes.
That seems to be correct as I found out. So I guess there is not really a reason left to not change it if it helps elsewhere. |
Go ahead then! |
SVG files contain several places where they have the width and height of the image. There is the
width
andheight
attributes as well as theviewBox
attribute on the<svg>
element. Some of the icons currently usewidth="100%"
andheight="100%"
(for instance bag-14.svg) in addition to having the "real" size on theviewBox
, some icons set a specific width (for instance tea-14.svg).The Mapnik rendering seems not to care about the
width
andheight
attributes, the icons all render fine, but the icons are often imported into the OSM wiki for documentation and Mediawiki doesn't handle them equally well. In the wiki icons with the100%
setting will appear as 512x512 pixel monsters unless the size is set explicitly. (I stumbled upon this in the context of the taglists). I think it would be easiest to change the icons at the source, ie this repository, instead of having to do something special for the wiki, unless there are some problems I am not seeing (@nebulon42 mentioned there are problems when I raised this on the talk mailinglist, but didn't elaborate).(And yes, it is somewhat strange that we need to import those icons into the wiki instead of using them directly etc. etc., but I am trying to fix one problem at a time here.)
I'd be willing to make the changes to the icons if there is some agreement here.
The text was updated successfully, but these errors were encountered: