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)