Commit 455b493f authored by Curtis Adam's avatar Curtis Adam

Hide pois which got disabled by the filter

parent 1ee8957a
......@@ -128,6 +128,13 @@ export class MapViewComponent implements AfterViewInit, OnDestroy {
updatePOICategory(id: string): void {
event.preventDefault();
const index = this.mapRendererService.filteredCategories.indexOf(id);
if (index === -1) {
this.mapRendererService.filteredCategories.push(id);
} else {
this.mapRendererService.filteredCategories.splice(index, 1);
}
this.mapRendererService.drawPois();
}
getCategoryIcon(url: string): string {
......
......@@ -111,6 +111,10 @@ export class MapRendererService {
this.leaveBuilding();
}
isNotFilteredID(poiID: string, categoryID: string): boolean {
return poiID !== this.selectedID && !this.filteredCategories.includes(categoryID);
}
async drawBuildings(): Promise<void> {
this.selectedBuilding = null;
this.selectedLevel = null;
......@@ -152,10 +156,10 @@ export class MapRendererService {
this.addPoiToMap(poi);
}
} else {
if (poi.building.length === 0 && !this.selectedBuilding && poi.id !== this.selectedID) {
if (poi.building.length === 0 && !this.selectedBuilding && this.isNotFilteredID(poi.id, poi.category.getID())) {
this.addPoiToMap(poi); // general pois like A20, THM
} else if (this.selectedBuilding && this.selectedBuilding.name === poi.building &&
this.selectedLevel && poi.levels.includes(this.selectedLevel.level) && poi.id !== this.selectedID) {
this.selectedLevel && poi.levels.includes(this.selectedLevel.level) && this.isNotFilteredID(poi.id, poi.category.getID())) {
this.addPoiToMap(poi);
}
}
......
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