2019-07-19 14:36:21 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
import Config from './ClientConfig.mjs';
|
|
|
|
import GetFromUrl from './Helpers/GetFromUrl.mjs';
|
|
|
|
|
2019-07-22 14:46:07 +00:00
|
|
|
import L from 'leaflet';
|
|
|
|
|
2019-07-19 14:36:21 +00:00
|
|
|
class MapManager {
|
|
|
|
constructor() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
async setup() {
|
|
|
|
let index = JSON.parse(await GetFromUrl(Config.ai_index_file));
|
|
|
|
console.log(index);
|
2019-07-22 14:46:07 +00:00
|
|
|
|
|
|
|
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: "© <a href='https://www.openstreetmap.org/copyright'>OpenStreetMap contributors</a>"
|
|
|
|
}).addTo(this.map);
|
2019-07-19 14:36:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default MapManager;
|