Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a spatial filter for UI #1022

Merged
merged 3 commits into from
Sep 29, 2024
Merged

Conversation

pvgenuchten
Copy link
Contributor

@pvgenuchten pvgenuchten commented Sep 29, 2024

Overview

This adds a spatial filter option to UI.
Users can enable a bbox filter (or by adding the bbox parameter to url)
the bbox can be moved or resized, click apply to activate the filter

image

Related Issue / Discussion

#975

Additional Information

Common functionality works, operates against bbox=1,2,3,4, but not when a bbox is used in CQL

Let me know in which direction to further develop, or to convert to WIP?

Contributions and Licensing

(as per https://github.com/geopython/pycsw/blob/master/CONTRIBUTING.rst#contributions-and-licensing)

  • I'd like to contribute [feature X|bugfix Y|docs|something else] to pycsw. I confirm that my contributions to pycsw will be compatible with the pycsw license guidelines at the time of contribution.
  • I have already previously agreed to the pycsw Contributions and Licensing Guidelines

@@ -201,13 +211,29 @@
function facet(val){
location.href="{{updateurl('facets','facetprop')}}".replace('facetprop',val);
}
//if url has a bbox, enable the spatial filter
{% if 'bbox' in attrs.keys() and (attrs['bbox'].split('%2C')|length) == 4 %}
var bbox = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var bbox_tokens = attrs['bbox'].split('%2C')

var bbox = [
          [{{ bbox_tokens[1] }}, {{ bbox_tokens[0] }}], 
          [{{ bbox_tokens[3] }}, {{ bbox_tokens[2] }}]
        ]

@kalxas
Copy link
Member

kalxas commented Sep 29, 2024

Nice work @pvgenuchten !

@tomkralidis tomkralidis added this to the 3.0.0 milestone Sep 29, 2024
@tomkralidis tomkralidis merged commit 3ef21df into geopython:master Sep 29, 2024
3 checks passed
@pvgenuchten pvgenuchten deleted the spatial-filter branch September 29, 2024 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants