konturio/disaster-ninja-fe

Core changes - refactor map related atoms architecture

Opened this issue · 2 comments

We have atoms architecture implying that we can only have 1 map in the app.
But now, we have another map on /bivariate-manager, and will have another one.

We need to refactor our existing architecture solution to be sure that we can have several independent maps.
After refactoring we want to be sure that one map won't affect another.

General idea:

  • have a class/atom/etc that will unite particular currentMapAtom, layersRegistry, layerOrderManager and other related entities like mountedLayersAtom, hiddenLayersAtom and etc.
  • all atoms that depends on currentMapAtom should depend on this new unit, as now we gonna work with particular map.

Several maps per app sounds like heavy stuff for browser, I think we would also need to think about perfomance.

When another map turned on - will we remove map DOM element or remove all the layers and sources and mount new ones?

We can reuse map engine and canvas, but for app logic if should look like different maps with independed states