mirror of
https://github.com/DerTyp7/osm-routing-angular.git
synced 2025-10-30 04:47:09 +01:00
cleaned up
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
interface ResponseNode {
|
||||
lat: number;
|
||||
lon: number;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
|
||||
#map {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user