hajkmap / Hajk

A modern, full-featured OpenLayers based map viewer and editor
MIT License
123 stars 48 forks source link

Add theme management #1284

Open linusfj opened 1 year ago

linusfj commented 1 year ago

Description

Quick Layers is a feature to manage layers within the LayerSwitcher tab. The purpose of the feature is to get quick access to layers often used. One advantage of using Quick Layers is that a collection of layers can be included where not all of them need to be visible from the start. Layers can be added manually or loaded from pre-defined packages for all users. The package owner creates the Quick Layers, exports the settings to JSON, and the administrator registers the new package of Quick Layers. It will also be possible for the user to save, edit and load their own Quick Layers.


Proposed Features

image


Loading pre-defined Quick Layers

  1. Click the “Open” button in the LayerSwitcher to load pre-defined collections of layers.
  2. Choose a pre-defined Quick Layer package from the list.
  3. The selected Quick Layer package will load, replacing the current layers and settings in the LayerSwitcher tab.

image


Creating user-defined Quick Layer

  1. In the LayerSwitcher, press the “More” icon and click on the option “Add to Quick layers” to build a collection of layers.
  2. Click the “Person” button in the Quick Layers Group for personal packages.
  3. Enter a Title, Owner, and Description for the new Quick Layer collection.
  4. Click "Save" to create the user-defined Quick Layer collection.
  5. The newly created Quick Layer collection will be stored using Local Storage and is available to load.

image


Example of JSON structure

image


Implementation Steps

  1. Design Quick Layers structures and create a JSON example configuration with demo layers.
  2. Develop a "Load Quick layer" interface with search, filter, and info display capabilities.
  3. Implement Quick Layer loading functionality with confirmation dialogs and Snackbar notifications.
  4. Add "Load JSON" feature to import custom Quick Layer configurations.
  5. Add "Export to JSON" functionality for sharing and storing layer settings.
  6. Manage black and white backgrounds for packages.

Summary

Implement the Quick Layers feature in the LayerSwitcher tab to simplify loading, managing, and sharing pre-defined sets of layers and their associated settings.

jacobwod commented 1 year ago

Could you elaborate regarding themes? It can mean many different things, e.g. the light and dark mode themes we already have in Hajk.

linusfj commented 1 year ago

Themes in the context of the Active tab in the LayerSwitcher refers to a pre-defined set of active layers.

I've updated the description with additional information.

linusfj commented 1 year ago

The issue description has been updated to align with the new concept of Quick Layers, which has replaced Active Layers.