activist icon indicating copy to clipboard operation
activist copied to clipboard

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

Open wkyoshida opened this issue 1 year ago • 4 comments

Terms

Description

Related to issues:

  • #621
  • #628

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 avatar Sep 03 '24 02:09 wkyoshida

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

wkyoshida avatar Sep 03 '24 02:09 wkyoshida

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?

andrewtavis avatar Sep 03 '24 06:09 andrewtavis

Hi, if this issue is still available I would be more than happy to work on it!

JerryW04 avatar Apr 09 '25 19:04 JerryW04

Hey @JerryW04 👋 This is definitely something we need to get to, but there might be others that are a bit more pressing right now. Specifically also the form for creating events is going to change in #841. Do you want to look into another issue maybe, or I could make a suggestion? Thanks for your interest in the platform and helping out! 😊

andrewtavis avatar Apr 12 '25 10:04 andrewtavis