openmaptiles/style/README.md

2.6 KiB

OSM OpenMapTiles style

OSM OpenMapTiles is the official style of OpenMapTiles. Its purpose is to display all features in vector tiles.

OSM OpenMapTiles style is heavily inspired by OSM Carto.

Huge credit belongs to the original authors.

Fonts

OSM OpenMapTiles style used Noto Sans fonts. To download these fonts run:

make download-fonts

It downloads Noto Sans fonts (~70MB) and extract them into openmaptiles/data/fonts directory.

Icons/sprite

All icons which are used OpenMapTiles style are located in openmaptiles/style/icons. After the style is built, the icons are composed into sprite files located in build directory.

Additional svg icons can be added to openmaptiles/style/icons directory.

To generate new sprite files with added icons, run:

make build-sprite

Sprite files will be generated into build directory.

OSM Icons

Icons in the OSM OpenMapTiles style are based on original OSM Carto symbols.

The original icons can be found in openstreetmap-carto/symbols.

Icons used in OSM OpenMapTiles style were scaled down and saved as svg.

Build style

To build style run:

make build-style

It generates new sprite files and merges all style snippets from each layer, orders them according the order value and saves the complete style into build/style/style.json.

Tileserver-gl

The tileserver serves both the tiles and the OSM OpenMapTiles map.

MBTiles (default)

By default, the tileserver serves OSM OpenMapTiles map based on tiles from data/tiles.mbtiles as defined in style-header.json.

"sources": {
  "openmaptiles": {
    "type": "vector",
    "url": "mbtiles:///data/tiles.mbtiles"
  },
  ...
}

Serve from the db

The tileserver can also serve OSM OpenMapTiles map based on dynamically generated tiles directly from the database. Start the database container and the postserve container:

make start-db
make start-postserve

In style-header.json change the source of tiles to PostServe:

Start tileserver

Before you start the tileserver, make sure you have fonts downloaded in openmaptiles/data/fonts, sprites generated and style built:

make download-fonts
make build-style

Start tileserver:

make start-tileserver

And go to http://localhost:8080.