- Install Docker
- Crate a new folder to store the yml file in and change into it:
mkdir TileServer && cd TileServer
- Load the yml:
wget https://raw.githubusercontent.com/123FLO321/SwiftTileserverCache/master/docker-compose.yml
- Edit the docker-compose.yml file if you want to change defaults. Default will work fine.
- Crate a new folder to store TileServer data in and chagne into it:
mkdir TileServer && cd TileServer
- Get Download command from https://openmaptiles.com/downloads/planet/ for your region.
- Download the file using wget.
- Rename file to end in .mbtiles if it got named incorrectly
- Change one layer back into the folder where the docker-compose.yml file is located:
cd ..
- Start and attach to logs:
docker-compose up -d && docker-compose logs -f
- Tiles:
tile/{style}/{z}/{x}/{y}/{scale}/{format}
- StaticMap:
static/{style}/{lat}/{lon}/{zoom}/{width}/{height}/{scale}/{format}
The default included styles are:
- klokantech-basic
- osm-bright Checkout https://tileserver.readthedocs.io for a guide on how to add more styles.
StaticMap route accetps an url-ecoded JSON (check bellow) on markers
query parameter.
Example:
[
{
"url": "Marker Image URL",
"height": 50,
"width": 50,
"x_offset": 0,
"y_offset": 0,
"latitude": 10.0,
"longitude": 10.0
},
…
]
StaticMap route accetps an url-ecoded JSON (check bellow) on polygons
query parameter.
Example:
[
{
"fill_color": "rgba(100.0%, 0.0%, 0.0%, 25.0%)",
"stroke_color": "black",
"stroke_width": 1,
"path": [
[10.0, 10.0],
[10.0, 11.0],
[11.0, 11.0],
[11.0, 10.0]
]
}
…
]
https://tileserverurl/tile/klokantech-basic/{z}/{x}/{y}/2/png
https://tileserverurl/static/klokantech-basic/47.263416/11.400512/17/500/500/2/png