import { Platform } from "@ionic/angular"; import { Map, tileLayer, marker, icon } from "leaflet"; import { Component } from "@angular/core"; @Component({ selector: "app-tab2", templateUrl: "tab2.page.html", styleUrls: ["tab2.page.scss"], }) export class Tab2Page { constructor(public plt: Platform) {} ngAfterViewInit() { this.plt.ready().then(() => { this.initMap(); }); } initMap() { const map = new Map("map").setView([47.986756, 7.842344], 23); tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { attribution: '© OpenStreetMap contributors', }).addTo(map); } }