diff --git a/konova/views/map_proxy.py b/konova/views/map_proxy.py index 13920fd..5f3abc0 100644 --- a/konova/views/map_proxy.py +++ b/konova/views/map_proxy.py @@ -11,6 +11,8 @@ import requests from django.contrib.auth.decorators import login_required from django.http import JsonResponse, HttpRequest +from konova.sub_settings.proxy_settings import PROXIES + @login_required def map_client_proxy_view(request: HttpRequest): @@ -25,8 +27,11 @@ def map_client_proxy_view(request: HttpRequest): """ url = request.META.get("QUERY_STRING") - response = requests.get(url) - body = json.loads(response.content) + response = requests.get(url, proxies=PROXIES) + content = response.content + if isinstance(content, bytes): + content = content.decode("utf-8") + body = json.loads(content) if response.status_code != 200: return JsonResponse({ "status_code": response.status_code, diff --git a/templates/map/client/config.json b/templates/map/client/config.json index 1177cf1..f2907d6 100644 --- a/templates/map/client/config.json +++ b/templates/map/client/config.json @@ -84,6 +84,12 @@ { "url": "/client/proxy?https://www.geoportal.rlp.de/mapbender/geoportal/gaz_geom_mobile.php?outputFormat=json&resultTarget=web&searchEPSG={epsg}&maxResults=5&maxRows=5&featureClass=P&style=full&searchText={q}&name_startsWith={q}" }, + + "searchParcel": + { + "nameURL": "/client/proxy?https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_alkis/gem_search.php?placename={q}", + "parcelURL": "/client/proxy?https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_alkis/flur_search.php?gmk_gmn={district}&fln={field}&fsn_zae={parcelA}&fsn_nen={parcelB}&export=json" + }, "export": { @@ -134,6 +140,13 @@ "stroke": "#0080ff", "strokeWidth": 3, "pointRadius": 6 + }, + + "parcel": + { + "fill": "rgba( 127, 255, 255, 0.5 )", + "stroke": "#7fffff", + "strokeWidth": 3 } } } \ No newline at end of file diff --git a/templates/map/client/index.html b/templates/map/client/index.html index 4612cd2..d9a9cd9 100644 --- a/templates/map/client/index.html +++ b/templates/map/client/index.html @@ -4,7 +4,16 @@ - + + + + + + + + + +
@@ -23,8 +32,24 @@ - - + + + + + + + + + + + + + + + + + +