Skip to content

maplibre/workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

workshop

See the slide deck

Pre-reqs

  • Docker and Docker Compose
  • Download the data from Geofabrik, e.g. estonia-latest.osm.pbf from this page into data/ directory. (mirror)
  • Download latest martin release
  • Prefetch needed docker images
# You may need to use the older `docker-compose` command instead
docker compose -f dc-simple.yml pull
docker compose -f dc-with-db.yml pull

Run Planetiler to generate tiles

docker run \
    -e JAVA_TOOL_OPTIONS="-Xmx2g" \
    -v "${PWD}/data":/data \
    ghcr.io/onthegomap/planetiler \
    --download --area=estonia --minzoom=0 --maxzoom=14 \
    --osm_path=/data/estonia-latest.osm.pbf
    
# Fix permissions
sudo chown -R $USER:$USER data

# Rename output file for our demo
mv data/output.mbtiles data/estonia.mbtiles

On Windows (using powershell)

docker run `
    -e JAVA_TOOL_OPTIONS="-Xmx2g"   `
    -v "${PWD}/data:/data"   `
    ghcr.io/onthegomap/planetiler   `
    --download --area=estionia --minzoom=0 --maxzoom=14   `
    --osm_path=/data/estonia-latest.osm.pbf

Serve tiles locally with Martin

martin data/estonia.mbtiles

Run Martin locally, and see if you can access the catalog and source info:

View Tiles with Maputnik

  • Open https://maplibre.org/maputnik/
  • Click Open in the upper right corner, and click Empty (white square)
  • Click Data Sources at the top
    • At the bottom, set Source ID to openmaptiles and URL to https://localhost:3000/estonia, click Add Source and Close
  • Click inspect - you should see the "x-ray mode" of your data

Run Martin with Docker Compose

Start Nginx proxy at port 8080, Martin, and Maputnik with Docker Compose. View it at http://localhost:8080

docker-compose -f dc-simple.yml up

Import data with osm2pgsql

docker network create dbnet
# shell 1
docker-compose -f dc-with-db.yml up db
# shell 2
docker-compose -f dc-with-db.yml up osm2pgsql
docker-compose -f dc-with-db.yml up

Add http://localhost:8080/tiles/bicycle_parking data source to Maputnik.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published