Add overpass service
This commit is contained in:
@@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user