globals:
  cache:
    base_dir: ./cache_data/
    meta_size: [1, 1]
    meta_buffer: 0
  image:
    paletted: False
    # resampling: 'bicubic'

services:
  wms:
    on_source_errors: raise
  tms:

layers:
  - name: online
    title: all sources online
    sources: [wms1]
  - name: all_offline
    title: all sources offline
    sources: [wms2, wms3]
  - name: mixed
    title: on- and offline layers
    sources: [wms1, wms2, wms3]
  - name: tilesource
    title: Tilesource with 404/204 handling
    sources: [tilesource_cache]
  - name: tilesource_catchall
    title: Tilesource with 'other' on_error handling
    sources: [tilesource_catchall_cache]

caches:
  wms_cache:
    grids: [GLOBAL_MERCATOR]
    sources: [wms1, wms2, wms3]

  tilesource_cache:
    grids: [GLOBAL_GEODETIC]
    sources: [tilesource]

  tilesource_catchall_cache:
    grids: [GLOBAL_GEODETIC]
    sources: [tilesource_catchall]

sources:
  wms1:
    type: wms
    req:
      url: http://localhost:42423/service_a
      layers: a_one
      transparent: True
  wms2:
    type: wms
    req:
      url: http://localhost:99998/service_b
      layers: b_one
      transparent: True
  wms3:
    type: wms
    req:
      url: http://localhost:99999/service_c
      layers: c_one
      transparent: True
  tilesource:
    type: tile
    url: http://localhost:42423/foo/%(tms_path)s.png
    grid: GLOBAL_GEODETIC
    on_error:
      404:
        response: '#ff0080'
        cache: False
      204:
        response: [100, 200, 50, 250]
        cache: True
  tilesource_catchall:
    type: tile
    url: http://localhost:42423/foo/%(tms_path)s.png
    grid: GLOBAL_GEODETIC
    on_error:
      other:
        response: [100, 50, 50]
        cache: False
