Skip to content

Commit c055e11

Browse files
committed
tilekiln: Make min/max zoom configurable and rely on defaults
Make the minzoom and maxzoom configurable for tilesets that don't run the 0-14 range, and make extent and buffer_size only appear in the config when set in the Lua. When not present tilekiln will rely on its defaults.
1 parent a646fb5 commit c055e11

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lua/themepark/plugins/tilekiln.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ local lyaml = require 'lyaml'
3333

3434
function plugin:build_sublayer_config(main_layer, sub_layer)
3535
local config = {
36-
minzoom = sub_layer.tiles.minzoom or 0,
37-
maxzoom = sub_layer.tiles.maxzoom or 14,
38-
extent = sub_layer.tiles.extent or 4096,
39-
buffer = sub_layer.tiles.buffer_size or 10,
36+
minzoom = sub_layer.tiles.minzoom or self.minzoom,
37+
maxzoom = sub_layer.tiles.maxzoom or self.maxzoom,
38+
extent = sub_layer.tiles.extent,
39+
buffer = sub_layer.tiles.buffer_size,
4040
}
4141

4242
local mvt = 'ST_AsMVTGeom("' .. sub_layer.geom_column .. '", {{unbuffered_bbox}}, {{extent}}, {{buffer}}) AS way'
@@ -99,6 +99,8 @@ end
9999

100100
function plugin:write_config(directory, options)
101101
self.directory = directory
102+
self.minzoom = options.minzoom or 0
103+
self.maxzoom = options.maxzoom or 14
102104

103105
if not options then
104106
options = {}

0 commit comments

Comments
 (0)