diff --git a/.gitignore b/.gitignore index f276d42..15604ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ t-rex-config.toml +shortbread_config diff --git a/config/shortbread.lua b/config/shortbread.lua index 186703d..a32fd3b 100644 --- a/config/shortbread.lua +++ b/config/shortbread.lua @@ -64,9 +64,13 @@ if osm2pgsql.mode == 'create' then -- themepark:plugin('t-rex'):write_config('t-rex-config.toml', {}) -- Enable if you want to create a config file for the Tilekiln tile server. --- (You must also create the directory 'tk'.) +-- (You must also create the directory 'shortbread_config'.) -- --- themepark:plugin('tilekiln'):write_config('tk') +-- themepark:plugin('tilekiln'):write_config('shortbread_config', { +-- tileset = 'shortbread_v1', +-- name = 'OpenStreetMap Shortbread', +-- attribution = '© OpenStreetMap' +-- }) -- Enable if you want to create a taginfo project file. -- diff --git a/config/shortbread_gen.lua b/config/shortbread_gen.lua index ffc55e0..7128d6f 100644 --- a/config/shortbread_gen.lua +++ b/config/shortbread_gen.lua @@ -96,9 +96,13 @@ if osm2pgsql.mode == 'create' then -- }) -- Enable if you want to create a config file for the Tilekiln tile server. --- (You must also create the directory 'tk'.) +-- (You must also create the directory 'shortbread_config'.) -- --- themepark:plugin('tilekiln'):write_config('tk') +-- themepark:plugin('tilekiln'):write_config('shortbread_config', { +-- tileset = 'shortbread_v1', +-- name = 'OpenStreetMap Shortbread', +-- attribution = '© OpenStreetMap' +-- }) end -- --------------------------------------------------------------------------- diff --git a/lua/themepark/plugins/tilekiln.lua b/lua/themepark/plugins/tilekiln.lua index be3492b..93974b9 100644 --- a/lua/themepark/plugins/tilekiln.lua +++ b/lua/themepark/plugins/tilekiln.lua @@ -33,10 +33,10 @@ local lyaml = require 'lyaml' function plugin:build_sublayer_config(main_layer, sub_layer) local config = { - minzoom = sub_layer.tiles.minzoom or 0, - maxzoom = sub_layer.tiles.maxzoom or 14, - extent = sub_layer.tiles.extent or 4096, - buffer = sub_layer.tiles.buffer_size or 10, + minzoom = sub_layer.tiles.minzoom or self.minzoom, + maxzoom = sub_layer.tiles.maxzoom or self.maxzoom, + extent = sub_layer.tiles.extent, + buffer = sub_layer.tiles.buffer_size, } local mvt = 'ST_AsMVTGeom("' .. sub_layer.geom_column .. '", {{unbuffered_bbox}}, {{extent}}, {{buffer}}) AS way' @@ -99,6 +99,8 @@ end function plugin:write_config(directory, options) self.directory = directory + self.minzoom = options.minzoom or 0 + self.maxzoom = options.maxzoom or 14 if not options then options = {} @@ -106,10 +108,10 @@ function plugin:write_config(directory, options) local config = { metadata = { - id = 'v1', - name = options.tileset or 'osm', + id = options.tileset or 'mytiles', + name = options.name, attribution = options.attribution or plugin.themepark.options.attribution, - version = '0.0.1', + version = options.version, }, vector_layers = {} }