Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
EbuDem committed Mar 24, 2023
2 parents 07b6112 + 0075678 commit 73bd203
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
<h1>{{'feldkalender.Title' | translate}}</h1>

<div *ngFor="let feldkalenderDto of feldkalenderArray">
{{feldkalenderDto.todo}}
<mat-card>
<mat-card-content>
<div>
{{feldkalenderDto.date|date:'dd.MM.yyyy HH:mm:ss'}}
</div>
<div>
{{feldkalenderDto.config}}
</div>
<div>
{{feldkalenderDto.points}}
</div>
</mat-card-content>
</mat-card>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ export class PostTrackingInfosComponent {
}

public onMapReady(map: google.maps.Map): void {

console.log("hey", map)
this.map = map;


const flightPlanCoordinates = [
{ lat: 46.947465, lng: 7.447447 },
{ lat: 46.9479432, lng: 7.4474513 },
{ lat: 46.947984813, lng: 7.447445322 },
{ lat: 46.9479551234232, lng: 7.44742321312 },
{ lat: 46.947975013123123, lng: 7.4473469322 },
];


const flightPath = new google.maps.Polygon({
paths: [flightPlanCoordinates],
Expand Down Expand Up @@ -94,10 +94,12 @@ export class PostTrackingInfosComponent {
return new google.maps.LatLng({lat: sumPos.lat, lng: sumPos.long}, true);
}

moveToCalendar()
moveToCalendar()
{
const feldkalenderArray = this.localStorageService.getFeldkalender();
const feldkalenderDto = new FeldkalenderDto();
feldkalenderDto.config = this.config;
feldkalenderDto.points = this.points;
feldkalenderArray.push(feldkalenderDto);
this.localStorageService.setFeldkalender(feldkalenderArray);
this.router.navigate(["/feldkalender"])
Expand All @@ -109,7 +111,7 @@ export class PostTrackingInfosComponent {
points.sort(function(a, b) {
return a.lat - b.lat || a.lng - b.lng;
});

// Find lower hull
var lower = [];
for (var i = 0; i < points.length; i++) {
Expand All @@ -118,7 +120,7 @@ export class PostTrackingInfosComponent {
}
lower.push(points[i]);
}

// Find upper hull
var upper = [];
for (var i = points.length - 1; i >= 0; i--) {
Expand All @@ -127,11 +129,11 @@ export class PostTrackingInfosComponent {
}
upper.push(points[i]);
}

// Concatenate and return hull
return lower.slice(0, lower.length - 1).concat(upper.slice(0, upper.length - 1));
}

// Compute cross product of vectors p1p2 and p2p3
cross(p1:any, p2:any, p3:any) {
return (p2.lat - p1.lat) * (p3.lng - p2.lng) - (p2.lng - p1.lng) * (p3.lat - p2.lat);
Expand Down
5 changes: 3 additions & 2 deletions agridator-frontend/src/app/dto/feldkalender-dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export class FeldkalenderDto {

todo = 'todo';
date = new Date();
config: any;
points: any[] = [];
}

0 comments on commit 73bd203

Please sign in to comment.