1
- {% include "header .html" %}
1
+ {% extends "base .html" %}
2
2
{% if params %}
3
3
{% set urlq = url + '?' + params + '&' %}
4
4
{% else %}
5
5
{% set urlq = url + '?' %}
6
6
{% endif %}
7
7
8
+ {% block content %}
8
9
< nav aria-label ="breadcrumb ">
9
10
< ol class ="breadcrumb bg-light ">
10
11
{% for crumb in crumbs %} {% if not loop.last %}
21
22
</ ol >
22
23
</ nav >
23
24
24
- < h1 > Collection: {{ response.title or response.id }}</ h1 >
25
+ < h1 class ="my-4 ">
26
+ < span class ="d-block text-uppercase text-muted h6 mb-0 "> Collection:</ span >
27
+ {{ response.title or response.id }}
28
+ </ h1 >
25
29
26
30
< div class ="row ">
27
- < div class ="col-sm ">
28
- < p > {{ response.description or response.title or response.id }}</ p >
29
- {% if "keywords" in response and length(response.keywords) > 0 %}
30
- < div id ="keywords ">
31
- < p >
31
+ < div class ="col-md-7 ">
32
+ {% if response.description %}
33
+ < p > {{ response.description }}</ p >
34
+ {% endif %}
35
+ {% if "keywords" in response and response.keywords|length > 0 %}
36
+ < div class ="d-flex align-items-center mb-4 ">
37
+ {% include "icons/tag.html" %}
38
+ < ul class ="mb-0 pl-2 ">
32
39
{% for keyword in response.keywords %}
33
- < span class ="badge badge-secondary "> {{ keyword }}</ span >
40
+ < li class ="badge badge-secondary "> {{ keyword }}</ li >
34
41
{% endfor %}
35
- </ p >
42
+ </ lul >
36
43
</ div >
37
44
{% endif %}
38
45
@@ -43,40 +50,64 @@ <h2>Links</h2>
43
50
{% endfor %}
44
51
</ ul >
45
52
</ div >
46
- < div class ="col-sm ">
53
+ < div class ="col-md-5 ">
54
+ {% if response.license %}
55
+ < div class ="d-flex align-items-center mb-2 ">
56
+ {% include "icons/license.html" %}
57
+ < p class ="mb-0 pl-2 "> {{ response.license }}</ p >
58
+ </ div >
59
+ {% endif %}
60
+ {% if response.extent and response.extent.temporal %}
61
+ < div class ="d-flex align-items-center mb-2 ">
62
+ {% include "icons/clock.html" %}
63
+ < p class ="mb-0 pl-2 "> {{ response.extent.temporal.interval.0.0 or "..." }} — {{ response.extent.temporal.interval.0.1 or "..." }}</ p >
64
+ </ div >
65
+ {% endif %}
66
+ {% if response.extent and response.extent.spatial %}
47
67
< div id ="map " class ="rounded " style ="width: 100%; height: 400px ">
48
68
Loading...
49
69
</ div >
70
+ {% endif %}
50
71
</ div >
51
72
</ div >
52
73
74
+ {% if response.extent and response.extent.spatial %}
53
75
< script >
54
- $ ( function ( ) {
55
- var collection = { { response| tojson } } ;
56
- if ( collection . extent && collection . extent . spatial ) {
57
- var bbox = collection . extent . spatial . bbox [ 0 ]
58
- var bbox_polygon = L . polygon ( [
76
+ window . addEventListener ( "load" , function ( ) {
77
+ const collection = { { response| tojson } } ;
78
+ var map = L . map ( 'map' ) . setView ( [ 0 , 0 ] , 1 ) ;
79
+ map . addLayer ( new L . TileLayer (
80
+ 'https://tile.openstreetmap.org/{z}/{x}/{y}.png' , {
81
+ maxZoom : 18 ,
82
+ attribution : 'Map data © <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
83
+ }
84
+ ) ) ;
85
+
86
+ for ( let i = 0 , len = collection . extent . spatial . bbox . length ; i < len ; i ++ ) {
87
+ const options = i === 0 ? {
88
+ fill : false ,
89
+ weight : 2
90
+ } : {
91
+ color : "red" ,
92
+ fill : false ,
93
+ dashArray : 2 ,
94
+ weight : 1
95
+ } ;
96
+ const bbox = collection . extent . spatial . bbox [ i ] ;
97
+ const bbox_polygon = L . polygon ( [
59
98
[ bbox [ 1 ] , bbox [ 0 ] ] ,
60
99
[ bbox [ 1 ] , bbox [ 2 ] ] ,
61
100
[ bbox [ 3 ] , bbox [ 2 ] ] ,
62
101
[ bbox [ 3 ] , bbox [ 0 ] ]
63
- ] ) ;
102
+ ] , options ) ;
64
103
65
- var map = L . map ( 'map' ) . setView ( [ 0 , 0 ] , 1 ) ;
66
- map . addLayer ( new L . TileLayer (
67
- 'https://tile.openstreetmap.org/{z}/{x}/{y}.png' , {
68
- maxZoom : 18 ,
69
- attribution : 'Map data © <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
70
- }
71
- ) ) ;
72
104
73
105
map . addLayer ( bbox_polygon ) ;
74
- map . fitBounds ( bbox_polygon . getBounds ( ) ) ;
75
- } else {
76
- document . getElementById ( "map" ) . style . display = "none" ;
106
+ if ( i === 0 ) {
107
+ map . fitBounds ( bbox_polygon . getBounds ( ) ) ;
108
+ }
77
109
}
78
-
79
110
} ) ;
80
111
</ script >
81
-
82
- {% include "footer.html" %}
112
+ {% endif %}
113
+ {% endblock %}
0 commit comments