Исправление. Сохранение видимости слоев.

Костыльное, но решение. Просто перенес инициализацию переключателя слоев после добавления слоев
This commit is contained in:
zakhy 2025-04-14 13:04:02 +07:00
parent 7fac9bcafd
commit d120fa5c87
2 changed files with 23 additions and 24 deletions

View File

@ -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) {

View File

@ -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 = "Многофункциональная система безопасности ОГР"