-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nav visual instructions base ready #25
Changes from all commits
35ef4d8
1185e3b
be07e3a
1c23df5
5257b70
a3d1e35
4b15cb3
f7bc32f
e8c0009
f7b56c7
260d911
6a7feb4
e8a48cd
51cdb58
d168bc7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,4 @@ testem.log | |
# System Files | ||
.DS_Store | ||
Thumbs.db | ||
/src/assets/config.json |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
.controlBarContainer { | ||
height: 30px; | ||
display: flex; | ||
} | ||
.remaining-distance-display-container { | ||
display: flex; | ||
flex-direction: column; | ||
align-content: space-around; | ||
position: relative; | ||
} | ||
|
||
.remain-span { | ||
position: absolute; | ||
top: 50%; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { select, Store } from '@ngrx/store'; | ||
import { SetActiveNavAction, SetShowSearchAction } from '../../store/nav.actions'; | ||
import { routePointSelector, routeSelector } from '../../store/nav.selectors'; | ||
import { SetNextWaypointIndexAction, SetPhrazeStateAction, SetShowSearchAction } from '../../store/nav.actions'; | ||
import { distanceToEndpointSelector, routePointsSelector } from '../../store/nav.selectors'; | ||
import { tap } from 'rxjs/operators'; | ||
import { PhrazeState } from '../../interface/nav.interface'; | ||
|
||
@Component({ | ||
selector: 'app-control-bar', | ||
|
@@ -11,19 +12,23 @@ import { tap } from 'rxjs/operators'; | |
}) | ||
export class ControlBarComponent implements OnInit { | ||
|
||
distanceToEndpoint$; | ||
|
||
constructor(private store: Store<any>) { } | ||
|
||
ngOnInit() { | ||
this.distanceToEndpoint$ = this.store.pipe(select(distanceToEndpointSelector)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No reason to be on init. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved. |
||
} | ||
|
||
openSearchPage() { | ||
this.store.dispatch(new SetShowSearchAction({isShowSearch: true})); | ||
} | ||
|
||
startNavigation() { | ||
this.store.dispatch(new SetActiveNavAction({isActiveNav: true})); | ||
this.store.dispatch(new SetPhrazeStateAction({phrazeState: PhrazeState.NAVIGATION})); | ||
this.store.dispatch(new SetNextWaypointIndexAction({nextWaypointIndex: 1})); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe should be part of set state reducer in order to avoid two actions |
||
this.store.pipe( | ||
select(routePointSelector), | ||
select(routePointsSelector), | ||
tap(route => { | ||
const from = <any>route[0]; | ||
const to = <any>route[route.length - 1]; | ||
|
@@ -44,7 +49,7 @@ export class ControlBarComponent implements OnInit { | |
window.removeEventListener('message', handleGetRouteCallback); | ||
window.postMessage({ | ||
type: 'playRoute', | ||
playbackRate: 1.5 | ||
playbackRate: 0.28 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be from configuration |
||
}, | ||
'*'); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div class="instructions-container"> | ||
in {{distanceToNextWaypoint$ | async}} {{nextWaypointManeuver$ | async}} to {{nextWaypointName$ | async}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same remark of how to display km/m in proper quantizations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
</div> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { InstructionsDisplayComponent } from './instructions-display.component'; | ||
|
||
describe('InstructionsDisplayComponent', () => { | ||
let component: InstructionsDisplayComponent; | ||
let fixture: ComponentFixture<InstructionsDisplayComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ InstructionsDisplayComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(InstructionsDisplayComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be displayed as integer and in quantizations (for distance of 10-100km should update every 10km, for 1-10km show update every 1km, for 100-1000m show update every 100m an so on).
Also, the display unit should be shown (km/m)
Please add an issue for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#33
please advise - this is not the way to our main competitor works.