wiki:Styles/IconTester

source:trunk/resources/images/apply.svg Icon tester

Description

The mappaint style "Icon tester" helps to test (GUI or mappaint) icons which may be added to JOSM.

You can use this mappaint style together with the default JOSM internal mappaint style.

For ideas/questions/bugs/suggestions or similar please write a message to Klumbumbus.

Usage

  • Add the path where you store your icons for testing in the preferences at the lower part of the Map Paint Styles register at "Icons paths:"
  • Activate this style
  • Add a node and tag it with "icon" as key and the file name of the icon as value (without extension). It automatically adds .svg as extension.
  • If you want to test png icons use the key "iconpng". However note that new icons in the JOSM core must be svg.
  • To test a new version of an icon you must first create the file with a new (not yet used) file name and then retag the node in JOSM. JOSM caches the icon so you cannot just override the file because it will not update within JOSM. So simply use e.g. tree1.svg, tree2.svg,... as file names and icon=tree1, icon=tree2,... as tags on nodes in JOSM.
  • To test different icon sizes add the tag width or height with the number of pixels as value. (The default value for the mapview in JOSM on non HiDPI screens is 16x16 pixels.)

More information about new icons see DevelopersGuide/DefaultPresets.

Code

meta {
    title: "Icon tester";
    version: "1.1.11_2021-05-15";
    description: "Helps to test new JOSM icons.";
    icon: "apply.svg";
    author: "Klumbumbus";
    link: "https://josm.openstreetmap.de/wiki/Styles/IconTester";
    /* min-josm-version: "???"; */ /* all JOSM versions except extremely old ones */
}

node[iconpng] {
    icon-image: eval(concat(tag(iconpng),".png"));
}

node[icon] {
    icon-image: eval(concat(tag(icon),".svg"));
}

node[width] {
    icon-width: tag(width);
}

node[height] {
    icon-height: tag(height);
}

Styles_IconTester-style.mapcss, Styles_IconTester.zip

Last modified 4 years ago Last modified on 2021-05-15T16:30:11+02:00
Note: See TracWiki for help on using the wiki.