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
04113cc2
Commit
04113cc2
authored
5 years ago
by
Ratnadeep Rajendra Kharade
Browse files
Options
Download
Email Patches
Plain Diff
Added feature to show 3d maps and terrain view
parent
b1c3da10
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
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/app/home/home.page.html
+8
-2
src/app/home/home.page.html
src/app/home/home.page.scss
+12
-0
src/app/home/home.page.scss
src/app/home/home.page.ts
+80
-22
src/app/home/home.page.ts
src/index.html
+2
-0
src/index.html
with
102 additions
and
24 deletions
+102
-24
src/app/home/home.page.html
+
8
-
2
View file @
04113cc2
...
@@ -3,13 +3,19 @@
...
@@ -3,13 +3,19 @@
<ion-buttons
slot=
"start"
>
<ion-buttons
slot=
"start"
>
<ion-menu-button></ion-menu-button>
<ion-menu-button></ion-menu-button>
</ion-buttons>
</ion-buttons>
<ion-title>
<ion-title
slot=
"start"
>
Home
Home
</ion-title>
</ion-title>
<ion-item
class=
"checkbox-wrapper"
>
<!--ion-checkbox class="checkbox" [(ngModel)]="is3DChecked" (click)="toggle3DMaps()"></ion-checkbox-->
<ion-label
class=
"text"
(click)=
"enable3DMaps()"
>
3D
</ion-label>
</ion-item>
</ion-toolbar>
</ion-toolbar>
</ion-header>
</ion-header>
<ion-content>
<ion-content>
<div
#map
style=
"width: 100%; height: 100%"
id=
"mapContainer"
></div>
<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-content>
</ion-content>
<ion-footer>
<ion-footer>
...
...
This diff is collapsed.
Click to expand it.
src/app/home/home.page.scss
+
12
-
0
View file @
04113cc2
...
@@ -84,3 +84,15 @@ ion-footer{
...
@@ -84,3 +84,15 @@ ion-footer{
padding-top
:
10px
;
padding-top
:
10px
;
}
}
}
}
.checkbox-wrapper
{
text-align
:
right
;
float
:
right
;
ion-label
{
margin-left
:
5px
;
}
}
.mapContainer
{
background-color
:
white
;
}
This diff is collapsed.
Click to expand it.
src/app/home/home.page.ts
+
80
-
22
View file @
04113cc2
...
@@ -9,16 +9,26 @@ declare var H: any;
...
@@ -9,16 +9,26 @@ declare var H: any;
export
class
HomePage
{
export
class
HomePage
{
private
platform
:
any
;
private
platform
:
any
;
private
map
:
any
;
private
map
:
any
;
private
currentLocation
=
{
lat
:
0
,
lng
:
0
};
private
currentLocation
=
{
lat
:
0
,
lng
:
0
};
public
tempArr
=
[
1
,
2
];
public
is3DChecked
=
false
;
public
locationArr
=
[{
lat
:
48.778409
,
lng
:
9.179252
},
{
lat
:
48.780926
,
lng
:
9.173456
},
public
tempArr
=
[
1
,
2
];
{
lat
:
48.775174
,
lng
:
9.175459
},
public
locationArr
=
[{
lat
:
48.778409
,
lng
:
9.179252
},
{
lat
:
48.793704
,
lng
:
9.191112
}]
{
lat
:
48.780926
,
lng
:
9.173456
},
{
lat
:
48.775174
,
lng
:
9.175459
},
{
lat
:
48.793704
,
lng
:
9.191112
}]
@
ViewChild
(
"
mapElement2d
"
,
{
static
:
false
})
public
mapElement2d
:
ElementRef
;
@
ViewChild
(
"
mapElement3d
"
,
{
static
:
false
})
public
mapElement3d
:
ElementRef
;
//@ViewChild("mapElement", { static: false })
//public mapElement: ElementRef;
@
ViewChild
(
"
map
"
,
{
static
:
false
})
public
mapElement
:
ElementRef
;
public
constructor
(
private
geolocation
:
Geolocation
)
{
public
constructor
(
private
geolocation
:
Geolocation
)
{
this
.
platform
=
new
H
.
service
.
Platform
({
this
.
platform
=
new
H
.
service
.
Platform
({
'
apikey
'
:
'
tiVTgBnPbgV1spie5U2MSy-obhD9r2sGiOCbBzFY2_k
'
'
apikey
'
:
'
tiVTgBnPbgV1spie5U2MSy-obhD9r2sGiOCbBzFY2_k
'
...
@@ -29,30 +39,62 @@ export class HomePage {
...
@@ -29,30 +39,62 @@ export class HomePage {
public
ngAfterViewInit
()
{
public
ngAfterViewInit
()
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
loadmap
();
this
.
loadmap
(
"
2D
"
);
},
1000
);
},
1000
);
window
.
addEventListener
(
'
resize
'
,
()
=>
this
.
map
.
getViewPort
().
resize
());
window
.
addEventListener
(
'
resize
'
,
()
=>
this
.
map
.
getViewPort
().
resize
());
}
}
loadmap
()
{
loadmap
(
style
)
{
// Obtain the default map types from the platform object
// Obtain the default map types from the platform object
var
mapStyle
=
"
raster
"
;
var
mapElement
=
"
mapElement2d
"
;
if
(
style
===
"
3D
"
)
{
mapStyle
=
"
vector
"
;
mapElement
=
"
mapElement3d
"
;
}
var
defaultLayers
=
this
.
platform
.
createDefaultLayers
();
var
defaultLayers
=
this
.
platform
.
createDefaultLayers
();
this
.
map
=
new
H
.
Map
(
this
.
map
=
new
H
.
Map
(
this
.
mapElement
.
nativeElement
,
this
[
mapElement
]
.
nativeElement
,
defaultLayers
.
vector
.
normal
.
map
,
defaultLayers
[
mapStyle
]
.
normal
.
map
,
{
{
zoom
:
16
,
zoom
:
17
,
center
:
{
lat
:
40.757601
,
lng
:
-
73.985328
},
pixelRatio
:
window
.
devicePixelRatio
||
1
pixelRatio
:
window
.
devicePixelRatio
||
1
}
}
);
);
var
behavior
=
new
H
.
mapevents
.
Behavior
(
new
H
.
mapevents
.
MapEvents
(
this
.
map
));
var
behavior
=
new
H
.
mapevents
.
Behavior
(
new
H
.
mapevents
.
MapEvents
(
this
.
map
));
var
ui
=
H
.
ui
.
UI
.
createDefault
(
this
.
map
,
defaultLayers
);
var
ui
=
H
.
ui
.
UI
.
createDefault
(
this
.
map
,
defaultLayers
);
ui
.
removeControl
(
"
mapsettings
"
);
// create custom one
var
ms
=
new
H
.
ui
.
MapSettingsControl
({
baseLayers
:
[{
label
:
"
3D
"
,
layer
:
defaultLayers
.
vector
.
normal
.
map
},{
label
:
"
normal
"
,
layer
:
defaultLayers
.
raster
.
normal
.
map
},
{
label
:
"
satellite
"
,
layer
:
defaultLayers
.
raster
.
satellite
.
map
},
{
label
:
"
terrain
"
,
layer
:
defaultLayers
.
raster
.
terrain
.
map
}
],
layers
:
[{
label
:
"
layer.traffic
"
,
layer
:
defaultLayers
.
vector
.
normal
.
traffic
},
{
label
:
"
layer.incidents
"
,
layer
:
defaultLayers
.
vector
.
normal
.
trafficincidents
}
]
});
ui
.
addControl
(
"
customized
"
,
ms
);
var
mapSettings
=
ui
.
getControl
(
'
customized
'
);
var
zoom
=
ui
.
getControl
(
'
zoom
'
);
mapSettings
.
setAlignment
(
'
top-right
'
);
zoom
.
setAlignment
(
'
top-left
'
);
this
.
getLocation
(
this
.
map
);
this
.
getLocation
(
this
.
map
);
var
img
=
[
'
../../../assets/images/ic_high.png
'
,
'
../../../assets/images/ic_medium.png
'
,
'
../../../assets/images/ic_low.png
'
];
var
img
=
[
'
../../../assets/images/ic_high.png
'
,
'
../../../assets/images/ic_medium.png
'
,
'
../../../assets/images/ic_low.png
'
];
for
(
let
i
=
0
;
i
<
this
.
locationArr
.
length
;
i
++
){
for
(
let
i
=
0
;
i
<
this
.
locationArr
.
length
;
i
++
)
{
this
.
addMarker
(
this
.
locationArr
[
i
].
lat
,
this
.
locationArr
[
i
].
lng
,
img
[
i
%
3
]);
this
.
addMarker
(
this
.
locationArr
[
i
].
lat
,
this
.
locationArr
[
i
].
lng
,
img
[
i
%
3
]);
}
}
}
}
...
@@ -76,7 +118,7 @@ export class HomePage {
...
@@ -76,7 +118,7 @@ export class HomePage {
}
}
moveMapToGiven
(
map
,
lat
,
lng
)
{
moveMapToGiven
(
map
,
lat
,
lng
)
{
var
icon
=
new
H
.
map
.
Icon
(
'
../../../assets/images/icon_map_currentLocation.png
'
);
var
icon
=
new
H
.
map
.
Icon
(
'
../../../assets/images/icon_map_currentLocation.png
'
);
// Create a marker using the previously instantiated icon:
// Create a marker using the previously instantiated icon:
var
marker
=
new
H
.
map
.
Marker
({
lat
:
lat
,
lng
:
lng
},
{
icon
:
icon
});
var
marker
=
new
H
.
map
.
Marker
({
lat
:
lat
,
lng
:
lng
},
{
icon
:
icon
});
...
@@ -86,13 +128,13 @@ export class HomePage {
...
@@ -86,13 +128,13 @@ export class HomePage {
map
.
setCenter
({
lat
:
lat
,
lng
:
lng
});
map
.
setCenter
({
lat
:
lat
,
lng
:
lng
});
}
}
expandBikeList
(){
expandBikeList
()
{
for
(
let
i
=
0
;
i
<
20
;
i
++
)
{
for
(
let
i
=
0
;
i
<
20
;
i
++
)
{
this
.
tempArr
.
push
(
i
+
3
);
this
.
tempArr
.
push
(
i
+
3
);
}
}
}
}
addMarker
(
lat
,
lng
,
img
){
addMarker
(
lat
,
lng
,
img
)
{
var
icon
=
new
H
.
map
.
Icon
(
img
);
var
icon
=
new
H
.
map
.
Icon
(
img
);
// Create a marker using the previously instantiated icon:
// Create a marker using the previously instantiated icon:
var
marker
=
new
H
.
map
.
Marker
({
lat
:
lat
,
lng
:
lng
},
{
icon
:
icon
});
var
marker
=
new
H
.
map
.
Marker
({
lat
:
lat
,
lng
:
lng
},
{
icon
:
icon
});
...
@@ -100,4 +142,20 @@ export class HomePage {
...
@@ -100,4 +142,20 @@ export class HomePage {
// Add the marker to the map:
// Add the marker to the map:
this
.
map
.
addObject
(
marker
);
this
.
map
.
addObject
(
marker
);
}
}
toggle3DMaps
()
{
console
.
log
(
this
.
is3DChecked
);
if
(
!
this
.
is3DChecked
)
{
setTimeout
(()
=>
{
this
.
loadmap
(
"
3D
"
);
},
1000
);
}
}
enable3DMaps
()
{
this
.
is3DChecked
=
true
;
setTimeout
(()
=>
{
this
.
loadmap
(
"
3D
"
);
},
100
);
}
}
}
This diff is collapsed.
Click to expand it.
src/index.html
+
2
-
0
View file @
04113cc2
...
@@ -17,6 +17,8 @@
...
@@ -17,6 +17,8 @@
<!-- add to homescreen for ios -->
<!-- add to homescreen for ios -->
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
/>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
/>
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black"
/>
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://js.api.here.com/v3/3.1/mapsjs-ui.css"
/>
</head>
</head>
<body>
<body>
...
...
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