[[TranslatedPages(revision=121,outdated=incomplete translation)]] [[PageOutline(2-10,Table of Content)]] = JOSM Картни стилове = [[JOSMImage(dialogs/mapstyle,middle,margin-right=20)]] The JOSM [[Help/MapView|map display]] can be easily customized with different styles. Many styles are included with JOSM by default. There are ''base styles'' (e.g. [source:trunk/resources/styles/standard/elemstyles.mapcss JOSM standard] or [source:trunk/resources/styles/standard/potlatch2.mapcss 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. Further customization is possible via [[#AdvancedPreferences|style options]] or by [[#CreateStyle|creating your own style]]. == Избор на стил ==#ChooseStyles 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). 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 * in the [[Help/Dialog/MapPaint|map paint style dialog]] or * in the [[Help/Menu/View|"View" menu]] ( → "Map paint styles") or * (less comfortable) in the Map Paint Styles Preferences (see section below) Note that, unless you are working with add-on styles, likely you want to have only one style ☑ checked at a time. === Активиране на още стилове === [[Image(Styles:addstyle.gif, right, 250px, title=animation of how to activate and choose an example style)]] ''Instructions:'' 1. open the [Help/Preferences/Map#MapPaintStyles Map Paint Styles Preferences] by either * clicking the [[JOSMImage(dialogs/mappaintpreference)]] [[Help/Dialog/MapPaint#MapStyleSettings|Settings]] button in the map style dialog (shown in the animation) or * via [[Help/Menu/View|"View" menu]] → "Map paint styles" → "Map paint preferences" or * (less comfortable) via the general preferences window ([[Help/Menu/Edit|Menu Edit]] → [[Help/Action/Preferences|Preferences]] → [[JOSMImage(preferences/map,15)]] [[Help/Preferences/Map|Map Settings]] (3rd button on the left) → Map Paint Styles (2nd tab)) 2. select a style in the list of "available styles" (left side) 3. activate it by clicking the [[JOSMImage(preferences/activate-right)]] blue right arrow button (in the centre) 4. exit and confirm by clicking the OK button ''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". ==== Добавяне на собствен стил ==== 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. == Списък на достъпните стилове == [[Styles(en|styles|short description|author|description|version|More details)]] == Create your own style ==#CreateStyle You don't like the standard style? Change it to your own liking: * In the [[Help/Dialog/MapPaint|map paint style dialog]], right click one of the styles and select [[JOSMImage(copy)]]"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. * Or create a style from scratch and add it in the JOSM mappaint preferences. JOSM supports two formats to define a style: JOSM XML:: The previously traditional style format in JOSM (still functional). The [[Styles/LegacyStandard|old standard style]] contains some documentation. MapCSS:: 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. * General information can be found in the [osmwiki:Category:MapCSS osm wiki]. * A [[Help/Styles/MapCSSTutorial|Short tutorial]] should get you started. * The [[Help/Styles/MapCSSImplementation|JOSM implementation reference]] lists the supported features in more detail. Style files with different formats are compatible, they can be loaded at the same time. == Make your style available to other users == * Either edit the page StylesSource and add URLs for new style files to the list at the top … * **Note**: Only URLs with file-extension (e.g. *.mapcss, *.xml, *.zip, *.php) are supported. * … or create a wiki page similar to [[Styles/LegacyStandard]] (XML) or [[Styles/Modified]] (MapCSS). * for automatic version adjustment you should use two internal variables: * {{{[[revision]]}}} - is the latest version number of the wiki page * {{{[[date]]}}} - is the date of the last edit * e.g. {{{"1.[[revision]]_[[date]]"}}} converts to e.g. {{{1.13_2014-02-24}}} * **Note**: Spam filter prohibits adding many external (icon) links. Please, if possible, attach icons to the wiki page ([#Iconhandling see below]). 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). == Икони .png and .svg files are supported. === Управление на икони === There are different forms to handle icons: * Icons distributed with JOSM can be entered directly with the path (relative to JOSM's internal image directory). * Use a path relative to your local style file. * New icons can be directly referenced using a http-link. These are downloaded and cached internally. * Since JOSM revision [/changeset/2289/josm 2289] zip files are supported. * The zip file must contain at least one file with extension xml (or mapcss). * Icon names and path are relative to the topmost zip directory. * If there are multiple XML files, a file with "style" in the name is preferred (to allow packaging styles and presets in one archive). * Since JOSM revision [/changeset/4713/josm 4713] inline encoding as described in [[http://tools.ietf.org/html/rfc2397|RFC 2397]] is supported. * Example for PNG: {{{data:image/png;base64,...databytes...}}} * Example for SVG: {{{data:image/svg+xml;base64,...databytes...}}} * [wiki:Help/Base64 More information] about {{{data:image/...}}} in JOSM. * When the JOSM wiki is used for designing of new styles you have some additional options: * Each file attached to the wiki page is automatically included in the zip file downloaded by JOSM. * If you don't want a file in the zip file, add the text **(NOZIP)** in the description of the attachment. * If you add a zip file and want its contents included, you may add **(EXTRACT)** in the description of the attachment. * The server automatically switches from download of single file to zip download when files are attached. == Styles managed in JOSM wiki == [[TitleIndex(Styles/)]] == Rendering == Mappaint renders the map data so it looks much more like a map (colors, icons, annotations, ...) - compared to the JOSM wireframe mode. === Nodes === 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}}}. There are some special icons for missing/incomplete things: [[Image(Styles:Mappaint_no_icon.png)]] missing icon[[br]] 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. [[Image(Styles:Mappaint_deprecated.png)]] warning icon[[br]] 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. === Пътиша === Most ways that correspond to tags in the map features page will get special color, thickness and line style (e.g. dashed lines for railways). === Площи === Areas 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). == Advanced Preferences == 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). In addition, you can use the following hidden preferences: * {{{mappaint.fillalpha}}} * alpha "opacity level", that is used to fill areas. An integer value between 0 (transparent) and 255 (solid) with the default of 50. * {{{mappaint.fillareas}}} (show areas) * 10000000 (default) - areas will be filled with their corresponding colour and name will be rendered * 0 - areas will be surrounded by lines only and name will not be rendered * 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 * {{{mappaint.showicons}}} * select whether icons are shown - same values as {{{mappaint.fillareas}}} * {{{mappaint.shownames}}} * select whether names are shown - same values as {{{mappaint.fillareas}}} * {{{mappaint.strokes}}} * select whether strokes or full lines are used - same values as {{{mappaint.fillareas}}} * {{{mappaint.useRealWidth}}} * true - ways will change width corresponding to the real width in meters set in the elemstyle.xml file * false (default) - ways will have the same width on every zoom level * {{{mappaint.zoomLevelDisplay}}} * true - elements visibility depends on zoom level * false (default) - all elements are displayed * {{{mappaint.fontsize}}} * size of mappaint texts (default=8) ---- Обратно към [wiki:/Help main help]