Skip to content

Commit

Permalink
split bbox once, as suggested by @tomkralidis
Browse files Browse the repository at this point in the history
  • Loading branch information
pvgenuchten committed Sep 29, 2024
1 parent 43834c0 commit d42ad08
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pycsw/ogc/api/templates/items.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,15 @@
function facet(val){
location.href="{{updateurl('facets','facetprop')}}".replace('facetprop',val);
}
var bbox;
//if url has a bbox, enable the spatial filter
{% if 'bbox' in attrs.keys() and (attrs['bbox'].split('%2C')|length) == 4 %}
var bbox = [
[{{ attrs['bbox'].split('%2C')[1] }}, {{ attrs['bbox'].split('%2C')[0] }}],
[{{ attrs['bbox'].split('%2C')[3] }}, {{ attrs['bbox'].split('%2C')[2] }}]
]
{% else %}
var bbox = null;
{% endif %}
{% if 'bbox' in attrs.keys() %}
{% set bbox_tokens = attrs['bbox'].split('%2C') %}
{% if bbox_tokens|length == 4 %}
bbox = [[{{
bbox_tokens[1] }}, {{ bbox_tokens[0] }}], [{{
bbox_tokens[3] }}, {{ bbox_tokens[2] }}]]
{% endif %}{% endif %}

//if filter enabled, apply the spatial filter
function apply_spatial_filter(){
Expand Down

0 comments on commit d42ad08

Please sign in to comment.