Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
hdastageeri
hft_awado_app
Commits
48b4b086
Commit
48b4b086
authored
5 years ago
by
Ratnadeep Rajendra Kharade
Browse files
Options
Download
Email Patches
Plain Diff
displayed route manuevers on hire page.
parent
a3fb7931
master
18-design-feedback-page-2
20-ride-history-2
42-add-log-in-button-on-registration-page-add-extra-messages-for-email-and-password-validation
42-add-log-in-button-on-registration-page-add-extra-messages-for-email-and-password-validation-2
45-show-stepwise-navigation-instructions-on-my-ride-page
47-show-alternate-routes-for-bike-to-destination
48-create-a-common-service-for-getting-user-s-current-location-and-live-location
49-show-loading-page
50-add-dependencies-locally-to-improve-app-performance
51-while-navigating-between-pages-map-doesn-t-load-properly
52-page-loader-is-getting-displayed-everywhere
53-scrollining-in-ride-history
53-scrollining-in-ride-history-2
55-change-password
56-create-dummy-page-or-menu-for-hotline-contact
57-registration-not-working-from-app
58-add-flow-on-navigate-button-to-route-from-user-to-bike
60-create-common-theming-styles-and-colors
61-chnage-styles-for-bike-list-and-bug-fixes
62-change-in-feedback-workflow
63-password-reset-api-integration
64-close-button-on-home-page-to-redirect-to-bike-list
66-highlight-selected-route-from-list-of-different-routes
67-deactivate-user-api-integration
68-display-no-go-areas-on-map
69-add-launcher-icon-for-application-on-android
70-add-validation-for-feedback-should-not-be-empty
71-prediction-ui-implementation-send-location-of-bike-to-backend
72-feedback-toast-message
73-removal-here-maps-api-key
Show-Bike-details-when-bike-icon-is-clicked
search_functionality
1 merge request
!29
Resolve "Show stepwise navigation instructions on my ride page"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/hirebike/hirebike.page.html
+18
-1
src/app/hirebike/hirebike.page.html
src/app/hirebike/hirebike.page.ts
+53
-5
src/app/hirebike/hirebike.page.ts
with
71 additions
and
6 deletions
+71
-6
src/app/hirebike/hirebike.page.html
+
18
-
1
View file @
48b4b086
...
...
@@ -25,7 +25,22 @@
<div
class=
"bike-details-container"
>
<div
class=
"inner"
>
<div
class=
"button-container"
>
<ion-grid>
<ion-grid
*ngIf=
"isBikeHired"
class=
"directions"
>
<ion-item
class=
"waypoint-wrapper"
>
<span
[innerHTML]=
"wayPointsInfo"
></span>
</ion-item>
<ion-list
class=
"my-ion-list"
>
<ion-item
*ngFor=
"let maneuver of maneuverList"
>
<li><span
[className]=
"'arrow '+ maneuver.action"
></span><span
[innerHTML]=
"maneuver.instruction"
></span>
</li>
</ion-item>
<ion-item>
<li><span
[innerHTML]=
"routeSummary"
></span></li>
</ion-item>
</ion-list>
</ion-grid>
<ion-grid
*ngIf=
"!isBikeHired"
>
<ion-row>
<ion-col>
Bike Name
</ion-col>
<ion-col>
{{bikeDetails.name}}
</ion-col>
...
...
@@ -34,6 +49,8 @@
<ion-col>
Bike Location
</ion-col>
<ion-col>
{{address}}
</ion-col>
</ion-row>
</ion-grid>
<ion-grid>
<ion-row
*ngIf=
"!isBikeHired"
>
<ion-col>
<ion-button
size=
"medium"
expand=
"block"
(click)=
"startTrip()"
>
Start Trip
</ion-button>
...
...
This diff is collapsed.
Click to expand it.
src/app/hirebike/hirebike.page.ts
+
53
-
5
View file @
48b4b086
...
...
@@ -7,7 +7,9 @@ import { HttpClient, HttpHeaders } from '@angular/common/http';
import
{
Storage
}
from
'
@ionic/storage
'
;
import
{
ToastService
}
from
'
../services/toast.service
'
;
import
{
Router
}
from
'
@angular/router
'
;
import
{
MapDataService
}
from
'
../services/map-data.service
'
;
declare
var
H
:
any
;
@
Component
({
selector
:
'
app-hirebike
'
,
templateUrl
:
'
./hirebike.page.html
'
,
...
...
@@ -23,18 +25,39 @@ export class HirebikePage implements OnInit {
isBikeHired
=
false
;
noReservation
=
true
;
currentRoute
:
any
;
routeSummary
:
any
;
wayPointsInfo
:
any
;
startRideSubject
:
Subject
<
any
>
=
new
Subject
();
gotReservedBikeSubject
:
Subject
<
any
>
=
new
Subject
();
maneuverList
:
any
=
[];
constructor
(
private
geolocation
:
Geolocation
,
public
restService
:
RestService
,
public
httpClient
:
HttpClient
,
private
storage
:
Storage
,
private
toastService
:
ToastService
,
private
router
:
Router
)
{
this
.
platform
=
new
H
.
service
.
Platform
({
'
apikey
'
:
'
tiVTgBnPbgV1spie5U2MSy-obhD9r2sGiOCbBzFY2_k
'
});
private
router
:
Router
,
private
mapDataService
:
MapDataService
)
{
this
.
platform
=
new
H
.
service
.
Platform
({
'
apikey
'
:
'
tiVTgBnPbgV1spie5U2MSy-obhD9r2sGiOCbBzFY2_k
'
});
this
.
mapDataService
.
mapDataSubject
.
subscribe
(
receiveddata
=>
{
console
.
log
(
'
data received
'
);
console
.
log
(
receiveddata
);
this
.
currentRoute
=
receiveddata
;
let
content
=
''
;
content
+=
'
Total distance:
'
+
receiveddata
.
summary
.
distance
+
'
m.
'
;
content
+=
'
Travel Time:
'
+
Math
.
floor
(
receiveddata
.
summary
.
travelTime
/
60
)
+
'
minutes
'
+
(
receiveddata
.
summary
.
travelTime
%
60
)
+
'
seconds.
'
+
'
(in current traffic)
'
;
this
.
routeSummary
=
content
;
this
.
showRouteInfoPanel
(
receiveddata
);
let
waypointLabels
=
[];
for
(
let
i
=
0
;
i
<
receiveddata
.
waypoint
.
length
;
i
+=
1
)
{
waypointLabels
.
push
(
receiveddata
.
waypoint
[
i
].
label
)
}
this
.
wayPointsInfo
=
waypointLabels
.
join
(
'
-
'
);
});
}
ngOnInit
()
{
...
...
@@ -45,6 +68,31 @@ export class HirebikePage implements OnInit {
}
showRouteInfoPanel
(
route
)
{
// Add a marker for each maneuver
let
maneuverList
=
[];
for
(
let
i
=
0
;
i
<
route
.
leg
.
length
;
i
+=
1
)
{
for
(
let
j
=
0
;
j
<
route
.
leg
[
i
].
maneuver
.
length
;
j
+=
1
)
{
// Get the next maneuver.
let
maneuver
=
route
.
leg
[
i
].
maneuver
[
j
];
maneuverList
.
push
(
maneuver
);
// var li = document.createElement('li'),
// spanArrow = document.createElement('span'),
// spanInstruction = document.createElement('span');
// spanArrow.className = 'arrow ' + maneuver.action;
// spanInstruction.innerHTML = maneuver.instruction;
// li.appendChild(spanArrow);
// li.appendChild(spanInstruction);
// nodeOL.appendChild(li);
}
}
this
.
maneuverList
=
maneuverList
;
}
getReservedBike
()
{
this
.
storage
.
get
(
'
token
'
).
then
((
token
)
=>
{
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
...
...
@@ -64,7 +112,7 @@ export class HirebikePage implements OnInit {
this
.
bikeDetails
=
resp
.
data
;
this
.
noReservation
=
false
;
this
.
reverseGeocode
(
this
.
platform
,
this
.
bikeDetails
.
lat
,
this
.
bikeDetails
.
lon
);
//pass reserved bike subject here map
this
.
gotReservedBikeSubject
.
next
(
resp
.
data
);
},
(
reservedBikeError
)
=>
console
.
log
(
reservedBikeError
));
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets