Добавил плавную анимацию для нескольких источников

This commit is contained in:
2025-11-26 23:09:29 +03:00
parent cfaaae9360
commit d832171325
7 changed files with 1106 additions and 496 deletions

View File

@@ -1435,6 +1435,26 @@ function showSelectedSourcesOnMap() {
window.open(url, '_blank');
}
// Function to show playback animation for selected sources
function showPlaybackAnimation() {
if (!window.selectedSources || window.selectedSources.length === 0) {
alert('Список источников пуст');
return;
}
// Check if any source has points
const sourcesWithPoints = window.selectedSources.filter(source => parseInt(source.objitem_count) > 0);
if (sourcesWithPoints.length === 0) {
alert('Выбранные источники не содержат точек ГЛ');
return;
}
const selectedIds = window.selectedSources.map(source => source.id);
const url = '{% url "mainapp:multi_sources_playback_map" %}' + '?ids=' + selectedIds.join(',');
window.open(url, '_blank');
}
// Function to merge selected sources
function mergeSelectedSources() {
if (!window.selectedSources || window.selectedSources.length < 2) {
@@ -2065,6 +2085,9 @@ function showTransponderModal(transponderId) {
<button type="button" class="btn btn-outline-primary btn-sm" onclick="showSelectedSourcesOnMap()">
<i class="bi bi-map"></i> Карта
</button>
<button type="button" class="btn btn-outline-info btn-sm" onclick="showPlaybackAnimation()" title="Анимация движения объектов">
<i class="bi bi-play-circle"></i> Анимация
</button>
{% if user.customuser.role == 'admin' or user.customuser.role == 'moderator' %}
<button type="button" class="btn btn-outline-success btn-sm" onclick="mergeSelectedSources()">
<i class="bi bi-union"></i> Объединить