Skip to content

Commit

Permalink
Update view.component.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
xonx4l authored Dec 1, 2023
1 parent 3b0e386 commit 7e1358a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/common/trajectories/view/view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ export class TrajectoriesViewComponent implements OnInit {

public zoomToGeometry: GeoJSON.LineString;

public zoomOut() {
// Calculate the new timespan by reducing the current timespan
const newTimespan = new Timespan(
this.timespan.from - (this.timespan.to - this.timespan.from) / 2,
this.timespan.to + (this.timespan.to - this.timespan.from) / 2
);

// Fetch new data based on the updated timespan
this.servicesConnector.getDatasetData(this.trajectory, newTimespan).subscribe(
data => {
this.graphData = data.values;
this.timespan = new Timespan(newTimespan.from, newTimespan.to);
this.selectedTimespan = new Timespan(newTimespan.from, newTimespan.to);
}
);
}

public timespan: Timespan;

public datasetIds: Array<string>;
Expand Down

0 comments on commit 7e1358a

Please sign in to comment.