Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
hdastageeri
hft_awado_app
Commits
200d579e
Commit
200d579e
authored
Nov 27, 2019
by
Rron Jahja
Browse files
Get Current Position feature completed with custom icon on map.
parent
11e3848a
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/app/home/home.page.html
View file @
200d579e
...
...
@@ -13,14 +13,21 @@
</ion-toolbar>
</ion-header>
<ion-content>
<div
#mapElement2d
style=
"width: 100%; height: 100%"
id=
"mapContainer"
*ngIf=
"!is3DChecked"
></div>
<div
#mapElement3d
style=
"width: 100%; height: 100%"
id=
"mapContainer"
*ngIf=
"is3DChecked"
></div>
<!--div #mapElement style="width: 100%; height: 100%" id="mapContainer"></div-->
<ion-fab
vertical=
"bottom"
horizontal=
"end"
(click)=
"getCurrentPosition()"
slot=
"fixed"
>
<ion-fab-button>
<ion-icon
name=
"locate"
></ion-icon>
</ion-fab-button>
</ion-fab>
</ion-content>
<ion-footer>
<div
class=
"bike-list-container"
>
<ion-icon
class=
"bike-list-expander"
name=
"arrow-dropup-circle"
(click)=
"expandBikeList()"
></ion-icon>
<div
class=
"bike-container"
*ngFor=
"let bike of bikes"
>
<div
class=
"bike-name"
>
{{bike.name}}
...
...
src/app/home/home.page.scss
View file @
200d579e
...
...
@@ -96,3 +96,7 @@ ion-footer{
.mapContainer
{
background-color
:
white
;
}
.get-position
{
margin-bottom
:
10px
;
}
\ No newline at end of file
src/app/home/home.page.ts
View file @
200d579e
...
...
@@ -137,7 +137,9 @@ export class HomePage {
this
.
addMarker
(
this
.
locationArr
[
i
].
lat
,
this
.
locationArr
[
i
].
lng
,
img
[
i
%
3
]);
}
}
getCurrentPosition
(){
this
.
getLocation
(
this
.
map
);
}
getLocation
(
map
)
{
this
.
geolocation
.
getCurrentPosition
(
{
...
...
@@ -159,7 +161,7 @@ export class HomePage {
moveMapToGiven
(
map
,
lat
,
lng
)
{
var
icon
=
new
H
.
map
.
Icon
(
'
../../../assets/images/ic
on_map_currentLoca
tion.png
'
);
var
icon
=
new
H
.
map
.
Icon
(
'
../../../assets/images/ic
_posi
tion.png
'
);
// Create a marker using the previously instantiated icon:
var
marker
=
new
H
.
map
.
Marker
({
lat
:
lat
,
lng
:
lng
},
{
icon
:
icon
});
...
...
src/assets/images/ic_position.png
View replaced file @
11e3848a
View file @
200d579e
11.4 KB
|
W:
|
H:
3.97 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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