NYCPlanning / labs-applicantmaps

5 stars 5 forks source link

Lot should reselect when someone comes back to their development site #486

Open hannahkates opened 5 years ago

hannahkates commented 5 years ago

When re-entering the lot selection mode for a dev or project site, new lot selections reset the current development site to an empty state.

This issue is closed when clicking new lots after revisit adds to the selection.

allthesignals commented 5 years ago

The "gotcha" here is that we've gotta convert the unioned output of the lot selector back into lots. This could technically lead to unexpected data loss because downstream changes could be made through draw which are rarely coterminous with actual lots.

allthesignals commented 5 years ago

A solution is to make the conversion back into lots through a simple intersection with the tax lots data and add that to the "selectedLots" list. Then things are back in a selectable state.

Drawback is - new network request?

ghost commented 5 years ago

why not maintain a list of lot ids on the model ? an array of ints feels less cumbersome than computing intersections with resources we have to fetch from the wild

allthesignals commented 5 years ago

That could work but the lot selector doesn't have any access to the actual model, it doesn't know about the other properties on it. Would have to do some re-configuring...