Skip to content

Commit

Permalink
Add option to deactivate search in layers
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo-Duke committed Feb 1, 2024
1 parent c12cb7c commit d05e9a9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
5 changes: 4 additions & 1 deletion project/locales/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-21 09:53+0000\n"
"POT-Creation-Date: 2024-01-31 15:45+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -214,6 +214,9 @@ msgstr ""
msgid "Define custom MapboxDraw style for the distance measure control"
msgstr ""

msgid "Enable search in layers in the search bar map control"
msgstr ""

msgid "Enable search in locations in the search bar map control"
msgstr ""

Expand Down
7 changes: 6 additions & 1 deletion project/locales/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-21 09:53+0000\n"
"POT-Creation-Date: 2024-01-31 15:45+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -227,6 +227,11 @@ msgid "Define custom MapboxDraw style for the distance measure control"
msgstr ""
"Définissez un style spécifique pour le contrôle des mesures sur la carte."

msgid "Enable search in layers in the search bar map control"
msgstr ""
"Active la recherche dans les couches via le contrôle de recherche sur la "
"carte."

msgid "Enable search in locations in the search bar map control"
msgstr "Active la recherche par lieu sur la carte."

Expand Down
6 changes: 6 additions & 0 deletions project/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@
_("Define custom MapboxDraw style for the distance measure control"),
"json_field",
),
"SEARCH_IN_LAYERS": (
True,
_("Enable search in layers in the search bar map control"),
bool,
),
"SEARCH_IN_LOCATIONS": (
False,
_("Enable search in locations in the search bar map control"),
Expand Down Expand Up @@ -393,6 +398,7 @@
"OPENID_DEFAULT_LOGIN_BUTTON_TEXT",
"MEASURE_CONTROL",
"MEASURE_DRAW_STYLES",
"SEARCH_IN_LAYERS",
"SEARCH_IN_LOCATIONS",
"SEARCH_IN_LOCATIONS_PROVIDER",
"NOMINATIM_URL",
Expand Down
1 change: 1 addition & 0 deletions project/visu/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def get(self, request, *args, **kwargs):
"enable": config.MEASURE_CONTROL,
"styles": config.MEASURE_DRAW_STYLES,
},
"searchInLayers": config.SEARCH_IN_LAYERS,
"searchInLocations": {
"enable": config.SEARCH_IN_LOCATIONS,
"searchProvider": self._get_search_provider_config(),
Expand Down
2 changes: 2 additions & 0 deletions project/visu/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def test_default_values(self):
"enable": False,
"styles": [],
},
"searchInLayers": True,
"searchInLocations": {
"enable": False,
"searchProvider": {"provider": "Nominatim", "options": {}},
Expand Down Expand Up @@ -108,6 +109,7 @@ def test_custom(self):
"enable": False,
"styles": [],
},
"searchInLayers": True,
"searchInLocations": {
"enable": True,
"searchProvider": {
Expand Down

0 comments on commit d05e9a9

Please sign in to comment.