HeadlinesBriefing favicon HeadlinesBriefing.com

Build a Custom Water‑Only Map with OpenMapTiles

DEV Community •
×

Developers who want a self‑hosted map without relying on Mapbox or MapTiler can turn to OpenMapTiles. A recent DEV Community tutorial walks through building a water‑only vector map on Ubuntu 24.04, using only the data needed for coastlines, lakes and rivers. First, the guide pulls an OSM extract from GeoFabrik—the author uses the bretagne.osm.pbf and france.osm.pbf files—to avoid processing the 85 GB planet dump.

With Osmium, the extract is filtered to keep only waterway and water tags, producing a small water.osm.pbf. Next, the openmaptiles.yaml file is trimmed so that only the water and waterway layers remain, and the .env file sets zoom levels 0‑10. Running the OpenMapTiles quick‑start script populates a PostGIS database (pre‑loaded with Natural Earth low‑zoom coastlines) and outputs a tiles.mbtiles SQLite file.

A simple make start-tileserver command launches a local tileserver, reachable at http://localhost:8080. For lightweight deployment, the author suggests installing tileserver‑gl via npm. The tutorial ends by pointing readers toward styling tools like Maputnik and interactive libraries such as MapLibre for further map development.