diff --git a/src/app/component/management/management.component.ts b/src/app/component/management/management.component.ts
index b62ba1b..048c2f3 100644
--- a/src/app/component/management/management.component.ts
+++ b/src/app/component/management/management.component.ts
@@ -6,6 +6,7 @@ import {ActivatedRoute} from "@angular/router";
import {LocationService} from "../../service/http/location.service";
import {UserService} from "../../service/http/user.service";
import {WaypointService} from "../../service/http/waypoint.service";
+import {toNumbers} from "@angular/compiler-cli/src/version_helpers";
@Component({
selector: 'app-home',
@@ -18,9 +19,9 @@ export class ManagementComponent implements OnInit {
showLocationForm: boolean = false;
showWaypointForm: boolean = false;
- newUser: UserEntity;
- newLocation: LocationEntity;
- newWaypoint: WaypointsEntity;
+ newUser: UserEntity = {name: "", password: "", username: ""};
+ newLocation: LocationEntity = {lat: 0, location: "", lon: 0, region: ""};
+ newWaypoint: WaypointsEntity = {description: "", img: "", lat: 0, locationName: "", lon: 0, name: ""};
locations: LocationEntity[] | undefined;
waypoints: WaypointsEntity[] | undefined;
@@ -56,15 +57,15 @@ export class ManagementComponent implements OnInit {
}
addLocation(name: string, region: string, lat: number, lon: number) {
- this.newLocation = {name: name, region: region, lat: lat, lon: lon};
+ this.newLocation = {location: name, region: region, lat: lat, lon: lon};
this.locationService.createLocation(this.newLocation).subscribe(location => {
this.locations?.push(location);
});
this.showLocationForm = false;
}
- addWaypoint(name: string, lat: string, lon: string, description: string, image: string, locationName: string) {
- this.newWaypoint = {name: name, lat: lat, lon: lon, description: description, img: image, locationName: locationName};
+ addWaypoint(name: string, lat: number, lon: number, description: string, image: string, locationName: string) {
+ this.newWaypoint = {description: description, img: image, lat: lat, locationName: locationName, lon: lon, name: name}
this.waypointService.createWaypoint(this.newWaypoint).subscribe(waypoint => {
this.waypoints?.push(waypoint);
});
@@ -94,4 +95,6 @@ export class ManagementComponent implements OnInit {
closeWaypointForm() {
this.showWaypointForm = false;
}
+
+ protected readonly String = String;
}
diff --git a/src/app/home/home.component.css b/src/app/home/home.component.css
index bc6241b..c48ebfd 100644
--- a/src/app/home/home.component.css
+++ b/src/app/home/home.component.css
@@ -1,12 +1,7 @@
.search {
- display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
- position: absolute;
- top: 35%;
- left: 50%;
- transform: translate(-50%, -50%);
}
input {
@@ -16,10 +11,8 @@ input {
}
#list {
- position: absolute;
- top: 46%;
- left: 44%;
- transform: translate(-50%, -50%);
+ align-self: center;
+ height: auto;
justify-content: center;
align-items: center;
align-content: center;
@@ -40,13 +33,13 @@ input {
}
.bg-image {
+ padding-top: 25%;
background-image: url('src/assets/img/mountains.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
- height: 100vh;
+ height: 94vh;
+ display: flex;
+ flex-direction: column;
}
-#translate{
- margin: 100px 10px 10px 10px;
-}
diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html
index 2545413..4a02806 100644
--- a/src/app/home/home.component.html
+++ b/src/app/home/home.component.html
@@ -1,6 +1,6 @@
-
+
-
+
- DE
@@ -19,9 +19,10 @@
- IT
- EN
-
+
+
diff --git a/src/app/interface/WaypointsEntity.ts b/src/app/interface/WaypointsEntity.ts
index 3c98648..7c52dba 100644
--- a/src/app/interface/WaypointsEntity.ts
+++ b/src/app/interface/WaypointsEntity.ts
@@ -1,5 +1,5 @@
export interface WaypointsEntity {
- id: number;
+ id?: number;
name: string;
lat: number;
lon: number;