up embed, add export docs

This commit is contained in:
Tykayn 2025-11-03 00:37:35 +01:00 committed by tykayn
parent 912b4da08e
commit b18c2c5aec
7 changed files with 414 additions and 33 deletions

View file

@ -1,4 +1,4 @@
import {Component, inject, signal, OnDestroy, OnInit} from '@angular/core';
import {Component, inject, signal, OnDestroy, OnInit, ViewChild} from '@angular/core';
import {Router, RouterLink} from '@angular/router';
import {FormsModule} from '@angular/forms';
import {Menu} from './menu/menu';
@ -38,6 +38,8 @@ export class Home implements OnInit, OnDestroy {
router = inject(Router);
private osmAuth = inject(OsmAuth);
@ViewChild('allEventsMap') allEventsMap!: AllEvents;
features: Array<any> = [];
filteredFeatures: Array<any> = [];
selected: any | null = null;
@ -273,6 +275,24 @@ export class Home implements OnInit, OnDestroy {
this.features = f ? [f] : [];
this.filteredFeatures = this.features;
this.updateAvailableWhatTypes();
// Sélectionner automatiquement l'événement et ouvrir le panel d'édition
if (f) {
this.selected = f;
this.showEditForm = true;
this.showOptions = true; // Afficher aussi le panel d'options
// Zoomer sur le marqueur de l'événement si la géométrie est disponible
const geometry = f.geometry;
if (geometry && geometry.type === 'Point' && geometry.coordinates && geometry.coordinates.length >= 2) {
const [lng, lat] = geometry.coordinates;
// Attendre que la carte soit initialisée avant de zoomer
setTimeout(() => {
if (this.allEventsMap) {
this.allEventsMap.centerOn([lng, lat], 16); // Zoom élevé pour voir le marqueur de près
}
}, 500);
}
}
this.isLoading = false;
},
error: () => {