DigitalCommons / land-explorer-front-end

React app for the Land Explorer front end
http://landexplorer.cc
GNU Affero General Public License v3.0
2 stars 0 forks source link

Save land ownership layer when saving a map #294

Open rogup opened 11 months ago

rogup commented 11 months ago

Description

The land ownership layer's state gets lost (e.g. the highlighted polygons and whether the layer is displayed) when a map is closed. It makes sense for this data to be saved like other layers and map objects.

This would speed up development a lot, when working on issues relating to land ownership. Since currently we have to repeat a lot of steps to get back to our previous state when reloading.

Acceptance Criteria

The land ownership layer returns to where we left off when a saved map is re-opened or the browser refreshes.

rogup commented 11 months ago

Part of this fix is in https://github.com/DigitalCommons/land-explorer-front-end/pull/295

To save the highlighted properties, a quick way would be to just include all the property data in the map data JSON. But we shouldn't do this, because the JSON could get too big. Maybe we should store them properly in the backend's database, like we do with drawn markers/polygons. We should be careful here too, to ensure we reduce load on the database and only include necessary data. e.g. we don't want to duplicate a load of data that's already in the property boundary service's DB. If a user saves thousands of properties e.g. those belonging to the Queen, maybe we should only certain values such as the polygon ID, name, rough coordinates, so they can then be fetched at runtime via the boundary service.

This is a fairly big task so not a priority. Will leave on the backlog.

lin-d-hop commented 11 months ago

I expect there may be other side effects to this as well, as there are still clunky UX elements that a map refresh works around. Hopefully we'll have resolved those before we get to this :)