From af818ce10b9b2b6987b63521b025478a81785448 Mon Sep 17 00:00:00 2001 From: Janis Meister Date: Fri, 14 Jan 2022 13:11:44 +0100 Subject: [PATCH] added selectedPhoton obejct --- src/app/search/search.component.css | 6 +++--- src/app/search/search.component.ts | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/app/search/search.component.css b/src/app/search/search.component.css index c3cc574..f39611f 100644 --- a/src/app/search/search.component.css +++ b/src/app/search/search.component.css @@ -1,9 +1,9 @@ #inputFrom:focus + .autocomplete-items-from{ - display:block; + visibility:visible; } #inputTo:focus + .autocomplete-items-to{ - display:block; + visibility:visible; } .searchField{ @@ -31,7 +31,7 @@ } .autocomplete-items { - display:block; /* without debugging it should be display:none */ + visibility: visible; /* without debugging it should be display:none */ position: absolute; border: 1px solid #d4d4d4; border-bottom: none; diff --git a/src/app/search/search.component.ts b/src/app/search/search.component.ts index 0aeacb4..2310d5f 100644 --- a/src/app/search/search.component.ts +++ b/src/app/search/search.component.ts @@ -27,10 +27,14 @@ export class SearchComponent implements OnInit { longTo: number = 0; latTo: number = 0; + selectedPhotonFrom: Photon; + selectedPhotonTo: Photon; + constructor(private nominatimService: NominatimService, private photonService: PhotonService) { } selectPhoton(isFrom: boolean, p: Photon): void{ if(isFrom){ + this.selectedPhotonFrom = p; this.longFrom = p.geometry?.coordinates[0]; this.latFrom = p.geometry?.coordinates[1]; this.inputFromValue = p.properties.name @@ -48,6 +52,7 @@ export class SearchComponent implements OnInit { } }else{ + this.selectedPhotonTo = p; this.longTo = p.geometry?.coordinates[0]; this.latTo = p.geometry?.coordinates[1]; this.inputToValue = p.properties.name + " " + p.properties.countrycode;