Changes between Initial Version and Version 1 of Ru:Styles


Ignore:
Timestamp:
2017-11-09T11:57:37+01:00 (7 years ago)
Author:
ak099
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Ru:Styles

    v1 v1  
     1[[TranslatedPages(revision=140,outdated=Перевод не завершён)]]
     2[[PageOutline(2-10,Содержание)]]
     3= Стили отрисовки карты в JOSM =
     4[[Image(source:trunk/images/dialogs/mapstyle.svg,middle,margin-right=20)]]
     5Вид [[Help/MapView|область редактирования карты]] в JOSM можно легко изменить с помощью различных стилей. Многие стили уже включены в JOSM по умолчанию.
     6
     7Имеются ''базовые стили'' (например, [source:trunk/styles/standard/elemstyles.mapcss Стандартный стиль JOSM] или [source:trunk/styles/standard/potlatch2.mapcss Potlatch 2]), которые охватывают широкий диапазон объектов. Их можно комбинировать с ''дополнительными стилями'', изменяющими более специфичные детали. Смотрите [#Availablestyleslist список доступных стилей] ниже.
     8
     9Further customization is possible via [#AdvancedPreferences style options] or by [#CreateStyle creating your own style].
     10
     11== Choose styles ==#ChooseStyles
     12
     13JOSM 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).
     14
     15JOSM 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
     16* in the [Help/Dialog/MapPaint map paint style dialog] or
     17* in the [Help/Menu/View "View" menu] ( → "Map paint styles") or
     18* (less comfortable) in the Map Paint Styles Preferences (see section below)
     19
     20Note that, unless you are working with add-on styles, likely you want to have only one style ☑ checked at a time.
     21
     22=== Activating more styles ===
     23[[Image(addstyle.gif, right, 250px, title=animation of how to activate and choose an example style)]] 
     24
     25''Instructions:''
     261. open the [Help/Preferences/Map#MapPaintStyles Map Paint Styles Preferences] by either
     27   * clicking the [[Image(source:trunk/images/dialogs/mappaintpreference.png,middle)]] [Help/Dialog/MapPaint#MapStyleSettings Settings] button in the map style dialog (shown in the animation) or
     28   * via [Help/Menu/View "View" menu] → "Map paint styles" → "Map paint preferences" or
     29   * (less comfortable) via the general preferences window ([Help/Menu/Edit Menu Edit] → [Help/Action/Preferences Preferences] → [[Image(source:trunk/images/preferences/map.png,20,middle)]] [Help/Preferences/Map Map Settings] (3rd button on the left) → Map Paint Styles (2nd tab))
     301. select a style in the list of "available styles" (left side)
     311. activate it by clicking the [[Image(source:trunk/images/preferences/activate-right.png,middle)]] blue right arrow button (in the centre)
     321. exit and confirm by clicking the OK button
     33
     34''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".
     35
     36==== Adding own styles ====
     37You 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,middle)]] plus sign on the right and enter either path and filename or URL of your style file.
     38
     39== Available styles list == #Availablestyleslist
     40
     41[[Styles(en|styles|short description|author|description|version|More details)]]
     42
     43== Create your own style ==#CreateStyle
     44You don't like the standard style? Change it to your own liking:
     45
     46* In the [Help/Dialog/MapPaint map paint style dialog], right click one of the styles and select [[Image(source:/trunk/images/copy.png,middle)]] "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.
     47* Or create a style from scratch and add it in the JOSM mappaint preferences.
     48
     49JOSM 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.
     50 * General information can be found in the [osmwiki:Category:MapCSS osm wiki].
     51 * A [wiki:Help/Styles/MapCSSTutorial Short tutorial] should get you started.
     52 * The [wiki:Help/Styles/MapCSSImplementation JOSM implementation reference] lists the supported features in more detail.
     53
     54== Make your style available to other users ==
     55* Either create a wiki page similar to [[Styles/Modified]].
     56 * don't forget to enclose your mappaint code by a code block (`#!style type="mapcss"` needs to be on a new line after `{{{`):
     57  * `{{{`
     58  * `#!style type="mapcss"`
     59  * ...
     60  * `}}}`
     61 * for automatic version adjustment you should use two internal variables:
     62  * {{{[[revision]]}}} - is the latest version number of the wiki page
     63  * {{{[[date]]}}} - is the date of the last edit
     64  * e.g. {{{"1.[[revision]]_[[date]]"}}} converts to e.g. {{{1.13_2014-02-24}}}
     65 * **Note**: Spam filter prohibits adding many external (icon) links. Please, if possible, attach icons to the wiki page ([#Iconhandling see below]). …
     66* '''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.)
     67 * **Note**: Only URLs with file-extension (e.g. *.mapcss, *.zip, *.php) are supported.
     68In 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).
     69
     70== Icons
     71.png and .svg files are supported.
     72
     73=== Icon handling ===
     74There are different forms to handle icons:
     75
     76* Icons distributed with JOSM can be entered directly with the path (relative to JOSM's internal image directory).
     77* Use a path relative to your local style file. (This works only for Styles, not for Presets.)
     78* Use a path relative to a directory specified at the bottom in the [wiki:Help/Preferences/Map#MapPaintStyles Styles preferences page] or [wiki:Help/Preferences/Map#TaggingPresets Presets preferences page].)
     79* New icons can be directly referenced using a http-link. These are downloaded and cached internally.
     80* zip files are supported too.
     81 * The zip file must contain at least one file with extension mapcss (for styles) or xml (for presets).
     82 * Icon names and path are relative to the topmost zip directory.
     83 * If there are multiple files, a file with "style" in the name is preferred (to allow packaging styles and presets in one archive).
     84* Inline encoding as described in [[http://tools.ietf.org/html/rfc2397|RFC 2397]] is supported too.
     85 * Example for PNG: {{{data:image/png;base64,...databytes...}}}
     86 * Example for SVG: {{{data:image/svg+xml;base64,...databytes...}}}
     87 * [wiki:Help/Base64 More information] about {{{data:image/...}}} in JOSM.
     88* When the JOSM wiki is used for designing of new styles you have some additional options:
     89 * Each file attached to the wiki page is automatically included in the zip file downloaded by JOSM.
     90 * If you don't want a file in the zip file, add the text **(NOZIP)** in the description of the attachment.
     91 * If you add a zip file and want its contents included, you may add **(EXTRACT)** in the description of the attachment.
     92
     93
     94== Updating styles in JOSM ==
     95Once 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. To immediately force an update you can do the following steps:
     96* Open the [wiki:Help/Action/Preferences Preferences]
     97* Make sure [wiki:Help/ExpertMode Expert Mode] is enabled
     98* Open the [wiki:Help/Preferences/Advanced Advanced Preferences]
     99* Search for keys starting with: `mirror.https://josm.openstreetmap.de/josmfile?page_Styles/` (or `mirror.` for other external sources)
     100* Select the style you want to update
     101* Click on Reset at the bottom of the window
     102* Click on OK to save the changes (and to close the preference window)
     103* Restart JOSM
     104
     105To check the version of the style in JOSM do the following steps
     106* Open the [wiki:Help/Dialog/MapPaint Map Paint Styles Dialog]
     107* Right click on a style
     108* Choose Info
     109* Click on Source Tab
     110* Search for `version:` at the beginning of the source code
     111
     112== Styles managed in JOSM wiki ==
     113[[TitleIndex(Styles/)]]
     114
     115
     116== Rendering ==
     117Mappaint renders the map data so it looks much more like a map (colors, icons, annotations, ...) - compared to the JOSM wireframe mode.
     118
     119=== Nodes ===
     120Most 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}}}.
     121
     122There are some special icons for missing/incomplete things:
     123
     124[[Image(Mappaint_no_icon.png)]] missing icon[[br]]
     125We 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.
     126
     127[[Image(Mappaint_deprecated.png)]] warning icon[[br]]
     128The 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.
     129
     130=== Ways ===
     131Most ways that correspond to tags in the map features page will get special color, thickness and line style (e.g. dashed lines for railways).
     132
     133=== Areas ===
     134Areas are ways that form a sort of ring. Most areas that corresponds to tags in the map features page will be filled with a special color (the filling will be transparent to some degree).
     135
     136
     137== Advanced Preferences == #AdvancedPreferences
     138Some 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).
     139
     140In addition, you can use the following hidden preferences:
     141* {{{mappaint.fillalpha}}}
     142 * alpha "opacity level", that is used to fill areas. An integer value between 0 (transparent) and 255 (solid) with the default of 50.
     143* {{{mappaint.fillareas}}} (show areas)
     144 * 10000000 (default) - areas will be filled with their corresponding colour and name will be rendered
     145 * 0 - areas will be surrounded by lines only and name will not be rendered
     146 * 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
     147* {{{mappaint.showicons}}}
     148 * select whether icons are shown - same values as {{{mappaint.fillareas}}}
     149* {{{mappaint.shownames}}}
     150 * select whether names are shown - same values as {{{mappaint.fillareas}}}
     151* {{{mappaint.strokes}}}
     152 * select whether strokes or full lines are used - same values as {{{mappaint.fillareas}}}
     153* ~~{{{mappaint.useRealWidth}}}~~
     154 * ~~true - ways will change width corresponding to the real width in meters set in the elemstyle.xml file~~
     155 * ~~false (default) - ways will have the same width on every zoom level~~
     156* {{{mappaint.zoomLevelDisplay}}}
     157 * true - elements visibility depends on zoom level
     158 * false (default) - all elements are displayed
     159* {{{mappaint.fontsize}}}
     160 * size of mappaint texts (default=8)
     161
     162----
     163Back to [wiki:/Help main help]