From c08f5145fe7d6b2455015e01d7c9f3c72d348459 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Mon, 12 Sep 2022 13:12:59 +0200 Subject: [PATCH 1/4] Netgis client update * adds new version to sources --- konova/views/map_proxy.py | 9 +- templates/map/client/config.json | 13 + templates/map/client/index.html | 31 +- .../5.12.0/webfonts/fa-brands-400.eot | Bin 131930 -> 0 bytes .../5.12.0/webfonts/fa-brands-400.ttf | Bin 131624 -> 0 bytes .../5.12.0/webfonts/fa-brands-400.woff | Bin 89100 -> 0 bytes .../5.12.0/webfonts/fa-brands-400.woff2 | Bin 75936 -> 0 bytes .../5.12.0/webfonts/fa-regular-400.eot | Bin 34390 -> 0 bytes .../5.12.0/webfonts/fa-regular-400.ttf | Bin 34092 -> 0 bytes .../5.12.0/webfonts/fa-regular-400.woff | Bin 16800 -> 0 bytes .../5.12.0/webfonts/fa-regular-400.woff2 | Bin 13576 -> 0 bytes .../5.12.0/webfonts/fa-solid-900.eot | Bin 194066 -> 0 bytes .../5.12.0/webfonts/fa-solid-900.ttf | Bin 193780 -> 0 bytes .../5.12.0/webfonts/fa-solid-900.woff | Bin 98996 -> 0 bytes .../5.12.0/webfonts/fa-solid-900.woff2 | Bin 76084 -> 0 bytes .../client/libs/jspdf/1.3.2/jspdf.debug.js | 412 ++-- .../map/client/libs/netgis/Attribution.css | 11 + .../map/client/libs/netgis/Attribution.js | 86 + templates/map/client/libs/netgis/Client.css | 47 + templates/map/client/libs/netgis/Client.js | 302 +++ templates/map/client/libs/netgis/Controls.css | 59 + templates/map/client/libs/netgis/Controls.js | 59 + templates/map/client/libs/netgis/Events.js | 68 + .../map/client/libs/netgis/LayerTree.css | 159 ++ templates/map/client/libs/netgis/LayerTree.js | 394 ++++ .../map/client/libs/netgis/LayerTypes.js | 14 + templates/map/client/libs/netgis/Map.css | 102 + templates/map/client/libs/netgis/Map.js | 20 + .../map/client/libs/netgis/MapOpenLayers.js | 1665 +++++++++++++++++ templates/map/client/libs/netgis/Menu.css | 118 ++ templates/map/client/libs/netgis/Menu.js | 249 +++ templates/map/client/libs/netgis/Modal.css | 160 ++ templates/map/client/libs/netgis/Modal.js | 592 ++++++ templates/map/client/libs/netgis/Modes.js | 27 + templates/map/client/libs/netgis/OWS.js | 237 +++ templates/map/client/libs/netgis/SLD.js | 79 + .../map/client/libs/netgis/SearchParcel.css | 131 ++ .../map/client/libs/netgis/SearchParcel.js | 428 +++++ .../map/client/libs/netgis/SearchPlace.js | 59 + templates/map/client/libs/netgis/Theme.css | 69 + templates/map/client/libs/netgis/Toolbar.css | 145 ++ templates/map/client/libs/netgis/Toolbar.js | 447 +++++ templates/map/client/libs/netgis/Util.js | 161 ++ templates/map/client/netgis.min.css | 2 +- templates/map/client/netgis.min.js | 158 +- 45 files changed, 6234 insertions(+), 279 deletions(-) create mode 100644 templates/map/client/libs/netgis/Attribution.css create mode 100644 templates/map/client/libs/netgis/Attribution.js create mode 100644 templates/map/client/libs/netgis/Client.css create mode 100644 templates/map/client/libs/netgis/Client.js create mode 100644 templates/map/client/libs/netgis/Controls.css create mode 100644 templates/map/client/libs/netgis/Controls.js create mode 100644 templates/map/client/libs/netgis/Events.js create mode 100644 templates/map/client/libs/netgis/LayerTree.css create mode 100644 templates/map/client/libs/netgis/LayerTree.js create mode 100644 templates/map/client/libs/netgis/LayerTypes.js create mode 100644 templates/map/client/libs/netgis/Map.css create mode 100644 templates/map/client/libs/netgis/Map.js create mode 100644 templates/map/client/libs/netgis/MapOpenLayers.js create mode 100644 templates/map/client/libs/netgis/Menu.css create mode 100644 templates/map/client/libs/netgis/Menu.js create mode 100644 templates/map/client/libs/netgis/Modal.css create mode 100644 templates/map/client/libs/netgis/Modal.js create mode 100644 templates/map/client/libs/netgis/Modes.js create mode 100644 templates/map/client/libs/netgis/OWS.js create mode 100644 templates/map/client/libs/netgis/SLD.js create mode 100644 templates/map/client/libs/netgis/SearchParcel.css create mode 100644 templates/map/client/libs/netgis/SearchParcel.js create mode 100644 templates/map/client/libs/netgis/SearchPlace.js create mode 100644 templates/map/client/libs/netgis/Theme.css create mode 100644 templates/map/client/libs/netgis/Toolbar.css create mode 100644 templates/map/client/libs/netgis/Toolbar.js create mode 100644 templates/map/client/libs/netgis/Util.js diff --git a/konova/views/map_proxy.py b/konova/views/map_proxy.py index 13920fd3..5f3abc01 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 1177cf15..f2907d67 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 4612cd25..d9a9cd9e 100644 --- a/templates/map/client/index.html +++ b/templates/map/client/index.html @@ -4,7 +4,16 @@ - + + + + + + + + + +
@@ -23,8 +32,24 @@ - - + + + + + + + + + + + + + + + + + +