]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/server/tileserver-mapnik/README.md
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / server / tileserver-mapnik / README.md
1 # tileserver-mapnik
2
3 Mapnik-based tile server generating raster tiles from tilelive-js sources (MapBox Studio project + custom vector tiles for example).
4 It supports also static maps API.
5
6 ## How to use
7
8 ### Docker
9
10 The easiest way to run tileserver-mapnik is using the precompiled docker container (https://hub.docker.com/r/klokantech/tileserver-mapnik/).
11
12 Detailed instructions how to use the tileserver-mapnik with docker: http://osm2vectortiles.org/docs/serve-raster-tiles-docker
13
14 ### Without docker
15
16 Follow the commands in `Dockerfile` to install the necessary packages, download common fonts and prepare the environment.
17
18 Usage: `node bin/tessera.js [options]`
19
20 Options:
21  - `-c CONFIG` - Configuration file
22  - `-p PORT` - HTTP port [8080]
23  - `-C SIZE` - Cache size in MB [10]
24  - `-S SIZE` - Source cache size (in # of sources)  [10]
25
26 #### Example configuration file
27
28 ```javascript
29 {
30   "/style1": {
31     "source": "tmstyle://./style1.tm2"
32   },
33   "/style2": {
34     "source": "tmstyle:///home/user/style2.tm2"
35   },
36   "/vector": {
37     "source": "mbtiles:///home/user/data.mbtiles"
38   }
39 }
40 ```
41
42 **Note**: For tm2 styles, you need to make sure the content of style's `project.yml` (its `source` property) points to a valid mbtiles file (e.g. `source: "mbtiles://./data.mbtiles"`).
43
44 ## Available URLs
45
46 - If you visit the server on the configured port (default 8080) you should see your maps appearing in the browser.
47 - The tiles itself are served at `/{basename}/{z}/{x}/{y}[@2x].{format}`
48   - The optional `@2x` part can be used to render HiDPI (retina) tiles
49 - Static images are rendered at:
50   - `/{basename}/static/{lon},{lat},{zoom}/{width}x{height}[@2x].{format}` (center-based)
51   - `/{basename}/static/{minx},{miny},{maxx},{maxy}/{zoom}[@2x].{format}` (area-based)
52 - TileJSON at `/{basename}/index.json`