2.9 KiB
2.9 KiB
Mondo usando pmtiles
mappa con terrain 3D, hillshade e curve di livello
Come è composto
pmtiles
├── backup
│ ├── default.conf
│ ├── docker-compose.yml
│ ├── Dockerfile
│ └── index_ok.html
├── data
│ ├── planet.pmtiles
│ ├── terrain.pmtiles
│ └── terrain_terrarium.pmtiles
├── docker-compose.yml
├── Dockerfile
├── nginx
│ └── default.conf
├── public
│ ├── assets
│ │ ├── basemaps
│ │ │ └── basemaps.js
│ │ ├── maplibre
│ │ │ ├── maplibre-gl.css
│ │ │ └── maplibre-gl.js
│ │ ├── pmtiles
│ │ │ └── pmtiles.js
│ │ └── terrain
│ ├── index(1).html
│ ├── index.html
│ ├── index_ok_completo.html
│ ├── index_ok.html
│ └── tiles
├── README.md
└── readme.txt
Download i file pmtiles (non inclusi nel git)
inserire i files pmtlies in data
per il 2D nel sito protomaps scaricare
wget -c https://build.protomaps.com/20260217.pmtiles
per il terrain 3D e hillshade
wget -c https://download.mapterhorn.com/planet.pmtiles
Download parziale
per esempio
pmtiles extract https://build.protomaps.com/20260217.pmtiles my_area.pmtiles --bbox=4.742883,51.830755,5.552837,52.256198
per scaricare 3d solo alpi
pmtiles extract \
--bbox=7.51,45.90,7.80,46.05 \
https://download.mapterhorn.com/planet.pmtiles \
public/assets/terrain/w_alps.pmtiles
altri files che sono già inclusi nel git
dentro project/public/assets
MapLibre GL JS + CSS
curl -L https://unpkg.com/maplibre-gl@3.6.2/dist/maplibre-gl.js -o maplibre/maplibre-gl.js
curl -L https://unpkg.com/maplibre-gl@3.6.2/dist/maplibre-gl.css -o maplibre/maplibre-gl.css
PMTiles JS
curl -L https://unpkg.com/pmtiles@4.4.0/dist/pmtiles.js -o pmtiles/pmtiles.js
Protomaps basemaps (solo JS runtime per generare i layers)
curl -L https://unpkg.com/@protomaps/basemaps@5/dist/basemaps.js -o basemaps/basemaps.js
Glyphs + sprites dal repo ufficiale (ZIP)
Apri https://protomaps.github.io/basemaps-assets/ e scarica lo ZIP;
wget https://github.com/protomaps/basemaps-assets/archive/refs/heads/main.zip
unzip main.zip
poi estrai in public/assets/fonts e public/assets/sprites/v4
- fonts/{fontstack}/{range}.pbf
- sprites/v4/light.png, light.json, light@2x.png, light@2x.json
font Noto Sans da scaricare da
https://fonts.google.com/
in quanto manca la versione Bold
poi andare in
https://maplibre.org/font-maker/
convertire solo il font Noto Sans Bold che manca e metterlo in public/assets/fonts
Avviare
nella dir principale
sudo docker compose up --build -d
se si modifica
sudo docker compose down