UNPKG

@geogirafe/lib-geoportal

Version:

GeoGirafe is a flexible application to build online geoportals.

22 lines (21 loc) 722 B
export default class InterfaceSerializer { context; constructor(context) { this.context = context; } get state() { return this.context.stateManager.state; } brainSerialize(graphicalInterface) { const shared = { searchComponentVisible: graphicalInterface.searchComponentVisible, basemapComponentVisible: graphicalInterface.basemapComponentVisible }; return JSON.stringify(shared); } brainDeserialize(str) { const shared = JSON.parse(str); this.state.interface.searchComponentVisible = shared.searchComponentVisible; this.state.interface.basemapComponentVisible = shared.basemapComponentVisible; } }