diff --git a/src/app/home/home.page.html b/src/app/home/home.page.html index 24ded16aaa4b0394daf946450c4e483fa30d76a6..1b29d499c2ea0e2bb9430843c5e2d90ef536cf8a 100644 --- a/src/app/home/home.page.html +++ b/src/app/home/home.page.html @@ -11,3 +11,22 @@ <ion-content> <div #map style="width: 100%; height: 100%" id="mapContainer"></div> </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 i of tempArr"> + <div class="bike-name"> + Bike 1 + </div> + <div class="battery-info"> + <div><ion-icon class="battery-icon" name="battery-charging"></ion-icon></div> + <div>100%</div> + </div> + <div class="address-info"> + <div class="disance">56m</div> + <div class="address">Schllingstrasse 129</div> + </div> + </div> + </div> +</ion-footer> diff --git a/src/app/home/home.page.scss b/src/app/home/home.page.scss index 0ddc9e8e7f5c78ae44fa8c6fc7d3128243f61dbc..4fcdff439c4e7e6383b7acb1a4029b96635f9e66 100644 --- a/src/app/home/home.page.scss +++ b/src/app/home/home.page.scss @@ -2,3 +2,85 @@ max-height: 35vh; overflow: hidden; } + +ion-footer{ + overflow-y: auto; + padding-top: 30px; +} + +.bike-list-container{ + position: relative; + + .bike-list-expander{ + position: absolute; + font-size: 32px; + color: gray; + z-index: 200; + left: 46%; + top: -32px; + } +} + +.bike-container{ + height: 60px; + width: 100%; + border: 1px solid #aaaaaa; + border-radius: 5px; + box-sizing: border-box; + float: left; + width: 100%; + clear: both; + + div { + height: inherit; + float: left; + } +} + +.bike-name, .battery-info{ + height: inherit; + line-height: 45px; +} + +.battery-info{ + width: 20%; +} + +.bike-name{ + width: 30%!important; + line-height: 60px; + padding-left: 10px; +} + +.battery-info{ + line-height: 60px; + + div{ + float: left; + } +} +.battery-icon{ + font-size: 20px; +} + +.address-info{ + float: right!important; + width: 50%!important; + font-size: 14px; + text-align: right; + padding-right: 10px; + + div{ + width: 100%; + } + + .disance{ + height: 20px; + line-height: 20px; + } + + .address{ + height: 40px; + padding-top: 10px; + } +} diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index b7bef6e52940a3d20030ee55fbc2c52114cd9c86..5cb30e90d64bb2a9bb122a9d91a100191be81541 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -11,6 +11,12 @@ export class HomePage { private map: any; private currentLocation = {lat:0,lng:0}; + public tempArr = [1,2]; + public locationArr = [{lat:48.778409, lng:9.179252}, + {lat:48.780926, lng:9.173456}, + {lat:48.775174, lng:9.175459}, + {lat:48.793704, lng:9.191112}] + @ViewChild("map", { static: false }) public mapElement: ElementRef; public constructor(private geolocation: Geolocation) { @@ -44,6 +50,10 @@ export class HomePage { var behavior = new H.mapevents.Behavior(new H.mapevents.MapEvents(this.map)); var ui = H.ui.UI.createDefault(this.map, defaultLayers); this.getLocation(this.map); + 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++){ + this.addMarker(this.locationArr[i].lat, this.locationArr[i].lng, img[i%2]); + } } getLocation(map) { @@ -75,4 +85,19 @@ export class HomePage { map.addObject(marker); map.setCenter({ lat: lat, lng: lng }); } + + expandBikeList(){ + for(let i=0; i<20; i++) { + this.tempArr.push(i+3); + } + } + + addMarker(lat, lng, img){ + var icon = new H.map.Icon(img); + // Create a marker using the previously instantiated icon: + var marker = new H.map.Marker({ lat: lat, lng: lng }, { icon: icon }); + + // Add the marker to the map: + this.map.addObject(marker); + } } diff --git a/src/assets/images/ic_high.png b/src/assets/images/ic_high.png new file mode 100644 index 0000000000000000000000000000000000000000..b68f5cdcfa8fe9dbdee1ec3dd1358853febb0011 Binary files /dev/null and b/src/assets/images/ic_high.png differ diff --git a/src/assets/images/ic_low.png b/src/assets/images/ic_low.png new file mode 100644 index 0000000000000000000000000000000000000000..6c6302f94b0e4cfba266cc36025caa0eb5310e5f Binary files /dev/null and b/src/assets/images/ic_low.png differ diff --git a/src/assets/images/ic_medium.png b/src/assets/images/ic_medium.png new file mode 100644 index 0000000000000000000000000000000000000000..7fc28aeb608abb652ba316101ec92c3379db82c5 Binary files /dev/null and b/src/assets/images/ic_medium.png differ diff --git a/src/assets/images/ic_position.png b/src/assets/images/ic_position.png new file mode 100644 index 0000000000000000000000000000000000000000..dd808a0d7cdd7c362e5834522edb9855f2b4f03c Binary files /dev/null and b/src/assets/images/ic_position.png differ diff --git a/src/assets/images/vector.png b/src/assets/images/vector.png new file mode 100644 index 0000000000000000000000000000000000000000..3a664e40099db6a73d4ab19b13037e7b1a443cc1 Binary files /dev/null and b/src/assets/images/vector.png differ