The selection context handles the adding. If no selection is active, a new one needs to be created.
This is more complicated than it sounds:
- if there is no selection, create a new one in the offline context and save to device, then update the internal list of selections.
- Then, load either the active Selection (if any), or the newly created selection.
- Push the new treeId to the selection.
- create a object of type
ActiveSelection, which includes the mutated selection in block scope and adds a .geoJSON feature to it. For this, all inventory features are loaded and filtered for the treeIds currently in the block-scoped selection.
- Calculate a new bounding box for the selection.
- set the block-scoped
ActiveSelection as a context state and pass down to all components in the application, which use this object.
The selection context handles the adding. If no selection is active, a new one needs to be created.
This is more complicated than it sounds:
ActiveSelection, which includes the mutated selection in block scope and adds a.geoJSONfeature to it. For this, all inventory features are loaded and filtered for the treeIds currently in the block-scoped selection.ActiveSelectionas a context state and pass down to all components in the application, which use this object.