diff --git a/pygeoapi/templates/collections/edr/query.html b/pygeoapi/templates/collections/edr/query.html
index 7d90dba..af426c7 100644
--- a/pygeoapi/templates/collections/edr/query.html
+++ b/pygeoapi/templates/collections/edr/query.html
@@ -14,9 +14,15 @@
+ {% if data.type == "Coverage" or data.type == "CoverageCollection" %}
+ {% elif data.type == "Feature" or data.type == "FeatureCollection" %}
+
+
+
+ {% endif %}
{% endblock %}
{% block body %}
@@ -36,6 +42,7 @@
}
));
+ {% if data.type == "Coverage" or data.type == "CoverageCollection" %}
var layers = L.control.layers(null, null, {collapsed: false}).addTo(map)
CovJSON.read(JSON.parse('{{ data | to_json | safe }}')).then(function (cov) {
@@ -57,7 +64,28 @@
layers: [layer]
}).setLatLng(e.latlng).openOn(map)
})
+ {% elif data.type == "Feature" or data.type == "FeatureCollection" %}
+ var geojson_data = {{ data | to_json | safe }};
+ 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 %} + '';
+ layer.bindPopup(html);
+ }
+ });
+ {% if data.type == "FeatureCollection" and data['features'][0]['geometry']['type'] == 'Point' %}
+ var markers = L.markerClusterGroup({
+ disableClusteringAtZoom: 9,
+ chunkedLoading: true,
+ chunkInterval: 500,
+ });
+ markers.clearLayers().addLayer(items);
+ map.addLayer(markers);
+ {% else %}
+ map.addLayer(items);
+ {% endif %}
+ map.fitBounds(items.getBounds(), {maxZoom: 15});
+ {% endif %}
{% endif %}
{% endblock %}