An unofficial MapLibre style that brings the BKG basemap.world Web Vektor cartography to OpenFreeMap vector tiles. Map data come only from OpenStreetMap via OpenFreeMap. No BKG vector tiles are used.
This style is maintained by Graphmasters. It is not an official BKG or basemap.de product.
- Preview: https://graphmasters.github.io/basemap-world-openfreemap/
- Style: https://graphmasters.github.io/basemap-world-openfreemap/style.json
- Credits: https://graphmasters.github.io/basemap-world-openfreemap/attribution.html
It is the shared base map for nap-roadworks-viewer and nap-roads-explorer (NAP Roadworks
Explorer). Those apps load the hosted style and keep no copy of it.
const styleBase = 'https://graphmasters.github.io/basemap-world-openfreemap';
const map = new maplibregl.Map({
container: 'map',
style: `${styleBase}/style.json`,
});The source attribution in style.json carries every credit the map needs:
OpenFreeMap | © OpenMapTiles | © OpenStreetMap contributors | Style: © BKG CC BY 4.0, modified
"modified" links the full credits and the list of changes,
so no customAttribution is needed. Do not add your own BKG or style credit on top; MapLibre would
show it twice. Keep the attribution reachable, for example with MapLibre's compact attribution
button.
Roads are in source openfreemap, source-layer transportation. That is the OpenMapTiles schema,
z0–14, overzoomed beyond z14. The layer ids are the upstream BKG ids, which are German names such as
wrKontur_Autobahn_getrennt. Query by source-layer, not by layer id.
upstream/bm_web_wld_col.json is a pinned snapshot of the BKG style.
scripts/build-style.mjs turns it into docs/style.json:
- It keeps
backgroundand the 290 layers on BKG's world source. That source uses the OpenMapTiles schema, so every filter field also exists in OpenFreeMap. - It drops the 549 layers on BKG's Germany-only source, which uses its own schema and BKG data.
- It re-points the remaining layers at
https://tiles.openfreemap.org/planetand removes filter clauses on the BKG-only attributeklasse.
Sprites and glyphs keep their absolute BKG URLs. OpenFreeMap's glyph server has no Roboto or Noto Sans ExtraCondensed, which the style uses.
npm ci
npm run build # upstream/ → docs/style.json (offline, deterministic)
npm run validate # style spec + OpenFreeMap schema + sprite + glyph checks (online)
npm run refresh # re-download the upstream BKG style, then buildAfter npm run refresh, review the upstream diff, run validate, and check the preview. The
preview has an "Upstream BKG" toggle for side-by-side comparison.
CI (check.yml) rebuilds on every PR, fails if docs/style.json is stale, and runs the
validator. deploy.yml publishes docs/ to GitHub Pages on every push to main.
- Germany: upstream draws BKG's detailed national cartography from its own tiles. Here Germany renders with the world layers, like every other country.
- Detail above z14: OpenFreeMap tiles stop at z14 and are overzoomed beyond that.
- Style files (
docs/style.json,upstream/): CC BY 4.0, after © BKG. See ATTRIBUTION.md. - Scripts and preview pages: Apache-2.0.
- Map data: © OpenStreetMap contributors, ODbL. Tile schema: © OpenMapTiles. Tiles: OpenFreeMap.