# Generates vtiles from database
genraw:
  public: true
  formats: [pbf]
  uri: tmsource://
  yaml:
    npm: ["@kartotherian/osm-bright-source", "data.yml"]
  yamlSetDataSource:
    if:
      dbname: gis
      host: ''
      type: postgis
    set:
      host: localhost
      user: {var: osmdb-user}
      password: {var: osmdb-pswd}

gen:
  uri: json2tags://
  params:
    source: {ref: genraw}
    tag: name

v4:
  public: true
  formats: [pbf]
  uri: cassandra://
  params:
    maxzoom: 16
    keyspace: v4
    cp: {var: cassandra-servers}
    username: {var: cassandra-user}
    password: {var: cassandra-pswd}
    repfactor: 4
    durablewrite: 0
    createIfMissing: true
    copyInfoFrom: {ref: gen}
    setLastModified: true

# View tiles as generated directly from the database. Don't view zoom0-5
v4view:
  public: true
  formats: [png,json,headers,svg,jpeg]
  scales: [1.3, 1.5, 2, 2.6, 3]
  static: true
  maxheight: 2048
  maxwidth: 2048
  uri: tmstyle://
  yaml:
    npm: ["@kartotherian/osm-bright-style", "project.yml"]
  yamlSetParams:
    source: {ref: v4}

# View tiles as generated directly from the database. Don't view zoom0-5
genview:
  public: true
  formats: [png,json,headers,svg,jpeg]
  scales: [1.3, 1.5, 2, 2.6, 3]
  static: true
  maxheight: 2048
  maxwidth: 2048
  uri: tmstyle://
  yaml:
    npm: ["@kartotherian/osm-bright-style", "project.yml"]
  yamlSetParams:
    source: {ref: gen}

osm-localized:
  uri: babel://
  params:
    source: {ref: v4}
    tag: name
    combineName: false
    defaultLanguage: en

# OSM PBF source
osm-pbf:
  public: true
  formats: [pbf]
  uri: overzoom://
  params:
    source: {ref: osm-localized}
    maxzoom: 18
  overrideInfo:
    attribution: 'Map data © <a href="http://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
    tiles: ["https://maps.wikimedia.org/osm-pbf/{z}/{x}/{y}.pbf"]

# OSM map with international labeling - will be used as default
osm-intl:
  public: true
  formats: [png,json,headers,svg,jpeg]
  scales: [1.3, 1.5, 2, 2.6, 3]
  maxzoom: 18
  static: true
  maxheight: 2048
  maxwidth: 2048
  uri: tmstyle://
  yaml:
    npm: ["@kartotherian/osm-bright-style", "project.yml"]
  yamlSetParams:
    source: {ref: osm-pbf}
  overrideInfo:
    attribution: 'Map data © <a href="http://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
    tiles: ["https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png"]

# OSM map without any labels
osm:
  public: true
  formats: [png,json,headers,svg,jpeg]
  scales: [1.3, 1.5, 2, 2.6, 3]
  maxzoom: 18
  static: true
  maxheight: 2048
  maxwidth: 2048
  uri: tmstyle://
  yaml:
    npm: ["@kartotherian/osm-bright-style", "project.yml"]
  yamlSetParams:
    source: {ref: osm-pbf}
  yamlExceptLayers: ['country_label', 'place_label', 'poi_label']
  overrideInfo:
    attribution: 'Map data © <a href="http://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
    tiles: ["https://maps.wikimedia.org/osm/{z}/{x}/{y}.png"]
