From 7fb116ab2f8bc0d11af650cbed2372beac11a1ac Mon Sep 17 00:00:00 2001 From: Ol86 Date: Mon, 27 Apr 2026 14:15:01 +0200 Subject: [PATCH] Change name and add new query function --- src/app/map/map.ts | 2 +- src/app/overpass.ts | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/app/map/map.ts b/src/app/map/map.ts index e8df937..7bbc385 100644 --- a/src/app/map/map.ts +++ b/src/app/map/map.ts @@ -91,7 +91,7 @@ export class OSMMap { // Create a new LayerGroup to hold the building polygons const resultingLayer = new L.LayerGroup(); - this.overpass.fetchBuildings(building_name).subscribe((data) => { + this.overpass.fetchIndoorData(building_name).subscribe((data) => { console.log('Fetched building data from Overpass API:', data); // Create a mapping of node IDs to their coordinates diff --git a/src/app/overpass.ts b/src/app/overpass.ts index fb39c74..b0d6a24 100644 --- a/src/app/overpass.ts +++ b/src/app/overpass.ts @@ -28,10 +28,10 @@ export class Overpass { constructor(private http: HttpClient) {} - fetchBuildings(building_name: string) { + fetchIndoorData(building_name: string) { const header = { 'Content-Type': 'text/plain' }; const query = ` - [out:json][timeout:25]; + [out:json][timeout:90]; nwr["building"]["operator"="Hochschule Karlsruhe"]["name"="${building_name}"](49.014442, 8.387954, 49.017847, 8.395448)->.building; ( nwr["indoor"="room"](area.building); @@ -42,4 +42,17 @@ export class Overpass { return this.http.post(this.apiUrl, query, { headers: header }); } + + fetchBuildingData() { + const header = { 'Content-Type': 'text/plain' }; + const query = ` + [out:json][timeout:90]; + ( + nwr["building"="university"]["operator"="Hochschule Karlsruhe"](49.014442, 8.387954, 49.017847, 8.395448); + ); + (._;>;); + out body; + `; + return this.http.post(this.apiUrl, query, { headers: header }); + } }