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

map: on event creation, allow location search and store location geometry #964

Open
2 tasks done
wkyoshida opened this issue Sep 3, 2024 · 2 comments
Open
2 tasks done
Labels
feature New feature or request

Comments

@wkyoshida
Copy link
Member

wkyoshida commented Sep 3, 2024

Terms

Description

Related to issues:

I believe I might've mentioned this idea before, but noting it down here finally..


When creating an event, it could be interesting for the user to be able to search for locations à la nominatim and for the creation page to then display a preview map for the user to check if a selected location is correct for their event.

  • For this, once a user searches for a location and selects it, the location's geometry that is returned in the response could then be used to pan to the location in the preview map.

With the event details and location confirmed, activist could then store the location's geometry to later use it to display on the event page's map.

  • For this, the idea could be for the location table (of issue 621) to be the one to store said geometry - by leveraging the PostGIS extension for Postgres.
  • With the geometry column in the location table, we have some flexibility in how we choose to store the location:
    • We could simply store the centroid coordinates for the location. This would be the easiest and cheapest.
    • We could store the bounding box (bbox) of the location. Imagine that this is essentially a box that surrounds the location. A bbox is helpful, since it's a cheap way to also still very roughly know how large/small a location is. This is useful for loading the map on the correct zoom level for that location. (My vote would be for this option).
    • We could store the full geometry for the location also if needed. For Berlin, for instance, imagine this is the multi-vertices polygon that represents the city limits/boundaries.

With the event page, we would then have a way to more appropriately set the zoom level and the map center that fits for the event's location.

Contribution

Happy to support someone on this or get to it myself 😁

@wkyoshida wkyoshida added the feature New feature or request label Sep 3, 2024
@wkyoshida
Copy link
Member Author

Noting that:

  • This could replace the current offline_location_lat and offline_location_long fields in
    Event
  • This could replace the current implementation in the map using a nominatim request to attempt to determine the location coordinates to display based on the location's name

@andrewtavis
Copy link
Member

I'd argue let's save both versions at the start and potentially delete the full geometry it it's not needed :) This makes tons of sense though! Would you be interested in putting this in events/create, @wkyoshida? I could edit the designs a bit and send something along?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Status: Todo
Development

No branches or pull requests

2 participants