Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
t-rex-config.toml
shortbread_config
8 changes: 6 additions & 2 deletions config/shortbread.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<a href="https://www.openstreetmap.org/copyright">© OpenStreetMap</a>'
-- })

-- Enable if you want to create a taginfo project file.
--
Expand Down
8 changes: 6 additions & 2 deletions config/shortbread_gen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<a href="https://www.openstreetmap.org/copyright">© OpenStreetMap</a>'
-- })
end

-- ---------------------------------------------------------------------------
16 changes: 9 additions & 7 deletions lua/themepark/plugins/tilekiln.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -99,17 +99,19 @@ 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 = {}
end

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 = {}
}
Expand Down