import L, { LatLng } from "leaflet"; export default class Tracking { map: L.Map; popup = L.popup(); msg: string; participant: L.Marker; popupLocation: L.LatLng; popupContent: HTMLElement; constructor(input: L.Map, obj: string, marker: L.Marker){ this.map = input; var viewPos = new L.LatLng(53.0528064472226, 8.89412999153137); this.msg = obj; this.participant = marker; var runIcon = new L.Icon({ iconUrl: 'img/marker-run.png', shadowUrl: 'img/marker-shadow.png', iconSize: [25, 41], iconAnchor: [12, 41], popupAnchor: [1, 50], shadowSize: [0, 0] }); var participant = new L.Marker(viewPos, {icon: runIcon}).on('click', this.onMarkerClick); this.popupLocation = new LatLng(0,0); this.popupContent = new HTMLElement(); participant.addTo(this.map); } onMarkerClick() { this.popup .setLatLng(this.popupLocation) .setContent(this.popupContent) .openOn(this.map); } start() { console.log('