-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #166 from mcgill-robotics/angular-ui-gps-enhancements
Added Debris and fixed the refresh problem, also added offline leaflet.
- Loading branch information
Showing
10 changed files
with
389 additions
and
90 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 12 additions & 3 deletions
15
angular_ui_app/src/app/components/drive/drive.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,87 @@ | ||
<link rel="stylesheet" href="/assets/leaflet.css" /> | ||
|
||
<app-generic height="375px" width="375px"> | ||
<div class="gps"> | ||
<div class="map-container"> | ||
<div class="map-frame"> | ||
<div id="map"></div> | ||
</div> | ||
<div id="map"> | ||
<div> | ||
<a id="updateMarkersBtn" (click)="showModal = true"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-geo-alt-fill" viewBox="0 0 16 16"> | ||
<path d="M8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10m0-7a3 3 0 1 1 0-6 3 3 0 0 1 0 6"/> | ||
</svg></a> | ||
</div> | ||
</div> | ||
</app-generic> | ||
</app-generic> | ||
|
||
<div class='modal' *ngIf="showModal === true"> | ||
<div class="inner-modal"> | ||
<button style="position: absolute; top: 10px; right: 10px;" (click)="showModal = false">Close</button> | ||
Add Landmark | ||
<div> | ||
<input type="text" #landmarkNameInput placeholder="Landmark Name"> | ||
<input type="number" #landmarkLatInput placeholder="Latitude"> | ||
<input type="number" #landmarkLngInput placeholder="Longitude"> | ||
</div> | ||
<button (click)="addLandmark(landmarkNameInput.value, landmarkLatInput.value, landmarkLngInput.value)">Add</button> | ||
|
||
<hr/> | ||
|
||
Add Debris | ||
<div> | ||
<input type="text" #debrisNameInput placeholder="Debris Name"> | ||
<input type="number" #debrisLatInput placeholder="Latitude"> | ||
<input type="number" #debrisLngInput placeholder="Longitude"> | ||
<input type="number" #debrisRadius placeholder="Radius (m)"> | ||
</div> | ||
<button (click)="addDebrisArea(debrisNameInput.value, debrisLatInput.value, debrisLngInput.value, debrisRadius.value)">Add</button> | ||
|
||
<hr/> | ||
<div class="list-section"> | ||
<h3>Landmarks</h3> | ||
<div class="scrollable-list"> | ||
<table class="table" data-bs-theme="dark"> | ||
<thead> | ||
<tr> | ||
<th scope="col">Name</th> | ||
<th scope="col">Lat</th> | ||
<th scope="col">Long</th> | ||
<th scope="col">Remove</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr *ngFor="let marker of markerDict | keyvalue"> | ||
<td>{{marker.key}}</td> | ||
<td>{{marker.value.getLatLng().lat}}</td> | ||
<td>{{marker.value.getLatLng().lng}}</td> | ||
<td><button class="btn btn-danger p-1 m-0" (click)="removeMarker(marker.key)">x</button></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
|
||
<hr/> | ||
|
||
<div class="list-section"> | ||
<h3>Debris</h3> | ||
<div class="scrollable-list"> | ||
<table class="table" data-bs-theme="dark"> | ||
<thead> | ||
<tr> | ||
<th scope="col">Name</th> | ||
<th scope="col">Lat</th> | ||
<th scope="col">Long</th> | ||
<th scope="col">Radius</th> | ||
<th scope="col">Remove</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr *ngFor="let debris of debrisDict | keyvalue"> | ||
<td>{{debris.key}}</td> | ||
<td>{{debris.value.getLatLng().lat}}</td> | ||
<td>{{debris.value.getLatLng().lng}}</td> | ||
<td>{{debris.value.getRadius()}}</td> | ||
<td><button class="btn btn-danger p-1 m-0" (click)="removeMarker(debris.key)">x</button></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,77 @@ | ||
.map-container { | ||
height: 372px; | ||
width: 372px; | ||
// border: 1px solid black; | ||
#map { | ||
height: 100%; | ||
} | ||
|
||
.map-frame { | ||
height: 100%; | ||
#updateMarkersBtn { | ||
position: absolute; | ||
top: 10px; | ||
right: 10px; | ||
padding: 5px; | ||
z-index: 4000; | ||
border-radius: 2px; | ||
box-sizing: border-box; | ||
color: black; | ||
background-color: #fff; | ||
// box-shadow: 0 1px 5px rgba(0,0,0,0.65); | ||
border: 2px solid rgba(0,0,0,0.2) | ||
} | ||
|
||
#map { | ||
#updateMarkersBtn:active { | ||
background-color: #c7c7c7; | ||
} | ||
|
||
#updateMarkersBtn:hover { | ||
background-color: #f4f4f4; | ||
} | ||
|
||
.modal { | ||
position: fixed; | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
margin: auto; | ||
position: absolute; | ||
background-color: rgba(0, 0, 0, 0.39); | ||
z-index: 5000; | ||
border-radius: 5px; | ||
|
||
} | ||
|
||
.inner-modal { | ||
position: relative; | ||
width: 900px; | ||
height: 870px; | ||
background-color: rgb(42, 63, 71); | ||
padding: 20px; | ||
border-radius: 5px; | ||
border: #B6CA7B 2px solid; | ||
position: absolute; | ||
box-shadow: 0 1px 5px rgba(0,0,0,0.65); | ||
} | ||
|
||
.scrollable-list { | ||
height: 200px; | ||
width: 95%; | ||
margin: auto; | ||
border: 1px solid black; | ||
overflow-y: scroll; | ||
} | ||
|
||
.form-section { | ||
margin-bottom: 20px; | ||
} | ||
|
||
|
||
.list-section { | ||
margin-bottom: 20px; | ||
} | ||
|
||
button { | ||
margin-top: 10px; | ||
} | ||
|
||
span { | ||
align-content: center; | ||
} |
Oops, something went wrong.