import ViewMode, { ViewModeArgs } from "../view_mode.js";
import L from "leaflet";
const TPL = /*html*/`
`;
export default class GeoView extends ViewMode<{}> {
private $root: JQuery;
private $container!: JQuery;
private map?: L.Map;
constructor(args: ViewModeArgs) {
super(args, "geoMap");
this.$root = $(TPL);
this.$container = this.$root.find(".geo-map-container");
args.$parent.append(this.$root);
}
async renderList() {
this.renderMap();
return this.$root;
}
async renderMap() {
const map = L.map(this.$container[0], {
worldCopyJump: true
});
L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution: '© OpenStreetMap contributors',
detectRetina: true
}).addTo(map);
this.map = map;
}
get isFullHeight(): boolean {
return true;
}
}