From a7a69786a918f39afea7bae93f7324407525e735 Mon Sep 17 00:00:00 2001 From: zakhy <=> Date: Wed, 15 Jan 2025 09:39:50 +0700 Subject: [PATCH] =?UTF-8?q?=D0=B3=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D1=8B=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B3=D1=80=20=D0=BF=D0=BE=20=D0=BD=D0=B0=D1=81?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/main/templates/main_index.html | 2 +- apps/main/views/views_main.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/main/templates/main_index.html b/apps/main/templates/main_index.html index 5681ff1..c30dcf3 100644 --- a/apps/main/templates/main_index.html +++ b/apps/main/templates/main_index.html @@ -318,7 +318,7 @@ mineBorderLayer = new ol.layer.Vector({ source: new ol.source.Vector({ - url: '/static/border.kml/', + url: '{{ kml_path }}', format: new ol.format.KML({extractStyles: false}), }), diff --git a/apps/main/views/views_main.py b/apps/main/views/views_main.py index 37af19f..179a040 100644 --- a/apps/main/views/views_main.py +++ b/apps/main/views/views_main.py @@ -26,14 +26,16 @@ def mainindex(request): try: if request.method == "GET": lon = str(float(settingsmodule.get_settings('longitude', - '86.10111978605353'))) # долгота центра + '86.10111978605353'))) # долгота центра lat = str(float(settingsmodule.get_settings('latitude', - '55.344251210827814'))) # широта + '55.344251210827814'))) # широта + kml_path = settingsmodule.get_settings('kml_path', '') context = generalmodule.get_context_template() context.update({ 'lon': lon.replace(',', '.'), 'lat': lat.replace(',', '.'), + 'kml_path': kml_path, 'updatepage': True, }) return render(request, 'main_index.html', context)