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

New filter "within radius of xxx meters" #269

Open
jholetschek opened this issue Apr 18, 2023 · 7 comments
Open

New filter "within radius of xxx meters" #269

jholetschek opened this issue Apr 18, 2023 · 7 comments
Labels
Section: Data exploration Has to do with the react components for data exploration Type: Enhancement New feature or request

Comments

@jholetschek
Copy link

The target group of the LAND hosted portals are also laymen, which might be interested in the direct surrounding. So a filter "all occurrences within xxx meters around my current location" would be nice.

Related to gbif/hp-land#10 (show current location in map)

@MortenHofft MortenHofft transferred this issue from gbif/hp-land Oct 3, 2023
@MortenHofft
Copy link
Member

MortenHofft commented Oct 6, 2023

We have such a filter in the API. But so far i've been avoiding it as I'm not sure how to implement it in a user friendly way. Not exactly sure technically either. I'm not sure how this work in different projections either. There is also something odd about drawing different geometries in on the map that behave differently (AND vs OR)

The simplest solution I can think of just now is to not draw the geometry in the map view. But only have it as a filter with coordinates and radius. possibly a map (in the filter popup) in mercator. I think Tissot circles are circles everywhere in mercator? And then restrict range to mercator as well.+-85 lat

@MortenHofft MortenHofft added Type: Enhancement New feature or request Section: Data exploration Has to do with the react components for data exploration labels Oct 6, 2023
@MortenHofft
Copy link
Member

MortenHofft commented Oct 13, 2023

I wonder if that audience is better served a different way altogether. Using that filter as an invisible background filter.
But with a different UI more targeted the casual user.

The occurrence search as it is is more of a nerdy tool. Not really well optimised for the one time random citizen user, despite my best efforts to make it simple. Just the fact that search is using scientific names is enough to make it confusing. And all the darwin core terms when viewing individual records do not help either.

Perhaps the use case you describe is better served by something like ALAs explore my area tool
https://biocache.ala.org.au/explore/your-area
I hear it is by far the most visited part of their site. Perhaps it is time that we implement something similar now that we start to have these portals.

@jholetschek
Copy link
Author

Yes, I agree. The filters are a bit nerdy, and the "explore my area" is something else.
Maybe this could be another tab - with the map centered on the current location and already zoom in? This wouldn't require an additional filter at all.

@MortenHofft
Copy link
Member

MortenHofft commented Oct 18, 2023

You could kind of hack that, by having an explore my area link on the homepage, that goes to the mapview and sets to mapcenter to the users location.

I've added an example here gbif/hp-land@c61f06c
That code was entirely generated by chatgpt btw. Which is why there is a weird json stringify of a float in there. I'll remove that

it could probably benefit from a loader. Getting the users location can be a slow process

UPDATE: I've added a loader

@MortenHofft
Copy link
Member

btw - I've made it so that it should attach to any link tags with the class gbifExploreMyAreaLink

@jholetschek
Copy link
Author

Wow... thanks Morten!
That's scary. Which question did you ask ChatGPT?

@MortenHofft
Copy link
Member

I ended with a dialog of 3 questions, but compiled to one question it would be

You are a programming assistent an expert in javascript. Could you please provide me with a function for an a tag click event, that when called will fetch the users location, store it in session storage and afterwards redirect to the href of the link tag?

The click event should attach to all links with class: exploreMyArea

And could you add a class "is-loading" to the link while fetching location please

the session storage items should be mapLat, mapLng and mapZoom=12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Section: Data exploration Has to do with the react components for data exploration Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants