Skip to content

Commit a646fb5

Browse files
committed
Allow tilekiln generation to specify metadata
Tilekiln configs can include optional data for the creation of a TileJSON document. All of the metadata is optional except for id, which is used for storage and construction of URLs. In the themepark config generation we set a default id, but otherwise it takes it from the options passed.
1 parent 110646a commit a646fb5

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
t-rex-config.toml
2+
shortbread_config

config/shortbread.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ if osm2pgsql.mode == 'create' then
6464
-- themepark:plugin('t-rex'):write_config('t-rex-config.toml', {})
6565

6666
-- Enable if you want to create a config file for the Tilekiln tile server.
67-
-- (You must also create the directory 'tk'.)
67+
-- (You must also create the directory 'shortbread_config'.)
6868
--
69-
-- themepark:plugin('tilekiln'):write_config('tk')
69+
-- themepark:plugin('tilekiln'):write_config('shortbread_config', {
70+
-- tileset = 'shortbread_v1',
71+
-- name = 'OpenStreetMap Shortbread',
72+
-- attribution = '<a href="https://www.openstreetmap.org/copyright">© OpenStreetMap</a>'
73+
-- })
7074

7175
-- Enable if you want to create a taginfo project file.
7276
--

config/shortbread_gen.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,13 @@ if osm2pgsql.mode == 'create' then
9696
-- })
9797

9898
-- Enable if you want to create a config file for the Tilekiln tile server.
99-
-- (You must also create the directory 'tk'.)
99+
-- (You must also create the directory 'shortbread_config'.)
100100
--
101-
-- themepark:plugin('tilekiln'):write_config('tk')
101+
-- themepark:plugin('tilekiln'):write_config('shortbread_config', {
102+
-- tileset = 'shortbread_v1',
103+
-- name = 'OpenStreetMap Shortbread',
104+
-- attribution = '<a href="https://www.openstreetmap.org/copyright">© OpenStreetMap</a>'
105+
-- })
102106
end
103107

104108
-- ---------------------------------------------------------------------------

lua/themepark/plugins/tilekiln.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ function plugin:write_config(directory, options)
106106

107107
local config = {
108108
metadata = {
109-
id = 'v1',
110-
name = options.tileset or 'osm',
109+
id = options.tileset or 'mytiles',
110+
name = options.name,
111111
attribution = options.attribution or plugin.themepark.options.attribution,
112-
version = '0.0.1',
112+
version = options.version,
113113
},
114114
vector_layers = {}
115115
}

0 commit comments

Comments
 (0)