Skip to content

Commit

Permalink
Merge pull request #1944 from asfadmin/andy/yoreley-slider
Browse files Browse the repository at this point in the history
Perpendicular slider now updates based upon saved view
  • Loading branch information
artisticlight authored Aug 13, 2024
2 parents 2c6be60 + 507f6e2 commit 99b27e1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export class SbasSlidersTwoComponent implements OnInit {
this.subs.add(
this.store$.select(filtersStore.getPerpendicularRange).subscribe(
perp => {
console.log('perp in getPerpendicularRange:', perp);
this.perpendicular = perp.start;
this.options.controls.meterDistance.setValue(this.perpendicular);
if (this.firstMeterLoad) {
Expand All @@ -133,6 +134,7 @@ export class SbasSlidersTwoComponent implements OnInit {
this.subs.add(
this.metersValues$.subscribe(
([start]) => {
console.log('start in metersValues$:', start);
const action = new filtersStore.SetPerpendicularRange({ start, end: null });
this.store$.dispatch(action);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export class SbasSlidersComponent implements OnInit {
public tempSlider;
public temporal: number;

private firstLoad = true;
// private firstLoad = true;
private lastValue = 0
private subs = new SubSink();

constructor(
Expand All @@ -41,6 +42,7 @@ export class SbasSlidersComponent implements OnInit {
this.subs.add(
baselineSlider.values$.subscribe(
([start]) => {
console.log('baselineSlider.values$ subscription start:', start);
const action = new filtersStore.SetPerpendicularRange({ start, end: null });
this.store$.dispatch(action);
}
Expand All @@ -50,11 +52,12 @@ export class SbasSlidersComponent implements OnInit {
this.subs.add(
this.store$.select(filtersStore.getPerpendicularRange).subscribe(
temp => {
console.log('getPerpendicularRange subscription temp:', temp);
this.temporal = temp.start;

if (this.firstLoad) {
if (this.lastValue !== this.temporal) {
this.tempSlider.set([this.temporal]);
this.firstLoad = false;
this.lastValue = this.temporal;
}
}
)
Expand Down
4 changes: 3 additions & 1 deletion src/app/services/saved-search.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ export class SavedSearchService {
this.store$.select(filtersStore.getDateRange),
this.store$.select(filtersStore.getSBASOverlapThreshold),]
).pipe(
map(([reference, customPairIds, sbasFilters,
map(([reference,
customPairIds,
sbasFilters,
dateRange, thresholdOverlap]) => ({
reference,
dateRange,
Expand Down

0 comments on commit 99b27e1

Please sign in to comment.