From 3aace87326d031397bf43fea636cc45c2fe181c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20So=C5=82yga?= <113895660+wojtek19022@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:22:33 +0200 Subject: [PATCH 1/8] Added script for restriction of map extent --- library/ui/restrict-extent.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 library/ui/restrict-extent.js diff --git a/library/ui/restrict-extent.js b/library/ui/restrict-extent.js new file mode 100644 index 0000000..fbd058e --- /dev/null +++ b/library/ui/restrict-extent.js @@ -0,0 +1,5 @@ +lizMap.events.on({ + uicreated: function(e) { + lizMap.map.restrictedExtent = lizMap.map.maxExtent; + } + }); \ No newline at end of file From a9e6955ac3ed8a21bf29f7b6274aa793eec84e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20So=C5=82yga?= <113895660+wojtek19022@users.noreply.github.com> Date: Wed, 25 Sep 2024 15:00:44 +0200 Subject: [PATCH 2/8] Change of a signal to fire action --- library/ui/restrict-extent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ui/restrict-extent.js b/library/ui/restrict-extent.js index fbd058e..deeec15 100644 --- a/library/ui/restrict-extent.js +++ b/library/ui/restrict-extent.js @@ -1,5 +1,5 @@ lizMap.events.on({ - uicreated: function(e) { + mapcreated: function(e) { lizMap.map.restrictedExtent = lizMap.map.maxExtent; } }); \ No newline at end of file From 7e1ec6c8eb4754004c50e494361c757aa6d47ff0 Mon Sep 17 00:00:00 2001 From: wojtek19022 <113895660+wojtek19022@users.noreply.github.com> Date: Fri, 18 Oct 2024 01:33:59 +0200 Subject: [PATCH 3/8] Changed directory up to standards --- .../restrict-extent-3.7.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename library/ui/{restrict-extent.js => restrict-extent/restrict-extent-3.7.js} (100%) diff --git a/library/ui/restrict-extent.js b/library/ui/restrict-extent/restrict-extent-3.7.js similarity index 100% rename from library/ui/restrict-extent.js rename to library/ui/restrict-extent/restrict-extent-3.7.js From 0a85987699af5879b0a1c881c1874c947c668b04 Mon Sep 17 00:00:00 2001 From: wojtek19022 <113895660+wojtek19022@users.noreply.github.com> Date: Fri, 18 Oct 2024 01:35:20 +0200 Subject: [PATCH 4/8] Change of name for a file --- .../{restrict-extent-3.7.js => restrict-extent_3.7.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename library/ui/restrict-extent/{restrict-extent-3.7.js => restrict-extent_3.7.js} (100%) diff --git a/library/ui/restrict-extent/restrict-extent-3.7.js b/library/ui/restrict-extent/restrict-extent_3.7.js similarity index 100% rename from library/ui/restrict-extent/restrict-extent-3.7.js rename to library/ui/restrict-extent/restrict-extent_3.7.js From 9c5c7c4c6e3508dcf3343b4d633c584b562a6d6d Mon Sep 17 00:00:00 2001 From: wojtek19022 <113895660+wojtek19022@users.noreply.github.com> Date: Sat, 2 Nov 2024 12:06:04 +0100 Subject: [PATCH 5/8] Added README --- library/ui/restrict-extent/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 library/ui/restrict-extent/README.md diff --git a/library/ui/restrict-extent/README.md b/library/ui/restrict-extent/README.md new file mode 100644 index 0000000..c703981 --- /dev/null +++ b/library/ui/restrict-extent/README.md @@ -0,0 +1,3 @@ +## Resctrict area + +Script limits an area for a user to go around a map. For example if you have data only in a certain country, you can limit an area of a map to a certain predefined in QGIS extent like at the video below. \ No newline at end of file From 3dce72a685ad82829e01428dfb67c9e99db9a011 Mon Sep 17 00:00:00 2001 From: wojtek19022 <113895660+wojtek19022@users.noreply.github.com> Date: Sat, 2 Nov 2024 12:13:18 +0100 Subject: [PATCH 6/8] Added restrict-extent to root README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index c494a9b..7c6c89b 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,9 @@ be designed for a special need of a project or a customer. The API on Lizmap Web Client is not guaranteed across versions. So the compatibility with Lizmap Web Client is not guaranteed as well on this repository. They aren't any tests suite done on these snippets to avoid regression. +Each JavaScript file is naming following the pattern `custom_feature_X.Y.js` where `X.Y` is targeting the LWC version when +the script was written. + ## Scripts ### API @@ -69,6 +72,7 @@ guaranteed as well on this repository. They aren't any tests suite done on these ### UI * [Add documentation](./library/ui/add_documentation) with buttons and a dock +* [Display a right-docked table of data](./library/ui/data_table) * [Background selector](./library/ui/background_selector), like on Google Maps * [Hide value popup](./library/ui/hide_value_popup) * [Measure tool custom style](./library/ui/measure_tool_custom_style) @@ -82,10 +86,12 @@ guaranteed as well on this repository. They aren't any tests suite done on these * [Export attribute table to CSV](./library/ui/export-attributetable-csv) * [Add button to toggle dock full width](./library/ui/add_dock_resize_button) * [Add a hard-coded legend at the bottom of the map](./library/ui/add_hard_coded_legend_at_map_bottom) +* [Show a global legend image for all visible layers](./library/ui/show_global_legend_image) * [Add placeholder to input/textarea elements](./library/ui/add_placeholder_on_text_controls) * [Permalink copy to clipboard instead of link](./library/ui/copy-permalink) * [Move Layers button after Information](./library/ui/move-button) * [Activate geolocation at startup](./library/ui/activate-geolocation) +* [Restrict extent](./library/ui/restrict-extent) * Deprecated since LWC 3.7 * [Group collapse](./library/ui/group_collapse), use a QGIS theme and the checkbox at the "Layers" tab in the plugin * [Expand/collapse legend when layer toggled](./library/ui/expand-collapse-legend-when-layer-toggled), use a QGIS theme and the checkbox at the "Layers" tab in the plugin From 9c6eedd746bec36f6d9180f4b61f6f31a49df48f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20So=C5=82yga?= <113895660+wojtek19022@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:16:04 +0100 Subject: [PATCH 7/8] Fix of README and allow restrict-extent for other lizmap versions --- library/ui/restrict-extent/README.md | 2 +- .../{restrict-extent_3.7.js => restrict-extent.js} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename library/ui/restrict-extent/{restrict-extent_3.7.js => restrict-extent.js} (100%) diff --git a/library/ui/restrict-extent/README.md b/library/ui/restrict-extent/README.md index c703981..71c2555 100644 --- a/library/ui/restrict-extent/README.md +++ b/library/ui/restrict-extent/README.md @@ -1,3 +1,3 @@ ## Resctrict area -Script limits an area for a user to go around a map. For example if you have data only in a certain country, you can limit an area of a map to a certain predefined in QGIS extent like at the video below. \ No newline at end of file +Script limits an area for a user to go around a map. For example if you have data only in a certain country, you can limit an area of a map to a certain predefined in QGIS extent. diff --git a/library/ui/restrict-extent/restrict-extent_3.7.js b/library/ui/restrict-extent/restrict-extent.js similarity index 100% rename from library/ui/restrict-extent/restrict-extent_3.7.js rename to library/ui/restrict-extent/restrict-extent.js From c34bbcde520b2f451539af2fd602e219f5a21967 Mon Sep 17 00:00:00 2001 From: wojtek19022 <113895660+wojtek19022@users.noreply.github.com> Date: Wed, 13 Nov 2024 00:44:20 +0100 Subject: [PATCH 8/8] changed name for a restrict extent script --- .../{restrict-extent.js => restrict-extent_3.8.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename library/ui/restrict-extent/{restrict-extent.js => restrict-extent_3.8.js} (100%) diff --git a/library/ui/restrict-extent/restrict-extent.js b/library/ui/restrict-extent/restrict-extent_3.8.js similarity index 100% rename from library/ui/restrict-extent/restrict-extent.js rename to library/ui/restrict-extent/restrict-extent_3.8.js