This uses data from OpenStreetMap. The OSM data has usually been converted from PostgreSQL GIS data into bitmap tiles but this is an slightly outdated technique and OpenMapTiles is a vector-based solution built on top of OSM data.
The styling is... interesting... There's a lot of hard coded references to external resources so the styles included in this project has been massaged to point to both the proper tile data and local resources.
The library includes a sample set of tiles from a different library. To add your own tiles follow the guidelines below.
The tiles can be rebuilt in a few minutes (a more elaborate description is at https://blog.kleunen.nl/blog/tilemaker-generate-map).
Tools needed:
- Osmium - install with
brew install osmium-tool
on macOS - Tilemaker - build from the GitHub sources
- wget - pull a suitable data set from GeoFabrik
Run the following commands to extract the data into tiles
wget http://download.geofabrik.de/europe/norway-latest.osm.pbf
osmium extract --bbox=9.78,63.17,10.97,63.56 --set-bounds --strategy=smart norway-latest.osm.pbf --output trondheim.osm.pbf
tilemaker --input trondheim.osm.pbf --output tiles --process [...]/resources/process-openmaptiles.lua \
--config [...]/resources/config-openmaptiles.json
The whole process should take three to four minutes on a decent computer.