added selectedPhoton obejct

This commit is contained in:
Janis Meister
2022-01-14 13:11:44 +01:00
parent 94d5725c42
commit af818ce10b
2 changed files with 8 additions and 3 deletions

View File

@@ -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;

View File

@@ -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 = <number> p.geometry?.coordinates[0];
this.latFrom = <number> p.geometry?.coordinates[1];
this.inputFromValue = <string> p.properties.name
@@ -48,6 +52,7 @@ export class SearchComponent implements OnInit {
}
}else{
this.selectedPhotonTo = p;
this.longTo = <number>p.geometry?.coordinates[0];
this.latTo = <number>p.geometry?.coordinates[1];
this.inputToValue = <string> p.properties.name + " " + p.properties.countrycode;