codeforsanjose / disaster-response-sj

Exploration of adding civic tech component to San Jose disaster response
MIT License
7 stars 12 forks source link

Allow Disaster Location Input/Editing Through Visual Editing of Map #88

Open sunnymui opened 4 years ago

sunnymui commented 4 years ago

As a UX enhancement, it would be easier if admin users could directly plot disaster locations on the map from the admin area.

This would also help in editing/expanding the location of a disaster in a visual manner; disaster areas can/do change over time and it can be a pain to convert written info to a map representation. Disasters also aren't always perfect circles area-wise so being able to draw polygonal shapes for a disaster affected area would be useful.

Maps are managed through the Leaflet module and OSM dat. We may gonna need to expose methods into the React app's state so the Leaflet module can send location data to the app. Or maybe we can subscribe the component to the Leaflet data?

Resources: https://brettdewoody.com/accessing-component-methods-and-state-from-outside-react/ [https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#adding-event-listeners-or-subscriptions] (https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#adding-event-listeners-or-subscriptions)