From d120fa5c87f2981bfe15cae40ba2a000387cff82 Mon Sep 17 00:00:00 2001 From: zakhy <=> Date: Mon, 14 Apr 2025 13:04:02 +0700 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5.=20=D0=A1=D0=BE=D1=85=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B2=D0=B8=D0=B4=D0=B8=D0=BC?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D0=B8=20=D1=81=D0=BB=D0=BE=D0=B5=D0=B2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Костыльное, но решение. Просто перенес инициализацию переключателя слоев после добавления слоев --- apps/main/templates/main_index.html | 45 ++++++++++++++--------------- mfssogr/app_settings.py | 2 +- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/apps/main/templates/main_index.html b/apps/main/templates/main_index.html index 99c92bc..177f630 100644 --- a/apps/main/templates/main_index.html +++ b/apps/main/templates/main_index.html @@ -116,29 +116,6 @@ await mapCore.initialize(); - // Инициализация переключателя слоев - const LayerSwitcherInner = document.getElementById('LayerSwitcherInner') - const layerSwitcher = new LayerSwitcher(mapCore, LayerSwitcherInner); - - layerSwitcher.addButton( - new ol.control.Button({ - html: "Создать слой", - handleClick: function () { - window.location.href = '{% url 'create_layer' %}'; - } - }), 'bottom' - ); - - layerSwitcher.addButton( - new ol.control.Button({ - html: "Редактировать слои", - handleClick: function () { - window.location.href = '{% url 'layers_list' %}'; - } - }), 'bottom' - ); - - // Инициализация менеджеров маркеров const gtoLayer = new ol.layer.Vector({source: new ol.source.Vector()}); gtoLayer.set('title', 'Горнотранспортное оборудование') @@ -269,6 +246,28 @@ await updateMarkers(); setInterval(updateMarkers, 3000); + + // Инициализация переключателя слоев + const LayerSwitcherInner = document.getElementById('LayerSwitcherInner') + const layerSwitcher = new LayerSwitcher(mapCore, LayerSwitcherInner); + + layerSwitcher.addButton( + new ol.control.Button({ + html: "Создать слой", + handleClick: function () { + window.location.href = '{% url 'create_layer' %}'; + } + }), 'bottom' + ); + + layerSwitcher.addButton( + new ol.control.Button({ + html: "Редактировать слои", + handleClick: function () { + window.location.href = '{% url 'layers_list' %}'; + } + }), 'bottom' + ); }); function formatDateToRussian(date) { diff --git a/mfssogr/app_settings.py b/mfssogr/app_settings.py index bf56801..128f250 100644 --- a/mfssogr/app_settings.py +++ b/mfssogr/app_settings.py @@ -42,7 +42,7 @@ INSTALLED_APPS = [ """Информация о приложении """ SITE_TITLE = "Многофункциональная система безопасности ОГР" SITE_TITLE_S = "МФСБ ОГР" -APP_VER = "1.0.13.2" +APP_VER = "1.0.13.3" APP_VEK = "2023 - 2025гг" APP_COPPIRIGHT = "Многофункциональная система безопасности ОГР"