-
Notifications
You must be signed in to change notification settings - Fork 2
/
map_layers.json
50 lines (46 loc) · 1.88 KB
/
map_layers.json
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
---
---
{% comment %}
generate JSON metadata for each tile layer, including:
- name, date, source name and url (non-html)
- description, legend (html)
- utf grid template
{% endcomment %}
{
{% for layer in site.data.map_layers %}
{% capture teaser %}
<div class='attr-table keyline-all space-bottom1'>
<table><tbody>
{% for teaser in layer.tooltip_teaser %}
<tr class='small'>
<td class='capitalize strong'>{{teaser}}</td><td>{%raw%}{{{%endraw%}{{teaser}}{%raw%}}}{%endraw%}</td>
</tr>
{% endfor %}
</tbody></table>
</div>
<div class='col12 center micro quiet caps strong'>click for more feature information</div>
{% endcapture %}{% capture full %}
{% if layer.tooltip_photo %}
<img class='space-bottom1 center' src='{%raw%}{{{%endraw%}{{layer.tooltip_photo}}{%raw%}}}{%endraw%}' />
{% endif %}
<div class='attr-table keyline-all space-bottom1'>
<table><tbody>
{% for full in layer.tooltip_full %}
<tr class='small'>
<td class='capitalize strong'>{{full}}</td><td>{%raw%}{{{%endraw%}{{full}}{%raw%}}}{%endraw%}</td>
</tr>{% endfor %}
<tr class='small'><td class='capitalize strong'>Area</td><td>{%raw%}{{way_area}}{%endraw%}</td></tr>
</tbody></table>
</div>
{% endcapture %}
"{{layer.id}}": {
"name": "{{layer.name}}",
"description": "{{layer.description | replace:'"', "'" | strip_newlines}}",
"legend": "{{layer.legend | replace:'"', "'" | strip_newlines | replace:'site.baseurl', site.baseurl }}",
"date": "{{layer.date}}",
{% if layer.tooltip_teaser or layer.tooltip_full %}"template": "{%raw%}{{#__teaser__}}{%endraw%}{{teaser | strip_newlines}}{%raw%}{{/__teaser__}} {{#__full__}}{%endraw%}{{full | strip_newlines}}{%raw%}{{/__full__}}{%endraw%}",{% endif %}
"source_name": "{{layer.source.name}}",
"source_url": "{{layer.source.url}}"
}{% unless forloop.last %},{% endunless %}
{% endfor %}
}