Add overpass service

This commit is contained in:
2026-04-20 21:23:16 +02:00
parent 81168f90d7
commit 0b963a3319
3 changed files with 53 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
import { Component, signal } from '@angular/core';
import { CommonModule } from '@angular/common';
import { LeafletModule } from '@bluehalo/ngx-leaflet';
import { Overpass } from '../overpass';
import * as L from 'leaflet';
import * as D from './details';
@@ -44,10 +45,13 @@ export class Map {
OpenStreetMap: this.osm,
});
constructor(private overpass: Overpass) {}
onMapReady(map: L.Map) {
this.map = map;
this.layerControl.addTo(this.map);
this.loadBuildings().addTo(this.map);
this.queryBuildings();
console.log('Map is ready');
}
@@ -90,4 +94,11 @@ export class Map {
},
});
}
queryBuildings() {
this.overpass.fetchBuildings('E').subscribe((data) => {
console.log('Fetched building data from Overpass API:', data);
// Here you would typically process the data and add it to the map
});
}
}