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
acc6587e
Commit
acc6587e
authored
5 years ago
by
Rron Jahja
Browse files
Options
Download
Email Patches
Plain Diff
Initial Commit
parent
e67c971d
master
1-login-with-token-authentication
10-show-bikes-from-api-response-on-map
13-show-bike-details
14-api-integration-for-registration
15-find-the-street-name-by-geo-location-data
16-create-search-location-functionality
17-create-toast-message-service
18-design-feedback-page
18-design-feedback-page-2
19-registration-page-validation
20-ride-history
20-ride-history-2
21-reservation-history
22-hire-reserved-bike
24-routing-from-users-current-position-to-the-bike
25-current-bike-reservation-workflow
28-routing-from-bike-location-to-user-s-destination
34-navigation-menu-is-getting-displayed-on-login-page
36-cancel-hired-bike
37-display-username-on-homepage
38-display-calculated-name-of-the-street-on-reservation-and-hire-page
39-validation-on-login-page
4-reserve-a-bike
40-map-performance-improvement-map-angle-doesn-t-change-when-selected-3d
41-display-live-location-of-user-on-map
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
46-show-bicycle-route-between-bike-and-user-s-destination
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
6-user-registration
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
prototype1
search_functionality
No related merge requests found
Changes
83
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/app/home/home.page.ts
+56
-4
src/app/home/home.page.ts
src/assets/images/bike2gologo.png
+0
-0
src/assets/images/bike2gologo.png
src/index.html
+8
-2
src/index.html
with
64 additions
and
6 deletions
+64
-6
src/app/home/home.page.ts
+
56
-
4
View file @
acc6587e
import
{
Component
}
from
'
@angular/core
'
;
import
{
Component
,
OnInit
,
ViewChild
,
ElementRef
}
from
'
@angular/core
'
;
import
{
Geolocation
}
from
'
@ionic-native/geolocation/ngx
'
;
declare
var
H
:
any
;
@
Component
({
@
Component
({
selector
:
'
app-home
'
,
selector
:
'
app-home
'
,
templateUrl
:
'
home.page.html
'
,
templateUrl
:
'
home.page.html
'
,
styleUrls
:
[
'
home.page.scss
'
],
styleUrls
:
[
'
home.page.scss
'
],
})
})
export
class
HomePage
{
export
class
HomePage
{
private
platform
:
any
;
@
ViewChild
(
"
map
"
,
{
static
:
false
})
public
mapElement
:
ElementRef
;
public
constructor
(
private
geolocation
:
Geolocation
)
{
this
.
platform
=
new
H
.
service
.
Platform
({
'
apikey
'
:
'
tiVTgBnPbgV1spie5U2MSy-obhD9r2sGiOCbBzFY2_k
'
});
}
public
ngOnInit
()
{
}
public
ngAfterViewInit
()
{
setTimeout
(()
=>
{
this
.
loadmap
();
},
1000
);
}
loadmap
(){
// Obtain the default map types from the platform object
var
defaultLayers
=
this
.
platform
.
createDefaultLayers
();
let
map
=
new
H
.
Map
(
this
.
mapElement
.
nativeElement
,
defaultLayers
.
vector
.
normal
.
map
,
{
zoom
:
15
,
center
:
{
lat
:
40.757601
,
lng
:
-
73.985328
},
pixelRatio
:
window
.
devicePixelRatio
||
1
}
);
var
behavior
=
new
H
.
mapevents
.
Behavior
(
new
H
.
mapevents
.
MapEvents
(
map
));
var
ui
=
H
.
ui
.
UI
.
createDefault
(
map
,
defaultLayers
);
this
.
getLocation
(
map
);
}
constructor
()
{}
getLocation
(
map
)
{
this
.
geolocation
.
getCurrentPosition
(
{
maximumAge
:
1000
,
timeout
:
5000
,
enableHighAccuracy
:
true
}
).
then
((
resp
)
=>
{
let
lat
=
resp
.
coords
.
latitude
let
lng
=
resp
.
coords
.
longitude
console
.
log
(
lat
);
console
.
log
(
lng
);
this
.
moveMapToGiven
(
map
,
lat
,
lng
);
},
er
=>
{
alert
(
'
Can not retrieve Location
'
)
}).
catch
((
error
)
=>
{
alert
(
'
Error getting location -
'
+
JSON
.
stringify
(
error
))
});
}
moveMapToGiven
(
map
,
lat
,
lng
)
{
map
.
setCenter
({
lat
:
lat
,
lng
:
lng
});
map
.
setZoom
(
14
);
}
}
}
This diff is collapsed.
Click to expand it.
src/assets/images/bike2gologo.png
0 → 100644
+
0
-
0
View file @
acc6587e
10 KB
This diff is collapsed.
Click to expand it.
src/index.html
+
8
-
2
View file @
acc6587e
...
@@ -7,7 +7,8 @@
...
@@ -7,7 +7,8 @@
<base
href=
"/"
/>
<base
href=
"/"
/>
<meta
name=
"viewport"
content=
"viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<meta
name=
"viewport"
content=
"viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<meta
name=
"format-detection"
content=
"telephone=no"
/>
<meta
name=
"format-detection"
content=
"telephone=no"
/>
<meta
name=
"msapplication-tap-highlight"
content=
"no"
/>
<meta
name=
"msapplication-tap-highlight"
content=
"no"
/>
...
@@ -20,6 +21,11 @@
...
@@ -20,6 +21,11 @@
<body>
<body>
<app-root></app-root>
<app-root></app-root>
<script
src=
"https://js.api.here.com/v3/3.1/mapsjs-core.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"https://js.api.here.com/v3/3.1/mapsjs-service.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"https://js.api.here.com/v3/3.1/mapsjs-ui.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
type=
"text/javascript"
src=
"https://js.api.here.com/v3/3.1/mapsjs-mapevents.js"
></script>
</body>
</body>
</html>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
Next
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