From 09ab7f3ece82f08cffea56e51de826e5b62acba9 Mon Sep 17 00:00:00 2001 From: Benjamin Webb Date: Mon, 22 Jun 2026 08:19:25 -0600 Subject: [PATCH 1/2] Small improvements to EDR HTML --- .../templates/collections/collection.html | 19 ++++++++++++++++++- pygeoapi/templates/collections/edr/query.html | 3 ++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/pygeoapi/templates/collections/collection.html b/pygeoapi/templates/collections/collection.html index b96e8c707..2b3904dcc 100644 --- a/pygeoapi/templates/collections/collection.html +++ b/pygeoapi/templates/collections/collection.html @@ -28,7 +28,7 @@

{{ data['title'] }}

-
+
@@ -88,6 +88,23 @@

{% trans %}Tiles{% endtrans %}

{% endfor %} {% endif %} + {%- if data['data_queries'] -%} +

Data Queries

+ + + + + + {% for query_name, query in data['data_queries'].items() %} + + + + + {% endfor %} + +
Query NameQuery Location
{{ query_name }}{{ query['link']['href'] }}
Note: EDR Queries may require query parameters not provided in the Query Location.
+ {%- endif -%} + {% if 'parameter_names' in data %}

Parameters

diff --git a/pygeoapi/templates/collections/edr/query.html b/pygeoapi/templates/collections/edr/query.html index 73c4e5b48..14ffd2d48 100644 --- a/pygeoapi/templates/collections/edr/query.html +++ b/pygeoapi/templates/collections/edr/query.html @@ -270,7 +270,8 @@ var items = new L.GeoJSON(geojson_data, { onEachFeature: function (feature, layer) { - var html = '' + {% if data['title_field'] %} feature['properties']['{{ data['title_field'] }}'] {% else %} feature.id {% endif %} + ''; + var url = '{{ data['query_path'] }}/' + feature.id + '?f=html'; + var html = '' + {% if data['title_field'] %} feature['properties']['{{ data['title_field'] }}'] {% else %} feature.id {% endif %} + ''; layer.bindPopup(html); } }); From 2a50e3bc76c211e2f940aa101cd5df00b43a045b Mon Sep 17 00:00:00 2001 From: Benjamin Webb Date: Mon, 22 Jun 2026 08:29:31 -0600 Subject: [PATCH 2/2] Conditionally create Data/Record collection sections --- pygeoapi/templates/collections/index.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pygeoapi/templates/collections/index.html b/pygeoapi/templates/collections/index.html index 123db386a..ccd9aa5c7 100644 --- a/pygeoapi/templates/collections/index.html +++ b/pygeoapi/templates/collections/index.html @@ -4,6 +4,15 @@ / {% trans %}Collections{% endtrans %} {% endblock %} {% block body %} + {% set collections = namespace(data=false, records=false) %} + {% for col in data['collections'] %} + {% if col.get('itemType') == 'record' %} + {% set collections.records = true %} + {% else %} + {% set collections.data = true %} + {% endif %} + {% endfor %} + {% if collections.data %}

{% trans %}Data collections in this service{% endtrans %}

@@ -31,6 +40,8 @@

{% trans %}Data collections in this service{% endtrans %}

+ {% endif %} + {% if collections.records %}

{% trans %}Record collections in this service{% endtrans %}

@@ -58,4 +69,5 @@

{% trans %}Record collections in this service{% endtrans %}

+ {% endif %} {% endblock %}