|
|
|
@ -2,6 +2,7 @@ import { CommonModule } from '@angular/common';
|
|
|
|
|
import { Component, Input } from '@angular/core';
|
|
|
|
|
import * as L from 'leaflet';
|
|
|
|
|
import { Pin } from '../../model/Pin';
|
|
|
|
|
import { PinService } from '../../services/pin/pin.service';
|
|
|
|
|
import { EditPinPopupComponent } from '../edit-pin-popup/edit-pin-popup.component';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
@ -15,6 +16,8 @@ export class PinMarkerComponent {
|
|
|
|
|
|
|
|
|
|
currentIndex: number = 0;
|
|
|
|
|
|
|
|
|
|
constructor(private pinService: PinService) {}
|
|
|
|
|
|
|
|
|
|
onClosePopup() {
|
|
|
|
|
this.marker.closePopup();
|
|
|
|
|
}
|
|
|
|
@ -26,7 +29,9 @@ export class PinMarkerComponent {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onDelete() {
|
|
|
|
|
// TODO: Implémenter l'action de suppression
|
|
|
|
|
this.pinService.deletePin(this.pin.id).subscribe(() => {
|
|
|
|
|
this.marker.remove();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get formattedDescription(): string {
|
|
|
|
|