### Style package layout example Source: https://github.com/openstreetmap/mkgmap/blob/master/doc/styles/creating.txt An example directory structure for a zip archive containing multiple styles. ```text .\n`-- mystyles\n |-- cycle\n | |-- lines\n | |-- points\n | |-- polygons\n | `-- version\n `-- hiking\n |-- lines\n |-- points\n |-- polygons\n `-- version ``` -------------------------------- ### Point Example 1 Source: https://github.com/openstreetmap/mkgmap/blob/master/test/resources/typ/test.txt Configuration for a point with day XPM data. ```ini [_point] Type=0x10203 String=0x4,Test DayXpm="5 6 4 2" "** c #909090" " c #898989" "!! c #198989" "$$ c #198989" "**********" "** ******" "** ** **" "**** ****" "**** ****" "**$$******" [end] ``` -------------------------------- ### substring filter example Source: https://github.com/openstreetmap/mkgmap/blob/master/doc/styles/rules-filters.txt Example of using the 'substring' filter to extract a portion of a string based on start and end positions. ```text ${name|substring:2:5} ``` -------------------------------- ### Numeric comparison examples Source: https://github.com/openstreetmap/mkgmap/blob/master/doc/styles/rules.txt Examples of comparing numeric tag values. ```mkgmap population > 10000 lanes >= 2 population < 10000000 ``` -------------------------------- ### Polygon Example 1 Source: https://github.com/openstreetmap/mkgmap/blob/master/test/resources/typ/test.txt Configuration for a polygon with custom colors and XPM data. ```ini [_polygon] Type=0x1 String=0x4,Test String=0x5,Txxx FontStyle=NoLabel DaycustomColor=#110099 NightcustomColor=#909911 CustomColor=ignored ExtendedLabels=ignored Xpm="0 0 2 0" "* c #990099" " c #889988" [end] ``` -------------------------------- ### Delete tag example Source: https://github.com/openstreetmap/mkgmap/blob/master/doc/styles/rules.txt A simple example of how to delete a tag named 'key123'. ```rules { delete key123 } ``` -------------------------------- ### Example [_line] section Source: https://github.com/openstreetmap/mkgmap/blob/master/doc/typ-compiler.txt An example of a [_line] section for styling line elements. ```plaintext [_line] Type=0x22 ; options to style the line [end] ``` -------------------------------- ### Line Example 1 Source: https://github.com/openstreetmap/mkgmap/blob/master/test/resources/typ/test.txt Configuration for a line with specified width and XPM data. ```ini [_line] Type=0x1 String=0x4,Test LineWidth=2 BorderWidth=1 Xpm="0 0 2 0" "a c #909090" "2 c #898989" [end] ``` -------------------------------- ### Point Example 2 Source: https://github.com/openstreetmap/mkgmap/blob/master/test/resources/typ/test.txt Configuration for a point with day and night XPM data, including alpha. ```ini [_point] Type=0x10203 String=0x4,Test DayXpm="5 6 4 2" "** c #909090" " c #898989" "33 c #198989" "44 c none" "**********" "** ******" "** ** **" "**** ****" "**** ****" "**$$******" NightXpm="5 6 4 2" "** c #909090" " c #898989" "33 c #198989" baralpha=10 "44 c #198989ee" "**********" "** ******" "** ** **" "**** ****" "**** ****" "**********" [end] ``` -------------------------------- ### Regular expression example Source: https://github.com/openstreetmap/mkgmap/blob/master/doc/styles/rules.txt An example of using a regular expression to test a tag's value. ```mkgmap ele ~ '\d*00' ``` -------------------------------- ### Line Example 2 Source: https://github.com/openstreetmap/mkgmap/blob/master/test/resources/typ/test.txt Configuration for a line with different XPM data. ```ini [_line] Type=0x2 String=0x4,Test LineWidth=2 BorderWidth=1 Xpm="32 2 2 1" "* c #909090" "! c #898989" "********************************" "***!!!!!!!!!!!!!!!!!!!!!!*******" [end] ``` -------------------------------- ### Example with all unneeded spaces removed Source: https://github.com/openstreetmap/mkgmap/blob/master/doc/styles/rules.txt This example shows the same rule as above with all unnecessary spaces and newlines removed. ```mkgmap natural=cliff{name'${name} cliff'|"cliff"}[0x10501 resolution 22] ```