From e481891f7cfb4fd6c370c92c1aedfd248ec59152 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Wed, 23 Dec 2020 12:51:24 -0500 Subject: [PATCH] fix item STAC HTML map --- pygeoapi/templates/stac/item.html | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pygeoapi/templates/stac/item.html b/pygeoapi/templates/stac/item.html index a2754a0..3067995 100644 --- a/pygeoapi/templates/stac/item.html +++ b/pygeoapi/templates/stac/item.html @@ -79,8 +79,6 @@ - - {% endblock %} @@ -95,10 +93,13 @@ attribution: '{{ config['server']['map']['attribution'] }}' } )); - var geojson_data = {{ data |to_json }}; - var items = new L.GeoJSON(geojson_data); - - map.addLayer(items); - map.fitBounds(items.getBounds(), {maxZoom: 10}); + var bbox_layer = L.polygon([ + [{{ data['extent']['spatial']['bbox'][1] }}, {{ data['extent']['spatial']['bbox'][0] }}], + [{{ data['extent']['spatial']['bbox'][3] }}, {{ data['extent']['spatial']['bbox'][0] }}], + [{{ data['extent']['spatial']['bbox'][3] }}, {{ data['extent']['spatial']['bbox'][2] }}], + [{{ data['extent']['spatial']['bbox'][1] }}, {{ data['extent']['spatial']['bbox'][2] }}], + ]); + map.addLayer(bbox_layer); + map.fitBounds(bbox_layer.getBounds(), {maxZoom: 10}); {% endblock %}