mirror of
https://github.com/ConnectedHumber/Air-Quality-Web
synced 2024-11-26 07:02:59 +00:00
28 lines
652 B
JavaScript
28 lines
652 B
JavaScript
"use strict";
|
|
|
|
// Import leaflet, but some plugins require it to have the variable name 'L' :-/
|
|
import L from 'leaflet';
|
|
import 'leaflet-fullscreen';
|
|
|
|
import Config from './Config.mjs';
|
|
|
|
class Map {
|
|
constructor() {
|
|
|
|
}
|
|
|
|
setup() {
|
|
this.map = L.map("map", {
|
|
fullscreenControl: true
|
|
});
|
|
this.map.setView(Config.default_location, Config.default_zoom);
|
|
|
|
this.layer_openstreet = L.tileLayer("http://{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);
|
|
}
|
|
}
|
|
|
|
export default Map;
|