﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
6129	(PATCH needs rework) have even more flexiblity in mapcss	cmuelle8	team	"Hi,

I wondered why the follow mapcss was not working:


{{{
relation[type=route][wiki:symbol] > way
{
    wicon: get_tag_value(""wiki:symbol"");
    is-cycle-route: true;
}

way[eval(prop(is-cycle-route))] > node
{
    icon-image: eval(concat(SOMEURL, prop(""wicon"")));
}
}}}

If we have descendant selectors, the trouble is, that the parents Environment is created from scratch.  The patch attached hashes the environment in ElemStyles and makes it possible to question the proper environment of the parent when descendant selectors (+cond) are used.  Moreover I put some patches into Expression to make it possible to query the parents environment in the childs rules.  So the following works:


{{{
relation[type=route][wiki:symbol] > way
{
    icon: get_tag_value(""parent.wiki:symbol"");
    is-cycle-route: true;
}

way[eval(prop(is-cycle-route))] > node
{
    icon-image: eval(concat(SOMEURL, prop(""parent.icon"")));
}
}}}

With ""parent."" we can reference the environment of the parent in the descendant selector.  This makes it possible to extract symbols out of relations and style the nodes accordingly.

Currently I'm missing a way to find out the correct URL of a wp commons image if I just have the filename  (as is tagged on some relations with wiki:symbol).  The idea is to add yet another function to Expression class that is able to find out the right url for us, maybe find_wiki_symbol(filename)..   So ATM it works only if you build the URL yourself (with concat) or if the whole URL is supplied in the primitive's tag.[[BR]]
[[BR]]
Another nice thing would be a ""osmc:symbol"" decoder in ImageProvider, or directly in mappaint's node code..



Regards,
Christian
"	enhancement	new	normal		Core				
