diff --git a/lizmap/dialogs/main.py b/lizmap/dialogs/main.py index 12c0ab37..c08440b0 100755 --- a/lizmap/dialogs/main.py +++ b/lizmap/dialogs/main.py @@ -208,6 +208,9 @@ def __init__(self, parent=None, is_dev_version=True, lwc_version: LwcVersions = self.label_link.setToolTip(tooltip) self.inLayerLink.setToolTip(tooltip) + self.automatic_permalink.setToolTip(tr( + "On every pan, zoom, toggle of a layer, the permalink can be automatically updated in the URL.")) + self.use_native_scales.setToolTip(tr( "It's recommended, for instance on EPSG:3857, text on an external tile will have a better rendering." )) diff --git a/lizmap/lizmap_api/config.py b/lizmap/lizmap_api/config.py index 5c053538..d17cd0ef 100755 --- a/lizmap/lizmap_api/config.py +++ b/lizmap/lizmap_api/config.py @@ -202,8 +202,11 @@ def __init__(self, project, fix_json=False): 'hideProject': { 'wType': 'checkbox', 'type': 'boolean', 'default': False }, + 'automatic_permalink': { + 'wType': 'checkbox', 'type': 'boolean', 'default': False, 'use_proper_boolean': True, + }, 'wms_single_request_for_all_layers': { - 'wType': 'checkbox', 'type': 'boolean', 'default': False + 'wType': 'checkbox', 'type': 'boolean', 'default': False, 'use_proper_boolean': True, }, 'tmTimeFrameSize': { 'wType': 'spinbox', 'type': 'integer', 'default': 10 diff --git a/lizmap/plugin.py b/lizmap/plugin.py index 5da6f55b..395f4495 100755 --- a/lizmap/plugin.py +++ b/lizmap/plugin.py @@ -457,6 +457,8 @@ def write_log_message(message, tag, level): # Scales self.dlg.use_native_scales, self.dlg.hide_scale_value, + # Permalink + self.dlg.automatic_permalink, ] self.lwc_versions[LwcVersions.Lizmap_3_8] = [ # Single WMS @@ -511,6 +513,7 @@ def write_log_message(message, tag, level): self.global_options['hideOverview']['widget'] = self.dlg.cbHideOverview self.global_options['hideNavbar']['widget'] = self.dlg.cbHideNavbar self.global_options['hideProject']['widget'] = self.dlg.cbHideProject + self.global_options['automatic_permalink']['widget'] = self.dlg.automatic_permalink self.global_options['wms_single_request_for_all_layers']['widget'] = self.dlg.checkbox_wms_single_request_all_layers self.global_options['tmTimeFrameSize']['widget'] = self.dlg.inTimeFrameSize self.global_options['tmTimeFrameType']['widget'] = self.dlg.liTimeFrameType @@ -3776,6 +3779,8 @@ def project_config_file( liz2json["options"]['maxScale'] = self.maximum_scale_value() if key == 'use_native_zoom_levels': liz2json["options"]['use_native_zoom_levels'] = self.dlg.use_native_scales.isChecked() + if key == 'automatic_permalink': + liz2json["options"]['automatic_permalink'] = self.dlg.automatic_permalink.isChecked() for key in self.layers_table.keys(): manager = self.layers_table[key].get('manager') diff --git a/lizmap/resources/ui/ui_lizmap.ui b/lizmap/resources/ui/ui_lizmap.ui index 424fc138..4df49a0a 100755 --- a/lizmap/resources/ui/ui_lizmap.ui +++ b/lizmap/resources/ui/ui_lizmap.ui @@ -795,21 +795,32 @@ QListWidget::item::selected { - - - Hide project in Lizmap Web Client - - - - - - - All the map layers will be loaded as a single WMS image - - - Load layers as single WMS layer - - + + + + + Hide project in Lizmap Web Client + + + + + + + All the map layers will be loaded as a single WMS image + + + Load layers as single WMS layer + + + + + + + Enable automatic permalink + + + + @@ -5399,6 +5410,7 @@ This is different to the map maximum extent (defined in QGIS project properties, server_combo scrollArea cbHideProject + automatic_permalink checkbox_wms_single_request_all_layers inAcl button_wizard_group_visibility_project