Skip to content

Conversation

@NinaRoeckeleinSWM
Copy link
Contributor

User Story

Our users want the ability to save custom layer presets and quickly switch between them, without losing the current map position.

Relevant scenarios include:

  • A user opens a link from another system to the QWC, which sets the correct map position. Now, they want to load their personalized layer configuration without loosing the location.
  • A user frequently needs to review several specific combinations of layers for a given location as a part of their workflow.

Implementation

  • This feature is built using the existing bookmarks service, by omitting center, scale and extent when saving a bookmark.
  • The original Bookmarks Plugin was generalized into a component to support both the standard Bookmarks plugin and the new LayerBookmarks plugin.

image 
image

Quick Select

  • Additionally, an optional quick select menu is added to the BottomBar. Allowing users to switch between their saved presets with less clicks.
image

Settings

  • The LayerBookmark can also be selected as a default theme in the settings.
image

Looking forward to feedback!

…hout changing map position

Adds new LayerBookmarks Plugin + Quick Select Menu in Bottom Bar
---------

Co-authored-by: Benedikt Seidl <[email protected]>
@NinaRoeckeleinSWM NinaRoeckeleinSWM changed the title LayerBookmarks Plugin: Save and restore layer bookmarks without map position LayerBookmarks Plugin: Save and restore layer bookmarks without changing map position Nov 11, 2025
@danceb
Copy link
Contributor

danceb commented Nov 11, 2025

Great Idea! Just a few thoughts on this.

As the functionality is very close to the existing bookmarks, I would prefer to extent the functionality of the bookmarks plugin instead of creating a new on with similar usability.
An option could be to introduce a toggle switch to load the bookmark with or without center/extent and scale next to the other buttons within the bookmarks panel.

There is already an option to set a default map theme per user within the theme selection panel by clicking the star symbol at a specific map theme. How is this considered here? So which default configuration "wins" when opening the map viewer, the map theme or the bookmark?

So if there is a solition for this, I would recommend to set the default bookmark like the map theme with introducing the possibility to click a similar star symbol within the list entry of a bookmark (for instance on the right side).
I think it is more understandable to set this within the plugin itself instead of within the settings planel.

@manisandro
Copy link
Member

manisandro commented Nov 13, 2025

Interesting functionality! As @danceb wrote, it would be interesting to integrate this into the existing bookmarks plugin. As far as I can see the core feature here is the quick switcher from the bottombar. What about the following behavior:

  • When opening a bookmark from the bookmarks panel, or when set as default map, then the bookmark is restored with center / extent as is already the case
  • When opening a bookmark fro the quick switcher, the center/extent of the bookmark to load is overridden with the current map extent
  • Optionally, an additional button could be added to the bookmarks panel to open the bookmark while preserving the current extent

@NinaRoeckeleinSWM
Copy link
Contributor Author

@danceb Regarding the selection of default themes/bookmarks: This PR does not change how the defaults are managed. There can only be one default per user (regardless if it is a theme, bookmark or layerbookmark). Choosing a new default will override the old one.

A star icon for setting defaults directly in the bookmark list would be a nice addition. We have dicussed the same idea here previously. We might implement this at some point in the future, but it is not within the scope of this PR.

@manisandro @danceb
Regarding your suggestion to integrate the new feature into the existing Bookmarks Plugin:
We considered this before starting development. Let me explain the why we decided to create a separate plugin.
a) Although being similar from a technical perspective, bookmarks (with locations) and layer visibilities (without locations) are distinct features for our users, serving different purposes.
b) Our users would like to manage both as seperate lists (not mixed together)
c) the bookmarks plugin is already button heavy and our users don't find it so easy to navigate as is. Adding more complexity to it could make the user experience worse.

image

So yes, we are confident that keeping the two plugins seperate is the preferable solution (at the very least for our instance and our users).

@manisandro
Copy link
Member

The issue I see is that the distinction between "layer visibility bookmarks" and "regular bookmarks" relies solely on the the query keys of the bookmark, say

const bookmarks = (this.props.bookmarks || []).filter(b => !b.data.query.c && !b.data.query.s);

This is fragile, for one a viewer can also be configured to store the extent in the url instead of center and scale. Furthermore, the query can also contain the 3D state, and the bookmark state can also contain redlining drawings etc. So it is misleading to call this a "layer visibility bookmark".

A functionality which has recently been added to QWC is support for the QGIS layer visibility presets (in QGIS they are called "themes"). These presets just store which layers are checked in the layertree, and which style is selected. I think this is actually much closer to what you are trying to store, see also

computeVisbilityPreset(layer) {
.

If layer visibilities are what is meant to be stored and restored, I would recommend introducing a dedicated table in the config_db (say qwc_config.user_visibility_presets). It would also have the big advantage that switching a preset would not reload the map, but just switch the layers.

@dominik-warch
Copy link
Contributor

I would like to support this suggestion. Predefined layer visibility sets are also something that our customer base uses.

In fact, it would be desirable to take this a step further and offer predefined selections that users can then expand themselves.

@NinaRoeckeleinSWM
Copy link
Contributor Author

Good points @manisandro. We'll try do rewrite this pull request based on the presets in LayerUtils. May take a little until we have time to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants