diff --git a/src/app/map/map.component.ts b/src/app/map/map.component.ts index 2060143..8c794c3 100644 --- a/src/app/map/map.component.ts +++ b/src/app/map/map.component.ts @@ -25,8 +25,8 @@ export class MapComponent implements AfterViewInit { lineStyle: Style = new Style({ stroke: new Stroke({ - color: "blue", - width: 2 + color: "#ff622e", + width: 3 }) }) @@ -72,6 +72,9 @@ export class MapComponent implements AfterViewInit { this.map.removeLayer(this.map.getLayers().item(1)) this.map.addLayer(vectorLayer); + this.map.getView().setCenter(fCoordinates[0]) + this.map.getView().setZoom(13); + // this.features = new GeoJSON().readFeatures(new openLayersGeoJSON()) /* diff --git a/src/app/search/search.component.html b/src/app/search/search.component.html index 13d0615..a3bccce 100644 --- a/src/app/search/search.component.html +++ b/src/app/search/search.component.html @@ -21,5 +21,5 @@ - - + + diff --git a/src/app/search/search.component.ts b/src/app/search/search.component.ts index 6be660a..e9fb4c4 100644 --- a/src/app/search/search.component.ts +++ b/src/app/search/search.component.ts @@ -22,7 +22,7 @@ export class SearchComponent { inputFromValue: string; inputToValue: string; - getRouteBtnEnabled: boolean = true; + isSearching: boolean = false; constructor( private pythonBackendService: PythonBackendService, @@ -47,6 +47,8 @@ export class SearchComponent { this.searchItemsFrom = []; this.searchItemsTo = []; + value = value.trim(); + this.pythonBackendService.sendSearchQueryRequest(value, "10") .subscribe((response: SearchResponse) => response.ways?.forEach(way =>{ if(isFrom){ @@ -60,17 +62,13 @@ export class SearchComponent { } getRoute(): void{ - this.getRouteBtnEnabled = false; + if(this.selectedSearchWayFrom && this.selectedSearchWayTo) + this.isSearching = true; this.pythonBackendService.sendRouteQueryRequest(this.selectedSearchWayFrom.id.toString(), this.selectedSearchWayTo.id.toString()) - .subscribe((response: RouteResponse) => { - console.log(response); + .subscribe( + (response: RouteResponse) => { this.emitter.emit(response); - this.getRouteBtnEnabled = true; - /* - this.mapComponent.updateSidebar(response); - this.mapComponent.drawPath(response); - */ - } - ); + this.isSearching = false; + }); } }