Opened 15 years ago
Last modified 5 years ago
#6129 new enhancement
[PATCH] have even more flexiblity in mapcss — at Version 3
| Reported by: | cmuelle8 | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Core mappaint | Version: | |
| Keywords: | Cc: |
Description (last modified by )
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.
Another nice thing would be a "osmc:symbol" decoder in ImageProvider, or directly in mappaint's node code..
Regards,
Christian
Change History (4)
by , 15 years ago
| Attachment: | mapcss-parent-props-in-descendant-selectors.patch added |
|---|
comment:1 by , 15 years ago
| Type: | defect → enhancement |
|---|



have more mapcss features..