tilegroxy Docs

Example

  • YAML

  • JSON

server:
  tilejson:
    enabled: true
    indexpath: tilejson.json
    baseurls:
      - https://tiles-a.example.com/maps
      - https://tiles-b.example.com/maps
{
  "server": {
    "tilejson": {
      "enabled": true,
      "indexpath": "tilejson.json",
      "baseurls": [
        "https://tiles-a.example.com/maps",
        "https://tiles-b.example.com/maps"
      ]
    }
  }
}

Configuration

Configuration options
Parameter Description Type Required Default

Enabled

If true, serve TileJSON documents for eligible layers

bool

No

false

IndexPath

The HTTP path, relative to RootPath, that serves a TileJSON index listing of eligible layer

string

No

tilejson.json

BaseURLs

Controls the base(s) used for the tiles field, instead of building it from headers. Useful if URLs are opaquely rewritten before reaching tilegroxy, or if tiles are served through multiple hosts. Each entry can include schema, host, and path prefix, and produces one entry in the tiles array.

string[]

No

Built from header inspection

Environment variables
Configuration Parameter Environment Variable

Enabled

SERVER_TILEJSON_ENABLED

IndexPath

SERVER_TILEJSON_INDEXPATH

BaseURLs

SERVER_TILEJSON_BASEURLS

Layer Metadata Examples

Example
  • YAML

  • JSON

layer:
  id: my_layer
  description: Aerial imagery from 2023
  attribution: "© Example Imagery Co"
  datatype: raster
  minzoom: 4
  maxzoom: 16
  bounds:
    south: 51
    north: 63
    west: -7
    east: 0.1
  provider:
    ...
{
  "layer": {
    "id": "my_layer",
    "description": "Aerial imagery from 2023",
    "attribution": "© Example Imagery Co",
    "datatype": "raster",
    "minzoom": 4,
    "maxzoom": 16,
    "bounds": {
      "south": 51,
      "north": 63,
      "west": -7,
      "east": 0.1
    },
    "provider": { ... }
  }
}
Example with a pattern layer
  • YAML

  • JSON

layer:
  id: my_layer
  pattern: my_{name}_{version}
  paramValidator:
    "*": "^[a-zA-Z0-9]+$"
    "version": "v[0-9]{1,3}"
  examples:
    - my_foo_v1
    - my_bar_v2
  provider:
    ...
{
  "layer": {
    "id": "my_layer",
    "pattern": "my_{name}_{version}",
    "paramValidator": {
      "*": "^[a-zA-Z0-9]+$",
      "version": "v[0-9]{1,3}"
    },
    "examples": [
      "my_foo_v1",
      "my_bar_v2"
    ],
    "provider": { ... }
  }
}