Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • H hft_awado_app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • hdastageeri
  • hft_awado_app
  • Merge requests
  • !2
An error occurred while fetching the assigned milestone of the selected merge_request.

Resolve "Show bikes from api response on map"

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged hdastageeri requested to merge 10-show-bikes-from-api-response-on-map into master 5 years ago
  • Overview 2
  • Commits 5
  • Pipelines 0
  • Changes 11
All threads resolved!

Closes #10 (closed)

Edited 5 years ago by hdastageeri
  • hdastageeri @hdastageeri assigned to @92jarr1mst 5 years ago

    assigned to @92jarr1mst

    By Rron Jahja on 2019-11-27T20:10:52 (imported from GitLab project)

    By AWADO on 2019-11-27T20:10:52 (imported from GitLab)

  • hdastageeri @hdastageeri assigned to @92khra1mst and unassigned @92jarr1mst 5 years ago

    assigned to @92khra1mst and unassigned @92jarr1mst

    By Rron Jahja on 2019-11-27T20:10:59 (imported from GitLab project)

    By AWADO on 2019-11-27T20:10:59 (imported from GitLab)

  • hdastageeri @hdastageeri added 1 commit 5 years ago

    added 1 commit

    • 200d579e - Get Current Position feature completed with custom icon on map.

    Compare with previous version

    By Rron Jahja on 2019-11-27T20:14:12 (imported from GitLab project)

    By AWADO on 2019-11-27T20:14:12 (imported from GitLab)

  • hdastageeri @hdastageeri added 1 commit 5 years ago

    added 1 commit

    • 58c2be10 - Map shows the real position of the bikes.

    Compare with previous version

    By Rron Jahja on 2019-11-28T00:48:46 (imported from GitLab project)

    By AWADO on 2019-11-28T00:48:46 (imported from GitLab)

  • hdastageeri @hdastageeri added 6 commits 5 years ago

    added 6 commits

    • 58c2be10...1fe17923 - 5 commits from branch master
    • d9a548c1 - Merge branch 'master' into 10-show-bikes-from-api-response-on-map

    Compare with previous version

    By Rron Jahja on 2019-11-28T10:28:57 (imported from GitLab project)

    By AWADO on 2019-11-28T10:28:57 (imported from GitLab)

  • hdastageeri
    hdastageeri @hdastageeri started a thread on an old version of the diff 5 years ago
    Resolved by hdastageeri 5 years ago
  • hdastageeri @hdastageeri added 1 commit 5 years ago

    added 1 commit

    • ac078fa6 - Resolved PR comments.

    Compare with previous version

    By Rron Jahja on 2019-11-28T10:35:21 (imported from GitLab project)

    By AWADO on 2019-11-28T10:35:21 (imported from GitLab)

  • hdastageeri @hdastageeri added 1 commit 5 years ago

    added 1 commit

    • c406aea1 - removed comments

    Compare with previous version

    By Rron Jahja on 2019-11-28T10:40:50 (imported from GitLab project)

    By AWADO on 2019-11-28T10:40:50 (imported from GitLab)

  • hdastageeri @hdastageeri resolved all threads 5 years ago

    resolved all threads

    By Ratnadeep Rajendra Kharade on 2019-11-28T10:42:43 (imported from GitLab project)

    By AWADO on 2019-11-28T10:42:43 (imported from GitLab)

  • hdastageeri @hdastageeri unmarked as a Work In Progress 5 years ago

    unmarked as a Work In Progress

    By Rron Jahja on 2019-11-28T10:43:04 (imported from GitLab project)

    By AWADO on 2019-11-28T10:43:04 (imported from GitLab)

  • hdastageeri @hdastageeri mentioned in commit 4570f0af 5 years ago

    mentioned in commit 4570f0af

    By Ratnadeep Rajendra Kharade on 2019-11-28T10:43:26 (imported from GitLab project)

    By AWADO on 2019-11-28T10:43:26 (imported from GitLab)

  • hdastageeri @hdastageeri merged 5 years ago

    merged

    By Ratnadeep Rajendra Kharade on 2019-11-28T10:43:26 (imported from GitLab project)

    By AWADO on 2019-11-28T10:43:26 (imported from GitLab)

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
Please register or sign in to reply
Compare
  • master (base)

and
  • latest version
    c406aea1
    5 commits, 5 years ago

11 files
+ 41
- 8

    Preferences

    File browser
    Compare changes
s‎rc‎
a‎pp‎
auth/‎login‎
login.‎page.ts‎ +1 -1
ho‎me‎
home.pa‎ge.html‎ +8 -1
home.pa‎ge.scss‎ +4 -0
home.p‎age.ts‎ +28 -6
assets‎/images‎
0_perc‎ent.png‎ +0 -0
100_per‎cent.png‎ +0 -0
25_perc‎ent.png‎ +0 -0
50_perc‎ent.png‎ +0 -0
75_perc‎ent.png‎ +0 -0
current_lo‎cation.png‎ +0 -0
ic_posi‎tion.png‎ +0 -0
src/app/auth/login/login.page.ts
+ 1
- 1
  • View file @ c406aea1

  • Edit in single-file editor

  • Open in Web IDE


@@ -39,7 +39,7 @@ export class LoginPage implements OnInit {
@@ -39,7 +39,7 @@ export class LoginPage implements OnInit {
console.log('my data: ', data);
console.log('my data: ', data);
this.restService.setToken(data.token);
this.restService.setToken(data.token);
this.router.navigateByUrl('/home');
this.router.navigateByUrl('/home');
}, (error) => {
}, (error) => {
console.log(error);
console.log(error);
this.correctCredentials = true;
this.correctCredentials = true;
});
});
src/app/auth/login/login.page.ts
+ 1
- 1
  • View file @ c406aea1

  • Edit in single-file editor

  • Open in Web IDE


@@ -39,7 +39,7 @@ export class LoginPage implements OnInit {
@@ -39,7 +39,7 @@ export class LoginPage implements OnInit {
console.log('my data: ', data);
console.log('my data: ', data);
this.restService.setToken(data.token);
this.restService.setToken(data.token);
this.router.navigateByUrl('/home');
this.router.navigateByUrl('/home');
}, (error) => {
}, (error) => {
console.log(error);
console.log(error);
this.correctCredentials = true;
this.correctCredentials = true;
});
});
src/app/home/home.page.html
+ 8
- 1
  • View file @ c406aea1

  • Edit in single-file editor

  • Open in Web IDE


@@ -13,14 +13,21 @@
@@ -13,14 +13,21 @@
</ion-toolbar>
</ion-toolbar>
</ion-header>
</ion-header>
<ion-content>
<ion-content>
 
<div #mapElement2d style="width: 100%; height: 100%" id="mapContainer" *ngIf="!is3DChecked"></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 #mapElement3d style="width: 100%; height: 100%" id="mapContainer" *ngIf="is3DChecked"></div>
<!--div #mapElement style="width: 100%; height: 100%" id="mapContainer"></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-content>
<ion-footer>
<ion-footer>
 
<div class="bike-list-container">
<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-container" *ngFor="let bike of bikes">
<div class="bike-name">
<div class="bike-name">
{{bike.name}}
{{bike.name}}
src/app/home/home.page.scss
+ 4
- 0
  • View file @ c406aea1

  • Edit in single-file editor

  • Open in Web IDE


@@ -96,3 +96,7 @@ ion-footer{
@@ -96,3 +96,7 @@ ion-footer{
.mapContainer{
.mapContainer{
background-color: white;
background-color: white;
}
}
 
.get-position{
 
margin-bottom:10px;
 
 
}
 
\ No newline at end of file
src/app/home/home.page.ts
+ 28
- 6
  • View file @ c406aea1

  • Edit in single-file editor

  • Open in Web IDE


@@ -29,7 +29,7 @@ export class HomePage {
@@ -29,7 +29,7 @@ export class HomePage {
{ lat: 48.780926, lng: 9.173456 },
{ lat: 48.780926, lng: 9.173456 },
{ lat: 48.775174, lng: 9.175459 },
{ lat: 48.775174, lng: 9.175459 },
{ lat: 48.793704, lng: 9.191112 }]
{ lat: 48.793704, lng: 9.191112 }]
public arrayLanLon = { lat: 0, lng: 0 };
@ViewChild("mapElement2d", { static: false })
@ViewChild("mapElement2d", { static: false })
public mapElement2d: ElementRef;
public mapElement2d: ElementRef;
@@ -69,6 +69,7 @@ export class HomePage {
@@ -69,6 +69,7 @@ export class HomePage {
}).then((resp) => {
}).then((resp) => {
this.currentLocation.lat = resp.coords.latitude;
this.currentLocation.lat = resp.coords.latitude;
this.currentLocation.lng = resp.coords.longitude;
this.currentLocation.lng = resp.coords.longitude;
 
this.storage.get('token').then((token) => {
this.storage.get('token').then((token) => {
let url = 'http://193.196.52.237:8081/bikes' + '?lat=' + this.currentLocation.lat + '&lng=' + this.currentLocation.lng;
let url = 'http://193.196.52.237:8081/bikes' + '?lat=' + this.currentLocation.lat + '&lng=' + this.currentLocation.lng;
const headers = new HttpHeaders().set("Authorization", "Bearer " + token);
const headers = new HttpHeaders().set("Authorization", "Bearer " + token);
@@ -85,6 +86,10 @@ export class HomePage {
@@ -85,6 +86,10 @@ export class HomePage {
});
});
}
}
 
 
 
 
loadmap(style) {
loadmap(style) {
// Obtain the default map types from the platform object
// Obtain the default map types from the platform object
var mapStyle = "raster";
var mapStyle = "raster";
@@ -102,6 +107,7 @@ export class HomePage {
@@ -102,6 +107,7 @@ export class HomePage {
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");
ui.removeControl("mapsettings");
@@ -135,12 +141,28 @@ export class HomePage {
@@ -135,12 +141,28 @@ export class HomePage {
this.map.getViewModel().setLookAtData({ tilt: 60 });
this.map.getViewModel().setLookAtData({ tilt: 60 });
}
}
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/100_percent.png', '../../../assets/images/75_percent.png', '../../../assets/images/50_percent.png','../../../assets/images/25_percent.png','../../../assets/images/0_percent.png'];
for (let i = 0; i < this.locationArr.length; i++) {
for (let i = 0; i < this.bikes.length; i++) {
this.addMarker(this.locationArr[i].lat, this.locationArr[i].lng, img[i % 3]);
if(this.bikes[i].batteryPercentage<100 &&this.bikes[i].batteryPercentage>=75){
 
this.addMarker(Number(this.bikes[i].lat), Number(this.bikes[i].lon), img[0]);
 
}
 
else if(this.bikes[i].batteryPercentage<75 &&this.bikes[i].batteryPercentage>=50){
 
this.addMarker(Number(this.bikes[i].lat), Number(this.bikes[i].lon), img[1]);
 
}
 
else if(this.bikes[i].batteryPercentage<50 &&this.bikes[i].batteryPercentage>=25){
 
this.addMarker(Number(this.bikes[i].lat), Number(this.bikes[i].lon), img[2]);
 
}else if(this.bikes[i].batteryPercentage<25 &&this.bikes[i].batteryPercentage>=0){
 
this.addMarker(Number(this.bikes[i].lat), Number(this.bikes[i].lon), img[3]);
 
}
 
//console.log("rroni", this.bikes[i].lat);
 
// this.addMarker(Number(this.bikes[i].lat), Number(this.bikes[i].lon), img[0]);
 
// this.addMarker(Number(48.78077362), 9.17782398, img[i % 3]);
 
//alert(this.bikes[i].lat);
}
}
}
}
getCurrentPosition() {
 
this.getLocation(this.map);
 
}
getLocation(map) {
getLocation(map) {
this.geolocation.getCurrentPosition(
this.geolocation.getCurrentPosition(
{
{
@@ -162,7 +184,7 @@ export class HomePage {
@@ -162,7 +184,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/current_location.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 });
src/assets/images/0_percent.png 0 → 100644
+ 0
- 0
  • View file @ c406aea1

5.03 KiB

src/assets/images/100_percent.png 0 → 100644
+ 0
- 0
  • View file @ c406aea1

5.46 KiB

src/assets/images/25_percent.png 0 → 100644
+ 0
- 0
  • View file @ c406aea1

5.19 KiB

src/assets/images/50_percent.png 0 → 100644
+ 0
- 0
  • View file @ c406aea1

5.25 KiB

src/assets/images/75_percent.png 0 → 100644
+ 0
- 0
  • View file @ c406aea1

5.29 KiB

src/assets/images/current_location.png 0 → 100644
+ 0
- 0
  • View file @ c406aea1

2.19 KiB

src/assets/images/ic_position.png
+ 0
- 0
  • View replaced file @ 1fe17923

  • View file @ c406aea1

11.37 KiB

3.97 KiB

  • 2-up
  • Swipe
  • Onion skin
Assignee
hdastageeri's avatar
hdastageeri
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference:
Source branch: 10-show-bikes-from-api-response-on-map

Menu

Explore Projects Groups Snippets

Dies ist die Gitlab-Instanz des Transferportals der Hochschule für Technik Stuttgart. Hier geht es zurück zum Portal