cleaned up

This commit is contained in:
Janis Meister
2022-03-09 12:28:59 +01:00
parent 03f904b632
commit 27c01c9ca6
9 changed files with 99 additions and 83 deletions

View File

@@ -1,4 +1,3 @@
interface ResponseNode {
lat: number;
lon: number;

View File

@@ -1,6 +1,4 @@
#map {
width: 100%;
height: 100%;
}

View File

@@ -1,8 +1,15 @@
<div class="searchField">
<div class="autocomplete">
<input #inputFrom (click)="getValue(inputFrom.value, true)" (input)="getValue(inputFrom.value, true)" type="text" name="inputFrom" id="inputFrom" placeholder="From" value="{{ inputFromValue }}">
<input
#inputFrom
(click)="getValue(inputFrom.value, true)"
(input)="getValue(inputFrom.value, true)"
type="text"
name="inputFrom"
id="inputFrom"
placeholder="From"
value="{{ inputFromValue }}"
/>
<div class="autocomplete-items autocomplete-items-from">
<div *ngFor="let item of searchItemsFrom" (click)="select(true, item)">
<label>{{ item.name }}</label>
@@ -10,9 +17,17 @@
</div>
</div>
<div class="autocomplete" id="autocompleteTo">
<input #inputTo (click)="getValue(inputTo.value, false)" (input)="getValue(inputTo.value, false)" type="text" name="inputTo" id="inputTo" placeholder="To" value="{{ inputToValue }}">
<input
#inputTo
(click)="getValue(inputTo.value, false)"
(input)="getValue(inputTo.value, false)"
type="text"
name="inputTo"
id="inputTo"
placeholder="To"
value="{{ inputToValue }}"
/>
<div #inputautocompleteList class="autocomplete-items autocomplete-items-to">
<div *ngFor="let item of searchItemsTo" (click)="select(false, item)">
<label>{{ item.name }}</label>
@@ -21,5 +36,9 @@
</div>
</div>
<button *ngIf="!isSearching" class="routeBtn" (click)="getRoute()">Route</button>
<img *ngIf="isSearching"src="/assets/images/loading.gif" style="margin-top:15px; margin-left:10px;width:25px;height: 25px;" />
<ng-container *ngIfElse="isSearching" else routeBtn>
<img src="/assets/images/loading.gif" style="margin-top: 15px; margin-left: 10px; width: 25px; height: 25px" />
</ng-container>
<ng-template #routeBtn>
<button class="routeBtn" (click)="getRoute()">Route</button>
</ng-template>

View File

@@ -50,7 +50,7 @@ export class SearchComponent {
value = value.trim();
this.pythonBackendService.sendSearchQueryRequest(value, "10")
this.pythonBackendService.sendSearchQueryRequest(value, "10") // "10" -> limit of search results
.subscribe((response: SearchResponse) => response.ways?.forEach(way => {
if (isFrom) {
this.searchItemsFrom.push(way);