Change app name, add leaflet libary, add map-component on tab2
parent
78bcabc03b
commit
90bdd74bef
@ -1,12 +1,28 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Platform } from "@ionic/angular";
|
||||||
|
import { Map, tileLayer, marker, icon } from "leaflet";
|
||||||
|
|
||||||
|
import { Component } from "@angular/core";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-tab2',
|
selector: "app-tab2",
|
||||||
templateUrl: 'tab2.page.html',
|
templateUrl: "tab2.page.html",
|
||||||
styleUrls: ['tab2.page.scss']
|
styleUrls: ["tab2.page.scss"],
|
||||||
})
|
})
|
||||||
export class Tab2Page {
|
export class Tab2Page {
|
||||||
|
constructor(public plt: Platform) {}
|
||||||
|
|
||||||
|
ngAfterViewInit() {
|
||||||
|
this.plt.ready().then(() => {
|
||||||
|
this.initMap();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
constructor() {}
|
initMap() {
|
||||||
|
const map = new Map("map").setView([47.986756, 7.842344], 23);
|
||||||
|
|
||||||
|
tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
|
||||||
|
attribution:
|
||||||
|
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
|
}).addTo(map);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue