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

Width and height attributes on SVG symbols #2430

Closed
joto opened this issue Nov 9, 2016 · 4 comments · Fixed by #2451
Closed

Width and height attributes on SVG symbols #2430

joto opened this issue Nov 9, 2016 · 4 comments · Fixed by #2451

Comments

@joto
Copy link
Contributor

joto commented Nov 9, 2016

SVG files contain several places where they have the width and height of the image. There is the width and height attributes as well as the viewBox attribute on the <svg> element. Some of the icons currently use width="100%" and height="100%" (for instance bag-14.svg) in addition to having the "real" size on the viewBox, some icons set a specific width (for instance tea-14.svg).

The Mapnik rendering seems not to care about the width and height 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 the 100% 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.

@matthijsmelissen
Copy link
Collaborator

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.

@kocio-pl
Copy link
Collaborator

They could be at least consistent, but it's not clear which form should we use until @nebulon42 tell us why he prefers %.

@nebulon42
Copy link
Contributor

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.

The Mapnik rendering seems not to care about the width and height 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.

@kocio-pl
Copy link
Collaborator

@joto

I'd be willing to make the changes to the icons if there is some agreement here.

Go ahead then!

nebulon42 added a commit to nebulon42/openstreetmap-carto that referenced this issue Nov 20, 2016
@nebulon42 nebulon42 assigned nebulon42 and unassigned joto Nov 20, 2016
sommerluk pushed a commit to sommerluk/openstreetmap-carto that referenced this issue Dec 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants