GEOLYTIX / xyz

An open source javascript framework for spatial data and application interfaces.
MIT License
87 stars 26 forks source link

Location update on geometry edit #1580

Open simon-leech opened 1 month ago

simon-leech commented 1 month ago

The geometry location entry module has it's own update method instead of using the location.update() method.

The reason for this being that we wanted geometry edits / updates to be immediate. ie. They don't require the user to save changes.

Having duplicate code for the geometry update method is not ideal. Especially if the geometry entry is linked other entries.

The easiest solution would be to call the location update method which would mean that any other outstanding changes are updated as well when a geometry value is modified.

jfitzpatrick17 commented 3 weeks ago

I think the user flow should be as followed:

Editing a location

  1. Click edit (whether this is the icon / button doesn't matter)
  2. Visual cue to show geometry is also in 'edit mode' e.g. colour change (red) or nodes are visible
  3. User makes a change to a text input - background changes to yellow (like it already does)
  4. User makes a change to geometry - geometry stays the different colour/nodes visible - message says 'Update' rather than save
  5. User hits save in the infoJ - text input saves, geometry saves & changes to original colour, dependents (e.g. population calculation) are run on new shape as user hits save

Adding a new location

  1. User draws polygon
  2. Different terminology to end the polygon drawing e.g. 'Complete' instead of 'Save' (can be decided) - shape remains in edit mode (colour change or visible nodes)
  3. If a user tries to clear the location, they are prompted to confirm if they want to close without saving their changes

Or a few alternative thoughts:

edit mode - the single icon controls a user editing information (turns orange when in edit mode), if they click it again they are no longer in 'edit mode' and this saves any changes (e.g. don't need to click the tick symbol) we could also force users to provide a polygon name after they add a new shape (but this could be annoying...)