mirror of
https://github.com/DerTyp7/osm-routing-angular.git
synced 2025-11-01 13:42:30 +01:00
cleaned up
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
interface ResponseNode {
|
interface ResponseNode {
|
||||||
lat: number;
|
lat: number;
|
||||||
lon: number;
|
lon: number;
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
|
|
||||||
#map {
|
#map {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
|
|
||||||
<div class="searchField">
|
<div class="searchField">
|
||||||
|
|
||||||
<div class="autocomplete">
|
<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 class="autocomplete-items autocomplete-items-from">
|
||||||
<div *ngFor="let item of searchItemsFrom" (click)="select(true, item)">
|
<div *ngFor="let item of searchItemsFrom" (click)="select(true, item)">
|
||||||
<label>{{ item.name }}</label>
|
<label>{{ item.name }}</label>
|
||||||
@@ -10,9 +17,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="autocomplete" id="autocompleteTo">
|
<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 #inputautocompleteList class="autocomplete-items autocomplete-items-to">
|
||||||
<div *ngFor="let item of searchItemsTo" (click)="select(false, item)">
|
<div *ngFor="let item of searchItemsTo" (click)="select(false, item)">
|
||||||
<label>{{ item.name }}</label>
|
<label>{{ item.name }}</label>
|
||||||
@@ -21,5 +36,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button *ngIf="!isSearching" class="routeBtn" (click)="getRoute()">Route</button>
|
<ng-container *ngIfElse="isSearching" else routeBtn>
|
||||||
<img *ngIf="isSearching"src="/assets/images/loading.gif" style="margin-top:15px; margin-left:10px;width:25px;height: 25px;" />
|
<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();
|
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 => {
|
.subscribe((response: SearchResponse) => response.ways?.forEach(way => {
|
||||||
if (isFrom) {
|
if (isFrom) {
|
||||||
this.searchItemsFrom.push(way);
|
this.searchItemsFrom.push(way);
|
||||||
|
|||||||
Reference in New Issue
Block a user