| 28 | | To add more styles to your list of "active styles" |
| 29 | | 1. open the [Help/Preferences/Map#MapPaintStyles Map Paint Styles Preferences] by either |
| 30 | | * clicking the [[Image(source:trunk/images/dialogs/mappaintpreference.png)]] [[Help/Dialog/MapPaint#MapStyleSettings|Settings]] button in the map style dialog or |
| 31 | | * via [[Help/Menu/View|"View" menu]] → "Map paint styles" → "Map paint preferences" or |
| 32 | | * (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)) |
| 33 | | 2. select a style in the (left) list of "available styles" |
| 34 | | 3. activate it by clicking the [[Image(source:trunk/images/preferences/activate-right.png)]] blue right arrow button in the centre |
| 35 | | 4. exit and confirm by clicking the OK button |
| | 22 | ''Instructions:'' |
| 37 | | Examples: |
| 38 | | * [https://help.openstreetmap.org/upfiles/josmmapstyles-selectold.png Screenshot showing how to activate the old (XML) JOSM default style] |
| 39 | | * Let's assume that you're interested in sea maps, then you probably will make use of the style "SeaMap FreieTonne": Just highlight this entry in the "Available Styles" list by clicking on it and press the [[Image(source:trunk/images/preferences/activate-right.png)]] blue right arrow button in the centre. Now it should be one of your "Active Styles". To actually use it you now need to choose it (check box ☑). |
| | 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 |
| | 31 | |
| | 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". |
| 67 | | * Either edit [[StylesSource|this wiki page]] 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 can use two internal variables ({{{"1.[[revision]]_[[date]]" --> 1.13_2011-02-24}}}): |
| 71 | | 1. {{{[[revision]]}}} - is the latest version number of the wiki page |
| 72 | | 1. {{{[[date]]}}} - is the date of the last edit |
| 73 | | * **Note**: Spam filter prohibits adding many external (icon) links. Please, if possible, attach icons to the wiki page ([#Iconhandling see below]). |
| 74 | | 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. |
| 82 | | * Icons distributed with JOSM can be entered directly with the path (relative to JOSM's internal image directory). |
| 83 | | * Use a path relative to your local style file. |
| 84 | | * New icons can be directly referenced using a http-link. These are downloaded and cached internally. |
| 85 | | * Since JOSM revision [/changeset/2289/josm 2289] zip files are supported. |
| 86 | | * The zip file must contain at least one file with extension xml (or mapcss). |
| | 87 | * Icons distributed with JOSM can be entered directly with the path (relative to JOSM's [source:/trunk/resources/images internal image directory]). |
| | 88 | * Use a path relative to your local style file. (This works only for Styles, not for Presets.) |
| | 89 | * 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].) |
| | 90 | * New icons can be directly referenced using a https- or http-link. These are downloaded and cached internally. |
| | 91 | * zip files are supported too. |
| | 92 | * The zip file must contain at least one file with extension mapcss (for styles) or xml (for presets). |
| 88 | | * If there are multiple XML files, a file with "style" in the name is preferred (to allow packaging styles and presets in one archive). |
| 89 | | * Since JOSM revision [/changeset/4713/josm 4713] inline encoding as described in [[http://tools.ietf.org/html/rfc2397|RFC 2397]] is supported. |
| 90 | | * Example for PNG: {{{data:image/png;base64,...databytes...}}} |
| 91 | | * Example for SVG: {{{data:image/svg+xml;base64,...databytes...}}} |
| 92 | | * [wiki:Help/Base64 More information] about {{{data:image/...}}} in JOSM. |
| 93 | | * When the JOSM wiki is used for designing of new styles you have some additional options: |
| | 94 | * If there are multiple files, a file with "style" in the name is preferred (to allow packaging styles and presets in one archive). |
| | 95 | * Inline encoding as described in [https://tools.ietf.org/html/rfc2397 RFC 2397] is supported too. |
| | 96 | * Example for PNG: `data:image/png;base64,...databytes...` |
| | 97 | * Example for SVG: `data:image/svg+xml;base64,...databytes...` |
| | 98 | * [wikitr:/Help/Base64 More information] about `data:image/...` in JOSM. |
| | 99 | * When the JOSM wiki is used for designing of new styles or presets you have some additional options: |
| | 105 | == Translation == |
| | 106 | 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. |
| | 107 | To create these files there exist scripts in the SVN directory [source:osm/applications/editors/josm/i18n/ i18n]. |
| | 108 | See also [wikitr:/Translations#Software software translation section] in translation documentation. |
| | 109 | |
| | 110 | == Updating styles in JOSM == |
| | 111 | 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: |
| | 112 | * Open the [wikitr:/Help/Action/Preferences Preferences] |
| | 113 | * Make sure [wikitr:/Help/ExpertMode Expert mode] is enabled |
| | 114 | * Open the [wikitr:/Help/Preferences/Advanced Advanced Preferences] |
| | 115 | * Search for keys starting with: `mirror.https://josm.openstreetmap.de/josmfile?page_Styles/` (or `mirror.` for other external sources) |
| | 116 | * Select the style you want to update |
| | 117 | * Click on Reset at the bottom of the window |
| | 118 | * Click on OK to save the changes (and to close the preference window) |
| | 119 | * Restart JOSM |
| | 120 | |
| | 121 | or: |
| | 122 | |
| | 123 | * Remove the content of your [wikitr:/Help/Action/About#InstallationDetails <josm.cache>] folder |
| | 124 | * Restart JOSM |
| | 125 | |
| | 126 | To check the version of the style in JOSM do the following steps |
| | 127 | * Open the [wikitr:/Help/Dialog/MapPaint Map Paint Styles Dialog] |
| | 128 | * Right click on a style |
| | 129 | * Choose Info |
| | 130 | * Click on Source Tab |
| | 131 | * Search for `version:` at the beginning of the source code |
| 112 | | [[Image(Mappaint_no_icon.png)]] missing icon[[br]] |
| 113 | | 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. |
| | 145 | [[Image(Mappaint_no_icon.png,margin-right=5,link=)]] missing icon \\ |
| | 146 | 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. |
| 135 | | * {{{mappaint.showicons}}} |
| 136 | | * select whether icons are shown - same values as {{{mappaint.fillareas}}} |
| 137 | | * {{{mappaint.shownames}}} |
| 138 | | * select whether names are shown - same values as {{{mappaint.fillareas}}} |
| 139 | | * {{{mappaint.strokes}}} |
| 140 | | * select whether strokes or full lines are used - same values as {{{mappaint.fillareas}}} |
| 141 | | * {{{mappaint.useRealWidth}}} |
| 142 | | * true - ways will change width corresponding to the real width in meters set in the elemstyle.xml file |
| 143 | | * false (default) - ways will have the same width on every zoom level |
| 144 | | * {{{mappaint.zoomLevelDisplay}}} |
| | 168 | * `mappaint.showicons` |
| | 169 | * select whether icons are shown - same values as `mappaint.fillareas` |
| | 170 | * `mappaint.shownames` |
| | 171 | * select whether names are shown - same values as `mappaint.fillareas` |
| | 172 | * `mappaint.strokes` |
| | 173 | * select whether strokes or full lines are used - same values as `mappaint.fillareas` |
| | 174 | * ~~`mappaint.useRealWidth`~~ |
| | 175 | * ~~true - ways will change width corresponding to the real width in meters set in the elemstyle.xml file~~ |
| | 176 | * ~~false (default) - ways will have the same width on every zoom level~~ |
| | 177 | * `mappaint.zoomLevelDisplay` |