Opened 10 years ago
Last modified 10 years ago
#11980 closed defect
MapCSS: icon-width and icon-height are sometimes ignored if ~= is used — at Version 2
| Reported by: | Nakaner | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Core mappaint | Version: | tested |
| Keywords: | template_report, MapCSS, icon, icon size | Cc: |
Description (last modified by )
If I specify the icon size in a different rule than the icon itself and use the list operator (key~=value), nodes which match multiple rules get icons with doubled width and height. Following MapCSS has the bug. (The code is minimal working example based on OpenRailwayMap Maxspeed Style)
I have attached a ZIP file which contains a minimium working example (OSM file, MapCSS style, icons).
node["railway:signal:speed_limit_distant:form"=sign]["railway:signal:speed_limit_distant:speed"=~/^(3|4)0$/] { z-index: eval(95 + tag("railway:signal:speed_limit_distant:speed")/2); icon-width: 22; icon-height: 19; allow-overlap: true; } node["railway:signal:speed_limit_distant:form"=light]["railway:signal:speed_limit_distant:speed"=~/^(3|4)0$/] { z-index: eval(95 + tag("railway:signal:speed_limit_distant:speed")/2); icon-width: 14; icon-height: 19; allow-overlap: true; } node["railway:signal:speed_limit_distant:form"=sign]["railway:signal:speed_limit_distant:speed"=30] { icon-image: "icons/de/zs3v-30-sign-down-44.png"; } node["railway:signal:speed_limit_distant:form"=light]["railway:signal:speed_limit_distant:speed"~=30] { icon-image: "icons/de/zs3v-30-light-38.png"; } node["railway:signal:speed_limit_distant:form"=sign]["railway:signal:speed_limit_distant:speed"=40] { icon-image: "icons/de/zs3v-40-sign-down-44.png"; } node["railway:signal:speed_limit_distant:form"=light]["railway:signal:speed_limit_distant:speed"~=40] { icon-image: "icons/de/zs3v-40-light-38.png"; }
Repository Root: http://josm.openstreetmap.de/svn Build-Date: 2015-09-28 01:32:03 Last Changed Author: simon04 Revision: 8800 Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Relative URL: ^/trunk URL: http://josm.openstreetmap.de/svn/trunk Last Changed Date: 2015-09-27 22:11:06 +0200 (Sun, 27 Sep 2015) Last Changed Rev: 8800 Identification: JOSM/1.5 (8800 de) Linux Arch Linux Memory Usage: 339 MB / 1746 MB (162 MB allocated, but free) Java version: 1.7.0_85, Oracle Corporation, OpenJDK 64-Bit Server VM VM arguments: [-Djosm.restart=true] Plugins: - buildings_tools (31603) - reverter (31603) - utilsplugin2 (31603) Last errors/warnings: # These erorrs are not related to this maxspeed style which causes the problem. - W: Could not get presets icon museum.png - E: Fehler beim Laden des Bildes 'industrial.png' - W: Could not get presets icon industrial.png - E: Fehler beim Laden des Bildes 'gate.png' - W: Could not get presets icon gate.png
Change History (3)
by , 10 years ago
| Attachment: | mwe-different-iconsize.zip added |
|---|
comment:1 by , 10 years ago
If I modify the style, the icons are rendered with the correct size.
node["railway:signal:speed_limit_distant:form"=sign]["railway:signal:speed_limit_distant:speed"=~/^(3|4)0$/] { z-index: eval(95 + tag("railway:signal:speed_limit_distant:speed")/2); icon-width: 22; icon-height: 19; allow-overlap: true; } node["railway:signal:speed_limit_distant:form"=light]["railway:signal:speed_limit_distant:speed"=~/^(3|4)0$/] { z-index: eval(95 + tag("railway:signal:speed_limit_distant:speed")/2); icon-width: 14; icon-height: 19; allow-overlap: true; } node["railway:signal:speed_limit_distant:form"=sign]["railway:signal:speed_limit_distant:speed"=30] { icon-image: "icons/de/zs3v-30-sign-down-44.png"; } node["railway:signal:speed_limit_distant:form"=light]["railway:signal:speed_limit_distant:speed"~=30] { icon-image: "icons/de/zs3v-30-light-38.png"; icon-width: 14; icon-height: 19; } node["railway:signal:speed_limit_distant:form"=sign]["railway:signal:speed_limit_distant:speed"=40] { icon-image: "icons/de/zs3v-40-sign-down-44.png"; } node["railway:signal:speed_limit_distant:form"=light]["railway:signal:speed_limit_distant:speed"~=40] { icon-image: "icons/de/zs3v-40-light-38.png"; icon-width: 14; icon-height: 19; }
comment:2 by , 10 years ago
| Description: | modified (diff) |
|---|



minimum working example