docs/STYLES.md
Here is the basic workflow to update styles:
Roads.mapcsstools/unix/generate_drules.sh scriptPlease prepend [styles] to your commit message and add Developers Certificate of Origin to it.
Files changed by the script should be added as a separate [styles] Regenerated commit.
Please check a list of current styling issues and "icons wanted" issues.
An overview of currently used icons can be found in the Wiki.
To work with styles first clone the OM repository.
Install a protobuf python package with pip
pip install protobuf
or with your OS package manager, e.g for Ubuntu
sudo apt install python3-protobuf
To run the generate_symbols.sh script install optipng also, e.g. for Ubuntu
sudo apt install optipng
If you use WSL on Windows 10 you might need to run X Server before running generate_symbols.sh
Map styles are defined in text files located in data/styles/default/include/:
Basemap.mapcssBasemap_label.mapcssRoads.mapcssRoads_label.mapcssIcons.mapcssSubways.mapcsslight/colors.mapcssdark/colors.mapcsspriorities_4_overlays.prio.txtpriorities_3_FG.prio.txt, priorities_2_BG-top.prio.txt, priorities_1_BG-by-size.prio.txtThere is a separate set of these style files for the navigation mode in data/styles/vehicle/.
Icons are stored in data/styles/default/light/symbols/ and their dark/night counterparts are in data/styles/default/dark/symbols/.
data/styles/default/light/symbols/ (and to dark too)
preferably look for icons in collections OM uses alreadydata/styles/default/include/Icons.mapcss and to "navigation style" data/styles/vehicle/include/Icons.mapcsstools/unix/generate_symbols.sh to add new icons into skin filestools/unix/generate_drules.sh to generate drawing rules for the new iconsdata/mapcss-mapping.csv (or better replace existing deprecated line) to make OM import it from OSMdata/replaced_tags.txtpriorities_4_overlays.prio.txt and/or other priorities filesdata/editor.configdata/strings/types_strings.txtdata/categories.txttools/unix/generate_localizations.sh to validate and distribute translations into iOS and Android/generator/generator_tests/osm_type_tests.cpp if you canThe most convenient way is using the desktop app. (there is a "Designer" version of it also, which facilitates development by rebuilding styles and symbols quickly, but it's broken as of now, please help fix it!)
To test on Android or iOS device either re-build the app or put
the compiled style files (e.g. drules_proto_default_light.bin) into
a styles/ subfolder of maps directory on the device
(e.g. Android/data/app.organicmaps/files/styles/).
Changing display zoom level for features (e.g. from z16- to z14-) might not take effect until map's visibility/scale index is rebuilt:
generator_tool binaryGeorgia.mwm into the data/ folder in the repository../omim-build-release/generator_tool --generate_index=true --output="Georgia"
Georgia.mwm will be updated in placeA whole map needs to be regenerated for the changes to take effect if:
area style rules are added for a feature that didn't have them beforeMap style files syntax is based on MapCSS/0.2, though the specification is not supported in full and there are OM-specific extensions to it.
The tools/unix/generate_drules.sh script uses a customized version of Kothic
stylesheet processor to compile MapCSS files into binary drawing rules files data/drules_proto*.bin.
The processor also produces text versions of these files (data/drules_proto*.txt) to ease debugging.
The tools/unix/generate_symbols.sh script assembles all icons into skin files in various resolutions (data/resources-*/symbols.png and symbols.sdf).