[josm-dev] icons for MapCSS for RoadSigns

Jo winfixit at gmail.com
Wed Feb 18 09:56:13 UTC 2015


I thought adding a layer and a z-level would help:

/* Now render the traffic sign */
node|z16-[!(prop(traffic_sign_svg)="")]::traffic_signs
{
    z-index: 10;
    icon-image: eval(concat("data:image/svg+xml,<svg width='100px'
height='",prop(traffic_sign_top),"'>",prop(traffic_sign_svg),"</svg>"));
    icon-width: eval(max(12,prop(pixel_per_metre)));
}

It looks really funny, as the set of signs scales and the default style
doesn't.

But unfortunately it's not different from not adding those directives.

Jo

2015-02-18 9:07 GMT+01:00 Martin Vonwald <imagic.osm at gmail.com>:

> Hi!
>
> 2015-02-17 20:58 GMT+01:00 Jo <winfixit at gmail.com>:
>
>> It seems like I've started to do something which is impossible. Can't move
>> the png icons giving them an offset
>>
>
> There is a solution for this, but you probably don't want to know it:
> using JOSM and the style Lane and Road attributes open the area around
> http://www.openstreetmap.org/#map=17/47.94917/16.26273. (Note: a previous
> change in JOSMs standard style just broke the rendering, so its best to
> deactivate the standard to view it properly)
> You will find a node tagged with traffic_sign=maxspeed;overtaking and the
> appropriate rendering with two signposts on top of each other.
>
> This is done via embedded svg-images, which are created on-the-fly
> depending on the given tags. If you want to have a look at the specific
> code, search for "node|z16-[traffic_sign]". The variable "traffic_sign_svg"
> contains the svg image and "traffic_sign_top" the top of the next
> to-be-added signpost (and after processing all tags it is equal to the
> height of the overall image).
>
> Best regards,
> Martin
>
> P.S: Anybody know how to disable the new default traffic sign rendering of
> JOSM from within a style?
>
>


More information about the josm-dev mailing list