Air-Quality-Web/client_src/js/Map.mjs

29 lines
652 B
JavaScript
Raw Normal View History

"use strict";
2019-01-17 14:07:31 +00:00
// 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() {
2019-01-17 14:07:31 +00:00
this.map = L.map("map", {
fullscreenControl: true
});
this.map.setView(Config.default_location, Config.default_zoom);
2019-01-17 14:07:31 +00:00
this.layer_openstreet = L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
id: "openstreetmap",
maxZoom: 19,
2019-01-17 13:58:56 +00:00
attribution: "&copy; <a href='https://www.openstreetmap.org/copyright'>OpenStreetMap contributors</a>"
}).addTo(this.map);
}
}
export default Map;