From 1d2f88eb14ee49990c8b8941290e9de15bd42007 Mon Sep 17 00:00:00 2001 From: Matteo Gheza Date: Tue, 2 Jan 2024 00:45:22 +0100 Subject: [PATCH] Add service code to map marker --- .../stats/stats-services/stats-services.component.html | 2 +- .../stats/stats-services/stats-services.component.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/_routes/stats/stats-services/stats-services.component.html b/frontend/src/app/_routes/stats/stats-services/stats-services.component.html index a434660..a717bb5 100644 --- a/frontend/src/app/_routes/stats/stats-services/stats-services.component.html +++ b/frontend/src/app/_routes/stats/stats-services/stats-services.component.html @@ -3,7 +3,7 @@

Numero di interventi: {{ serviceNumber }}

Mappa degli interventi

- +

Interventi per vigile

diff --git a/frontend/src/app/_routes/stats/stats-services/stats-services.component.ts b/frontend/src/app/_routes/stats/stats-services/stats-services.component.ts index cc61823..9437c90 100644 --- a/frontend/src/app/_routes/stats/stats-services/stats-services.component.ts +++ b/frontend/src/app/_routes/stats/stats-services/stats-services.component.ts @@ -191,7 +191,11 @@ export class StatsServicesComponent implements OnInit { for (let service of this.services) { const pos: LatLngTuple = [service.place.lat, service.place.lon]; serviceMapFitBoundsTuple.push(pos); - let marker = new Marker(pos); + let marker = new Marker(pos, { + title: service.code + }).on("click", (e) => { + console.log(e); + }); this.servicesMap.addMarker(marker); } this.servicesMap.setBounds(serviceMapFitBoundsTuple); @@ -215,8 +219,4 @@ export class StatsServicesComponent implements OnInit { if(this.lastRange !== this.range) this.loadServices(); this.lastRange = this.range; } - - serviceMapClick(e: any) { - console.log(e); - } }