LoRaWAN-Signal-Mapping/client_src/js/MapManager.mjs

33 lines
720 B
JavaScript

"use strict";
import Config from './ClientConfig.mjs';
import L from 'leaflet';
import LayerAI from './LayerAI.mjs';
class MapManager {
constructor() {
}
async setup() {
this.map = L.map("map", {
fullscreenControl: true
});
this.map.setView(Config.default_location, Config.default_zoom);
// Add the OpenStreetMap tile layer
this.layer_openstreet = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
id: "openstreetmap",
maxZoom: 19,
attribution: "&copy; <a href='https://www.openstreetmap.org/copyright'>OpenStreetMap contributors</a>"
}).addTo(this.map);
this.layer_ai = new LayerAI(this.map);
await this.layer_ai.setup();
}
}
export default MapManager;