This project consists on a management layer for Maplibre Martin, allowing the management of map sources, sprites and font glyphs, all stored in the filesystem and on a Postgresql database.
The frontend is built using ReactJS, Vite, and Bootstrap.
The backend is a Spring Boot application.
- Visual frontend for managing Maplibre Martin sources
- Real-time styles editor, with error validation, feature inspection, and raw JSON editor
- Support importing sources in GeoJSON, Geopackage, KML and SHP
- Provides a ready-to-use, custom maps infrastructure for any project
- Includes 3 sample styles:
- Bleen (Qwant derived style)
- Bleen - Dark
- MapTiler Basic
- Git
- Docker
-
Clone this repository
git clone https://github.com/BleenIT/libre-studio .
-
Include 1+ pmtile files under the
pmtiles
folder on the shared volume (defaults to./mapbuilder-vol/pmtiles/
). You see below how to create pmtiles files from OSM Geofabrik extracts. -
Finally:
docker compose up
After providing a base map tiles (using the instructions below) running the docker, the Web UI is available at http://localhost:8081
-
We are not including any example sources on the docker image, as they can be easily loaded through the web interface.
-
The exposed ports are (can be changed in
docker-compose.yml
):- Postgresql: 54320
- Martin: 30000
- Backend: 8181
- Frontend: 8081
-
By default, the backend is configured to run on
localhost
, port8181
and Martin on30000
. This can be change by setting two environment variables:- BACKEND_URL - the Backend API URL (defaults to http://localhost:8181/api)
export BACKEND_URL=http://localhost:8181/api
MARTIN_URL
- Martin URL (defaults http://localhost:30000)-
export MARTIN_URL=http://localhost:30000
-
- BACKEND_URL - the Backend API URL (defaults to http://localhost:8181/api)
-
On
docker-compose.yml
file, you can configure the shared docker volume, which defaults to./mapbuilder-vol/
. -
The frontend is not production ready, currently used for testing purposes.
-
The backend has no authentication, only expose the public styles endpoint (
/styles/{id}/raw
), and Martin ones.
To generate the vector tiles (pmtile file) from the Open Street Maps PBF files, you will need Docker, Tilemaker, and a PBF file for the region:
- Download the map region you need from OSM Geofabrik extracts.
Note: start with a small region, as this process can take a lot of time (hours) with bigger regions.
- You can use our provided scripts that perform some optimizations on the generated pmtiles file. For that you will need to download the files:
- Put them in the
./data
folder and unzip them:mkdir -p ./data/landcover
unzip ./data/ne_10m_urban_areas.zip -d ./data/landcover/ne_10m_urban_areas
unzip ./data/water-polygons-split-4326.zip -d ./data/; mv ./data/water-polygons-split-4326 ./data/coastline
- Run tilemaker (replace
REGION
by the name of the file you downloaded):docker run -it --rm --pull always -v $(pwd)/data:/data -w /data \ ghcr.io/systemed/tilemaker:master \ --input /data/REGION.osm.pbf \ --output /data/openmaptiles.pmtiles \ --store /data/store \ --config /data/config-openmaptiles.json \ --process /data/process-openmaptiles.lua
- Note: this will generate an
openmaptiles.pmtiles
file. Keep the filename as is, so that the provided styles work out-of-the-box.
- Note: this will generate an
- You can now use the generated
openmaptiles.pmtiles
and put it under./mapbuilder-vol/pmtiles/
folder.
This project uses tilemaker to generate the pmtiles, you can check their github for further instructions and customizations.
- Need to create different postgres table sources on martin config, similar to how the sprites are being done;
- Support feature properties on sources (WIP);
- Support duplicate fonts on Martin (if Martin detects a duplicate font, it will shutdown)
- Map sources visual editor
- Pagination on frontend
- Authentication
Licensed under MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
Developed by BleenIT