- first code with simple leaflet map

This commit is contained in:
Arno Kaimbacher 2021-07-29 16:57:12 +02:00
parent e9138a4c08
commit 2f048c1c0f
25 changed files with 19565 additions and 2 deletions

View file

@ -0,0 +1,33 @@
import { Component, AfterViewInit } from '@angular/core';
import * as L from 'leaflet';
@Component({
selector: 'app-map',
templateUrl: './map.component.html',
styleUrls: ['./map.component.css']
})
export class MapComponent implements AfterViewInit {
private map;
constructor() { }
private initMap(): void {
this.map = L.map('map', {
center: [ 48.208174, 16.373819],
zoom: 3
});
const tiles = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 18,
minZoom: 3,
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
});
tiles.addTo(this.map);
}
ngAfterViewInit(): void {
this.initMap();
}
}