Changes between Version 121 and Version 173 of Styles
- Timestamp:
- (multiple changes)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Styles
v121 v173 1 {{{2 #!comment3 The styles list moved to page StylesSource!4 }}}5 6 1 [[TranslatedPages]] 7 2 [[PageOutline(2-10,Table of Content)]] 3 8 4 = JOSM Map Styles = 9 [[Image(source:trunk/images/dialogs/mapstyle.png,middle,margin-right=20)]] 10 The JOSM [[Help/MapView|map display]] can be easily customized with different styles. Many styles are included with JOSM by default. 5 [[JOSMImage(dialogs/mapstyle,middle,margin-right=20,48,link=)]] The JOSM [wikitr:/Help/MapView map display] can be easily customized with different styles. Many styles are included with JOSM by default. 11 6 12 There are ''base styles'' (e.g. [source: trunk/styles/standard/elemstyles.mapcss JOSM standard] or [source:trunk/styles/standard/potlatch2.mapcssPotlatch 2]) that cover a wide range of features each. They can be combined with ''add-on styles'' that cover more special topics. See the[[#Availablestyleslist|available styles list]] below.7 There are ''base styles'' (e.g. [source:/trunk/resources/styles/standard/elemstyles.mapcss JOSM standard] or [wiki:/Styles/Potlatch2 Potlatch 2]) that cover a wide range of features each. They can be combined with ''add-on styles'' that cover more special topics. See the [#Availablestyleslist available styles list] below. 13 8 14 Further customization is possible via [ [#AdvancedPreferences|style options]] or by [[#CreateStyle|creating your own style]].9 Further customization is possible via [#AdvancedPreferences style options] or by [#CreateStyle creating your own style]. 15 10 16 11 == Choose styles ==#ChooseStyles 17 18 12 JOSM has ''three lists'' of ''map styles:'' available styles (all styles from the style repository) → active styles (your favourites) → ☑ chosen styles (actually used for the map painting). 19 13 20 14 JOSM comes with some styles being in the "active styles" list by default. You can choose styles from this list of "active styles" to be actually used for the map painting by clicking the check box (☑) at the desired style's line 21 * in the [ [Help/Dialog/MapPaint|map paint style dialog]] or22 * in the [ [Help/Menu/View|"View" menu]] ( → "Map paint styles") or23 * (less comfortable)in the Map Paint Styles Preferences (see section below)15 * in the [wikitr:/Help/Dialog/MapPaint map paint style dialog] or 16 * in the [wikitr:/Help/Menu/View "View" menu] ( → "Map paint styles") or 17 * in the Map Paint Styles Preferences (see section below) 24 18 25 19 Note that, unless you are working with add-on styles, likely you want to have only one style ☑ checked at a time. 26 20 27 21 === Activating more styles === 28 [[Image(addstyle.gif, right, 250px, title=animation of how to activate and choose an example style)]] 22 ''Instructions:'' 29 23 30 ''Instructions:'' 31 1. open the [Help/Preferences/Map#MapPaintStyles Map Paint Styles Preferences] by either 32 * clicking the [[Image(source:trunk/images/dialogs/mappaintpreference.png)]] [[Help/Dialog/MapPaint#MapStyleSettings|Settings]] button in the map style dialog (shown in the animation) or 33 * via [[Help/Menu/View|"View" menu]] → "Map paint styles" → "Map paint preferences" or 34 * (less comfortable) via the general preferences window ([[Help/Menu/Edit|Menu Edit]] → [[Help/Action/Preferences|Preferences]] → [[Image(source:trunk/images/preferences/map.png,15)]] [[Help/Preferences/Map|Map Settings]] (3rd button on the left) → Map Paint Styles (2nd tab)) 35 2. select a style in the list of "available styles" (left side) 36 3. activate it by clicking the [[Image(source:trunk/images/preferences/activate-right.png)]] blue right arrow button (in the centre) 37 4. exit and confirm by clicking the OK button 24 1. Open the [wikitr:/Help/Preferences/MapPaintPreference Map Paint Styles preferences] 25 * via the header of the Map Paint Styles panel with the [[JOSMImage(dialogs/mappaintpreference)]] [wikitr:/Help/Dialog/MapPaint#MapStyleSettings Preferences] button or [[Image(addstyle.gif,right,250px,title=animation of how to activate and choose an example style,margin=10,link=)]] 26 * via [wikitr:/Help/Menu/View View menu] → ''Map paint styles'' → ''Map paint preferences'' or 27 * via the general preferences dialog [wikitr:/Help/Menu/Edit Menu Edit] → [wikitr:/Help/Action/Preferences Preferences] → [[JOSMImage(dialogs/mapstyle,24,middle,link=)]] [wikitr:/Help/Preferences/MapPaintPreference Map Paint Styles] 28 1. Choose a style in the list of ''Available styles'' (left side) 29 1. Activate it by clicking the [[JOSMImage(preferences/activate-right)]] blue right arrow button between the lists. 30 1. Exit and confirm by clicking the OK button 38 31 39 ''Example:'' Let's assume that you want to add [osmwiki:Key:maxspeed maxspeed=*] tags to OSM, then you probably will make use of the style [wiki :Styles/Maxspeed Maxspeed] (which displays the value of maxspeed on roads with different colors). The screencast/animation on the right side (click to enlarge) shows how to add this style to your list of "active styles".32 ''Example:'' Let's assume that you want to add [osmwiki:Key:maxspeed maxspeed=*] tags to OSM, then you probably will make use of the style [wikitr:/Styles/Maxspeed Maxspeed] (which displays the value of maxspeed on roads with different colors). The screencast/animation on the right side (click to enlarge) shows how to add this style to your list of "active styles". 40 33 41 34 ==== Adding own styles ==== 42 You can add own styles (from any URL/file) to the list of active styles – for example a style file which you have [[#CreateStyle|created yourself]]. Just click the [[Image(source:trunk/images/dialogs/add.png)]] plus sign on the right and enter either path and filename or URL of your style file. 35 You can add own styles (from any URL/file) to the list of active styles – for example a style file which you have [#CreateStyle created yourself]. Just click the [[JOSMImage(dialogs/add)]] plus sign on the right and enter either path and filename or URL of your style file. 36 43 37 44 38 == Available styles list == 39 [[Styles(en|styles|short description|author|description|version|More details)]] 45 40 46 [[Styles(en|styles|short description|author|description|version|More details)]]47 41 48 42 == Create your own style ==#CreateStyle 49 43 You don't like the standard style? Change it to your own liking: 50 44 51 * In the [ [Help/Dialog/MapPaint|map paint style dialog]], right click one of the styles and select [[Image(source:/trunk/images/copy.png)]]"save as...". A copy will be added to the list of styles. You can open the file in a text editor and reload after doing some changes.45 * In the [wikitr:/Help/Dialog/MapPaint map paint style dialog], right click one of the styles and select [[JOSMImage(copy,middle,24,link=)]] "save as...". A copy will be added to the list of styles. You can open the file in a text editor and reload after doing some changes. 52 46 * Or create a style from scratch and add it in the JOSM mappaint preferences. 53 47 54 JOSM supports two formats to define a style: 55 56 JOSM XML:: 57 The previously traditional style format in JOSM (still functional). The [[Styles/LegacyStandard|old standard style]] contains some documentation. 58 MapCSS:: 59 Style language similar to [https://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] originally developed for Potlatch 2, but aims to be a standard for map styles. 48 JOSM supports styles in the MapCSS format. It is a style language similar to [https://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] originally developed for Potlatch 2. 60 49 * General information can be found in the [osmwiki:Category:MapCSS osm wiki]. 61 * A [[Help/Styles/MapCSSTutorial|Short tutorial]] should get you started. 62 * The [[Help/Styles/MapCSSImplementation|JOSM implementation reference]] lists the supported features in more detail. 63 64 Style files with different formats are compatible, they can be loaded at the same time. 50 * A [wikitr:/Help/Styles/MapCSSTutorial Short tutorial] should get you started. 51 * The [wikitr:/Help/Styles/MapCSSImplementation JOSM implementation reference] lists the supported features in more detail. 65 52 66 53 == Make your style available to other users == 67 * Either edit the page StylesSource and add URLs for new style files to the list at the top … 68 * **Note**: Only URLs with file-extension (e.g. *.mapcss, *.xml, *.zip, *.php) are supported. 69 * … or create a wiki page similar to [[Styles/LegacyStandard]] (XML) or [[Styles/Modified]] (MapCSS). 70 * for automatic version adjustment you should use two internal variables: 71 * {{{[[revision]]}}} - is the latest version number of the wiki page 72 * {{{[[date]]}}} - is the date of the last edit 73 * e.g. {{{"1.[[revision]]_[[date]]"}}} converts to e.g. {{{1.13_2014-02-24}}} 74 * **Note**: Spam filter prohibits adding many external (icon) links. Please, if possible, attach icons to the wiki page ([#Iconhandling see below]). 75 In both cases, the new style will be automatically listed in the table above after a few minutes. Then it will also be available in the JOSM mappaint preferences (after clicking the reload button). 54 * Either create a wiki page similar to [wiki:Styles/Modified]. 55 I. go to [wiki:Styles/MyStyleName https://josm.openstreetmap.de/wiki/Styles/MyStyleName] 56 A. change the URL so it matches the name of your style; change only the last part after `...Styles/`, (preferred is CamelCase) 57 a. press `Enter` after adjusting the name 58 1. don't forget to enclose your mappaint code by a code block (`#!style type="mapcss"` needs to be on a **new line** after `{{{`): 59 {{{ 60 {{{ 61 #!style type="mapcss"` 62 … 63 }}} 64 }}} 65 1. for automatic version adjustment you have to use `[[revision]]_[[date]]` in your version variable: 66 * `[[revision]]` - is the latest version number of the wiki page 67 * `[[date]]` - is the date of the last edit of the wiki page 68 * recommended usage: `version="1.[[revision]]_[[date]]"` (converts to e.g. `1.13_2019-02-24`) 69 * this is required for an automatic update within JOSM 70 * **Note**: Spam filter prohibits adding many external (icon) links. Please, if possible, attach icons to the wiki page ([#Iconhandling see below]). … 71 * '''or''' edit the page StylesSource and add URLs for new style files to the list at the top. (JOSM wiki based Styles (see above) is the preferred method.) 72 * **Note**: Only URLs with file-extension (e.g. *.mapcss, *.zip, *.php) are supported. 73 In both cases, the new style will be automatically listed in the table above after a few minutes. Then it will also be available in the JOSM mappaint preferences (after clicking the reload button). \\ 74 **Note**: The [/jenkins/job/JOSM-Integration/ JOSM-Integration test] will run on all styles and report problems. 76 75 77 == Icons 78 .png and .svgfiles are supported.76 == Icons ==#Icons 77 `.png` and `.svg` files are supported. See [wikitr:/DevelopersGuide/DefaultPresets#NewIcons Defaultpresets New Icons] for details and problems with `.svg` 79 78 80 === Icon handling === 79 === Icon testing === 80 Icons can be tested with the [wikitr:/Styles/IconTester icon tester]. 81 82 === Icon handling === #Iconhandling 81 83 There are different forms to handle icons: 82 84 83 * Icons distributed with JOSM can be entered directly with the path (relative to JOSM's internal image directory). 84 * Use a path relative to your local style file. 85 * New icons can be directly referenced using a http-link. These are downloaded and cached internally. 86 * Since JOSM revision [/changeset/2289/josm 2289] zip files are supported. 87 * The zip file must contain at least one file with extension xml (or mapcss). 85 * Icons distributed with JOSM can be entered directly with the path (relative to JOSM's [source:/trunk/resources/images internal image directory]). 86 * Use a path relative to your local style file. (This works only for Styles, not for Presets.) 87 * Use a path relative to a directory specified at the bottom in the [wikitr:/Help/Preferences/MapPaintPreference Map Paint Styles preferences] or [wikitr:/Help/Preferences/TaggingPresetPreference Tagging Presets preferences].) 88 * New icons can be directly referenced using a https- or http-link. These are downloaded and cached internally. 89 * zip files are supported too. 90 * The zip file must contain at least one file with extension mapcss (for styles) or xml (for presets). 88 91 * Icon names and path are relative to the topmost zip directory. 89 * If there are multiple XMLfiles, a file with "style" in the name is preferred (to allow packaging styles and presets in one archive).90 * Since JOSM revision [/changeset/4713/josm 4713] inline encoding as described in [[http://tools.ietf.org/html/rfc2397|RFC 2397]] is supported.91 * Example for PNG: {{{data:image/png;base64,...databytes...}}}92 * Example for SVG: {{{data:image/svg+xml;base64,...databytes...}}}93 * [wiki :Help/Base64 More information] about{{{data:image/...}}}in JOSM.94 * When the JOSM wiki is used for designing of new styles you have some additional options: 92 * If there are multiple files, a file with "style" in the name is preferred (to allow packaging styles and presets in one archive). 93 * Inline encoding as described in [https://tools.ietf.org/html/rfc2397 RFC 2397] is supported too. 94 * Example for PNG: `data:image/png;base64,...databytes...` 95 * Example for SVG: `data:image/svg+xml;base64,...databytes...` 96 * [wikitr:/Help/Base64 More information] about `data:image/...` in JOSM. 97 * When the JOSM wiki is used for designing of new styles or presets you have some additional options: 95 98 * Each file attached to the wiki page is automatically included in the zip file downloaded by JOSM. 96 99 * If you don't want a file in the zip file, add the text **(NOZIP)** in the description of the attachment. 97 100 * If you add a zip file and want its contents included, you may add **(EXTRACT)** in the description of the attachment. 98 * The server automatically switches from download of single file to zip download when files are attached.101 * Empty image paths are not allowed. 99 102 103 == Translation == 104 Styles, Rules, Presets and Plugins use the same translation mechanism as JOSM core. The files must be delivered as Zip and contain a directory called `data` with the .lang files. 105 To create these files there exist scripts in the SVN directory [source:osm/applications/editors/josm/i18n/ i18n]. 106 See also [wikitr:/Translations#Software software translation section] in translation documentation. 107 108 == Updating styles in JOSM == 109 Once a style was updated in the wiki (or another external source) it takes up to 10 days until the style gets updated in JOSM automatically (#8933). To immediately force an update you can do the following steps: 110 * Open the [wikitr:/Help/Action/Preferences Preferences] 111 * Make sure [wikitr:/Help/ExpertMode Expert mode] is enabled 112 * Open the [wikitr:/Help/Preferences/Advanced Advanced Preferences] 113 * Search for keys starting with: `mirror.https://josm.openstreetmap.de/josmfile?page_Styles/` (or `mirror.` for other external sources) 114 * Select the style you want to update 115 * Click on Reset at the bottom of the window 116 * Click on OK to save the changes (and to close the preference window) 117 * Restart JOSM 118 119 or: 120 121 * Remove the content of your [wikitr:/Help/Action/About#InstallationDetails <josm.cache>] folder 122 * Restart JOSM 123 124 To check the version of the style in JOSM do the following steps 125 * Open the [wikitr:/Help/Dialog/MapPaint Map Paint Styles Dialog] 126 * Right click on a style 127 * Choose Info 128 * Click on Source Tab 129 * Search for `version:` at the beginning of the source code 100 130 101 131 == Styles managed in JOSM wiki == … … 104 134 105 135 == Rendering == 106 Mappaint renders the map data so it looks much more like a map (colors, icons, annotations, ...) - compared to the JOSM wireframemode.136 Mappaint renders the map data so it looks much more like a map (colors, icons, annotations, ...) - compared to the JOSM Wireframe view. 107 137 108 138 === Nodes === 109 Most nodes that correspond to tags in the [osmwiki:Map_Features Map Features] page will show an appropriate icon, e.g. a white "P" on blue ground for {{{amenity=parking}}}.139 Most nodes that correspond to tags in the [osmwiki:Map_Features Map Features] page will show an appropriate icon, e.g. a white "P" on blue ground for `amenity=parking`. 110 140 111 141 There are some special icons for missing/incomplete things: 112 142 113 [[Image(Mappaint_no_icon.png)]] missing icon [[br]]114 We don't have the right icon for every node tag in map features yet, e.g. icons for most {{{natural=*}}}tags are still missing. If you encounter such a "missing icon", feel free to create a nice 16*16 pixel icon that matches the tag. To submit your work, open a [/newticket new ticket] and add your image or zip archive as attachment.143 [[Image(Mappaint_no_icon.png,margin-right=5,link=)]] missing icon \\ 144 We don't have the right icon for every node tag in map features yet, e.g. icons for most `natural=*` tags are still missing. If you encounter such a "missing icon", feel free to create a nice 16*16 pixel icon that matches the tag. To submit your work, open a [/newticket new ticket] and add your image or zip archive as attachment. 115 145 116 [[Image(Mappaint_deprecated.png)]] warning icon [[br]]117 The corresponding tag was once used but is no longer recommended to be used - or - it is not suitable for a node, e.g. {{{highway=motorway}}}just doesn't make sense on a node. Probably not all deprecated tags will show this icon.146 [[Image(Mappaint_deprecated.png,margin-right=5,link=)]] warning icon \\ 147 The corresponding tag was once used but is no longer recommended to be used - or - it is not suitable for a node, e.g. `highway=motorway` just doesn't make sense on a node. Probably not all deprecated tags will show this icon. 118 148 119 149 === Ways === … … 124 154 125 155 126 == Advanced Preferences == 127 Some styles may have options. They are available via a right click (context menu) on the style's entry inside the [ [Help/Dialog/MapPaint|map paint style dialog]] window. E.g. JOSM's current default map style (MapCSS) has the option to display nodes at low zoom levels "less obtrusive" (enabled by default).156 == Advanced Preferences ==#AdvancedPreferences 157 Some styles may have options. They are available via a right click (context menu) on the style's entry inside the [wikitr:/Help/Dialog/MapPaint map paint style dialog] window. E.g. JOSM's current default map style (MapCSS) has the option to display nodes at low zoom levels "less obtrusive" (enabled by default). 128 158 129 159 In addition, you can use the following hidden preferences: 130 * {{{mappaint.fillalpha}}}160 * `mappaint.fillalpha` 131 161 * alpha "opacity level", that is used to fill areas. An integer value between 0 (transparent) and 255 (solid) with the default of 50. 132 * {{{mappaint.fillareas}}}(show areas)162 * `mappaint.fillareas` (show areas) 133 163 * 10000000 (default) - areas will be filled with their corresponding colour and name will be rendered 134 164 * 0 - areas will be surrounded by lines only and name will not be rendered 135 165 * any other number - areas will be filled with their corresponding colour and name will be rendered at any zoom level below the given number in meters 136 * {{{mappaint.showicons}}}137 * select whether icons are shown - same values as {{{mappaint.fillareas}}}138 * {{{mappaint.shownames}}}139 * select whether names are shown - same values as {{{mappaint.fillareas}}}140 * {{{mappaint.strokes}}}141 * select whether strokes or full lines are used - same values as {{{mappaint.fillareas}}}142 * {{{mappaint.useRealWidth}}}143 * true - ways will change width corresponding to the real width in meters set in the elemstyle.xml file 144 * false (default) - ways will have the same width on every zoom level 145 * {{{mappaint.zoomLevelDisplay}}}166 * `mappaint.showicons` 167 * select whether icons are shown - same values as `mappaint.fillareas` 168 * `mappaint.shownames` 169 * select whether names are shown - same values as `mappaint.fillareas` 170 * `mappaint.strokes` 171 * select whether strokes or full lines are used - same values as `mappaint.fillareas` 172 * ~~`mappaint.useRealWidth`~~ 173 * ~~true - ways will change width corresponding to the real width in meters set in the elemstyle.xml file~~ 174 * ~~false (default) - ways will have the same width on every zoom level~~ 175 * `mappaint.zoomLevelDisplay` 146 176 * true - elements visibility depends on zoom level 147 177 * false (default) - all elements are displayed 148 * {{{mappaint.fontsize}}}178 * `mappaint.fontsize` 149 179 * size of mappaint texts (default=8) 150 180 151 181 ---- 152 Back to [wiki:/Help main help]182 Back to [wikitr:/Help Main Help]