<style> tags in SVG files are ignored #1099

Closed
evan-dickinson opened this Issue Jan 7, 2012 · 6 comments

3 participants

@evan-dickinson

So I made an SVG in Illustrator to use as a point file. The SVG has two colours, both shades of pink. But when I use it in TileMill, it shows up black. See this screen shot. The SVG file itself is here.

The SVG file shows up correctly in Chrome, Firefox, and Safari, so I don't think it's malformed. Note also, that the SVG file has a circle that's not displayed (its style is display:none), but the circle gets rendered in the map.

The carto style is:

#blossoms {
  point-allow-overlap: true;
  point-file: url(icons/single-blossom.svg);
}

I have tilemill version 0.8.0-natty3

@evan-dickinson

Also, I just noticed this entry in the TileMill log: notice: unhandled svg element: style.

If the SVG renderer isn't processing the SVG file's style tag, that would explain the problem. (But it would still be nice to have a fix.)

@evan-dickinson

P.S. -- The problem can be worked around by changing the SVG export options in Illustrator, so that the resulting SVG file styles the shapes with style attributes, instead of a global style tag.

@tmcw
Mapbox member

I summon @springmeyer - this is likely an issue only in Illustrator-style SVG, which (I think) deviates from 'spec' SVG.

@springmeyer
Mapbox member

Ya, this is a mapnik limitation - we've implemented no support for <style> tags. Not sure how feasible it would be without a deeper look.

@evan-dickinson - could you close this issue and move it over to an issue on the mapnik page? https://github.com/mapnik/mapnik/issues

@evan-dickinson

@springmeyer - the Mapnik issue is here: mapnik/mapnik#1024

@springmeyer
Mapbox member

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment