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 Jan 26, 2024
1 parent c12cb7c commit 558503a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
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 558503a

Please sign in to comment.