fix apri in google maps url

This commit is contained in:
Flavio Bontà 2025-11-13 16:57:28 +01:00
parent 58d73b6631
commit 94eee4a484

View File

@ -414,8 +414,8 @@ export class StrutturePubblicheComponent {
? ', ' + struttura.struttura.numeroCivico ? ', ' + struttura.struttura.numeroCivico
: '' : ''
}`; }`;
address += `${struttura.struttura.cap} ${struttura.struttura.codiceLuogo.comune}`; address += `${struttura.struttura.cap} ${struttura.struttura.codiceLuogo.comune}(${struttura.struttura.codiceLuogo.siglaProvincia})`;
address += `${struttura.struttura.codiceLuogo.provincia ? '(' + struttura.struttura.codiceLuogo.siglaProvincia + ')' : ''}`; // address += `${struttura.struttura.codiceLuogo.provincia ? '(' + struttura.struttura.codiceLuogo.siglaProvincia + ')' : ''}`;
const destination = encodeURIComponent( const destination = encodeURIComponent(
`${struttura.struttura.nome}, ${address}`, `${struttura.struttura.nome}, ${address}`,
@ -430,6 +430,10 @@ export class StrutturePubblicheComponent {
if (this.calcolaIndirizzoDa) { if (this.calcolaIndirizzoDa) {
url = `${url}&origin=${this.calcolaIndirizzoDa}`; url = `${url}&origin=${this.calcolaIndirizzoDa}`;
} }
const luogo = this.cercaStruttureForm.controls.luogo.value;
if (luogo) {
url = `${url}, ${luogo.luogo}`;
}
url = `${url}&travelmode=${travelMode}`; url = `${url}&travelmode=${travelMode}`;
window.open(url, '_blank'); window.open(url, '_blank');