Commit f35d49be authored by Curtis Adam's avatar Curtis Adam

Add a toggle all pois button for the dropdown filter

parent c7b88794
......@@ -20,6 +20,10 @@
pointer-events: all;
}
#toggle-all-pois {
margin-left: 5px;
}
.cursorpointer {
cursor: pointer;
}
......
......@@ -18,10 +18,11 @@
<div class="col">
<div ngbDropdown>
<button class="btn btn-outline-primary btn-sm" id="poi-category-dropdown-button" ngbDropdownToggle>
<i class="fas fa-map-marker-alt"></i>
POIs
<i class="fas fa-map-marker-alt"></i>&nbsp;POIs
</button>
<div ngbDropdownMenu aria-labelledby="poi-category-dropdown-button" class="poi-category-dropdown shadow">
<button class="btn btn-outline-primary btn-sm" id="toggle-all-pois" (click)="togglePOIs()"><i class="fas fa-map-marker-alt"></i>&nbsp;Toggle all</button>
<hr class="dropdown-divider">
<ng-container *ngFor="let category of getCategories(); let i = index">
<div class="form-check dropdown-item cursorpointer" (click)="updatePOICategory(category.getID())">
<input class="form-check-input cursorpointer" type="checkbox" id="poi-category-{{i}}" [checked]="poiCategoryDisabled(category.getID())">
......
......@@ -181,10 +181,15 @@ export class MapRendererService {
}
togglePois() {
if (this.poisShown) {
this.removePois();
} else {
if (this.filteredCategories.length) {
this.filteredCategories = [];
this.poisShown = true;
this.drawPois();
} else {
for (const category of this.poiCategories) {
this.filteredCategories.push(category.getID());
}
this.removePois();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment