Change name and add new query function
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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<OverpassResponse>(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<OverpassResponse>(this.apiUrl, query, { headers: header });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user