Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align the map layer settings to MapStore #1965

Open
giohappy opened this issue Feb 12, 2025 · 1 comment · May be fixed by #1971
Open

Align the map layer settings to MapStore #1965

giohappy opened this issue Feb 12, 2025 · 1 comment · May be fixed by #1971
Assignees
Labels
Milestone

Comments

@giohappy
Copy link

Overview

We currently have a custom plugin for the layer settings, because when GeoNode 4 was developed a decision was taken to implement a custom logic for the management of the GFI template (managed on the side of GeoNode) and styles for a layer.

We have found out that this approach is problematic and having a custom behavior and code isn't probably worth it. The custom logic in GeoNode also lacks some features that are available with the default MapStore layer settings (e.g. managing and selecting multiple styles for a single map layer).
Moreover, the plan is to align even more with the GeoNode client and the MapStore projects to take advantage of shared resources and efforts.

What will change

By reverting to the MapStore default plugin the most relevant change to GeoNode is that the list of available and selectable styles is not tied to the specific maplayer instance (which is the instance of a dataset in a map) but global for the Geoserver layer behind the dataset.
It means that

  • users with view rights can view and select ANY of the styles available for the Geoserver layer behind the dataset
  • users with edit rights on the dataset can create and edit ANY style connected to the Geoserver layer behind the dataset

This is different from the current behavior, where a style is connected to the specific map layer. Users without view rights on the map couldn't see that style listed inside other maps.
We think this isn't a big concern. In case the privacy of a style is important, a duplicate Geoserver layer and dataset should be created, to be able to differentiate access rights to the connected styles.

Implementation notes

The custom settings will be replaced with the default MapStore layer settings plugin, taking into account the following peculiarities of the GeoNode context:

  • Feature template:
    • When a dataset is added to a map, it includes a feature template (default or customized on the GeoNode side), which is returned by the API response inside the featureinfo_custom_template property
    • The map will use this template for the new map layer, but when a user changes the template from the Feature Info tab of the layer settings, this will override the initial template.
  • Styles;
    • When a dataset is added to a map, it includes a default style (default or customized on the GeoNode side), which is returned by the API response inside the default_style property
    • The map will use this style for the new map layer, but when a user changes the selected style from the Style tab, the selected style will be set for the map layer AND will also be included as current_style property inside the maplayer object that is POSTed to GeoNode when saving the map. GeoNode's MapLayer object needs to know the style selected for a map layer for the rendering on thumbnails.

A few notes about the styles and the GeoNode API / models:

  • Now a maplayer contains both the current_style and an array of styles under the extra_params attribute. I think the latter is not needed anymore, since we will not keep the list of "available styles" inside the maplayer. The list of available styles come from Geoserver, as it happens with MapStore
    Image
  • By replacing the custom plugin with the default one we have noticed that the editing tools do not appear at the top of the Style panel, even if the current user has the change_dataset_style permission for the layer. To be investigated.
    Image
@giohappy giohappy added this to the 5.0.0 milestone Feb 12, 2025
@dsuren1
Copy link

dsuren1 commented Feb 17, 2025

Update

  • Issue currently targets only Map viewer
  • Improvement of style editor dataset will be addressed in a separate ticket
  • Reference issue in MS to allow setting permission for style editor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants