Started to generate style.json...
1.pkl
// my first attempt to generate style.json from a pkl file.
version = 8
center { -122.42 37.80 }
zoom = 10.42
sources = import("sources.pkl")
sprite = "https://tile.openstreetmap.jp/styles/maptiler-toner-en/sprite"
glyphs = "https://tile.openstreetmap.jp/fonts/{fontstack}/{range}.pbf"
layers = new Listing {
import("background.pkl")
}
sources.pkl
module sources
openmaptiles {
type = "vector"
url = "https://tile.openstreetmap.jp/data/planet.json"
}
background.pkl
module background
id = "background"
paint { background_color = "#fff" }
Makefile
use_color:
pkl eval -f json use_color.pkl
1:
pkl eval -f json 1.pkl
Result
% make 1
pkl eval -f json 1.pkl
{
"version": 8,
"center": [
-122.42,
37.8
],
"zoom": 10.42,
"sources": {
"openmaptiles": {
"type": "vector",
"url": "https://tile.openstreetmap.jp/data/planet.json"
}
},
"sprite": "https://tile.openstreetmap.jp/styles/maptiler-toner-en/sprite",
"glyphs": "https://tile.openstreetmap.jp/fonts/{fontstack}/{range}.pbf",
"layers": [
{
"id": "background",
"paint": {
"background_color": "#fff"
}
},
{
"id": "cde"
}
]
}
hfu@smart pkl-test % make 1
pkl eval -f json 1.pkl
{
hfu@smart pkl-test % make 1
pkl eval -f json 1.pkl
{
"version": 8,
"center": [
-122.42,
37.8
],
"zoom": 10.42,
"sources": {
"openmaptiles": {
"type": "vector",
"url": "https://tile.openstreetmap.jp/data/planet.json"
}
},
"sprite": "https://tile.openstreetmap.jp/styles/maptiler-toner-en/sprite",
"glyphs": "https://tile.openstreetmap.jp/fonts/{fontstack}/{range}.pbf",
"layers": [
{
"id": "background",
"paint": {
"background_color": "#fff"
}
}
]
}
Top comments (0)