-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathstyles.liquid
60 lines (59 loc) · 2.6 KB
/
styles.liquid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
# How to: have a liquid generated index page for GH-Pages, and
# maintain a static readme page for GitHub.com
# file: readme.liquid.md
# 1. Reads in the contents of index.md
# 2. liquid formatting is applied to index.md
# 3. Based on the [Front matter defaults](https://jekyllrb.com/docs/configuration/front-matter-defaults/)
# This file is rendered as _site/readme.md
# see _config.yml
# 4. Review _site/readme.md , and post it on GitHub as readme.md
# 5. cp tmp/_site/www/readme.md .
# code tmp/_site/www/styles.json
# cat tmp/_site/www/styles.json | json -0
permalink: styles.json
# https://maplibre.org/maplibre-gl-js-docs/style-spec/layers
# https://maplibre.org/maplibre-gl-js-docs/style-spec/sources/#raster
---
{% if jekyll.environment == "development" %}
[{% for source in site.data.tile %}{
"version": 8,
"metadata": "Made with liquid💦: RobLabs.com/xyz",
"name": "{{ source.name }}",
"bearing": 0,
"pitch": 0,
"zoom": {% if source.center %}{{ source.center[2] }} {% else %} 0{% endif %},
"center": {% if source.center %} [{{ source.center | join: ", " }}]{% else %} [0,0]{% endif %},
"sources": {
"imagery": {
"tilejson": "3.0.0",
"version": "1.0.0",
"name": "{{ source.name }}",
"description": "{{ source.description }}",
"attribution": {% if source.attribution %} "{{ source.attribution | join: ", " }}" {% else %} ""{% endif %},
"bounds": {% if source.bounds %} [{{ source.bounds | join: ", " }}]{% else %} [-180, -85.051129, 180, 85.051129]{% endif %},
"center": {% if source.center %}[{{ source.center | join: ", " }}]{% else %} [0,0]{% endif %},
"minzoom": {% if source.minzoom %}{{ source.minzoom }} {% else %} 0{% endif %},
"maxzoom": {% if source.maxzoom %}{{ source.maxzoom }} {% else %} 24{% endif %},
"scheme": {% if source.scheme %} "{{ source.scheme }}" {% else %} "xyz"{% endif %},
"volatile": false,
"type": "raster",
"tileSize": {% if source.tileSize %}{{ source.tileSize }} {% else %} 512{% endif %},
"tiles": [ {% if source.esri %} "{{ source.esri }}/tile/{z}/{y}/{x}" {% else %} "{{ source.tiles }}" {% endif %}]
}
},
"id": "{{ source.name }}",
"layers": [
{
"metadata": "",
"id": "{{ source.name }}",
"source": "imagery",
"minzoom": {% if source.minzoom %}{{ source.minzoom }} {% else %} 0{% endif %},
"maxzoom": {% if source.maxzoom %}{{ source.maxzoom }} {% else %} 24{% endif %},
"type": "raster",
"raster-opacity": 1,
"layout": { "visibility": "visible" }
}
]
},
{% endfor %}]{% endif %}