mirror of
https://github.com/ConnectedHumber/Air-Quality-Web
synced 2024-12-22 10:25:01 +00:00
Add leaflet-fullscreen
This commit is contained in:
parent
a65f5f619f
commit
542f0afcb0
4 changed files with 18 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
|||
@import "../../node_modules/leaflet/dist/leaflet.css";
|
||||
@import "../../node_modules/leaflet-fullscreen/dist/leaflet.fullscreen.css";
|
||||
|
||||
main {
|
||||
position: absolute;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
import Leaflet from 'leaflet';
|
||||
// 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';
|
||||
|
||||
|
@ -10,10 +12,12 @@ class Map {
|
|||
}
|
||||
|
||||
setup() {
|
||||
this.map = Leaflet.map("map");
|
||||
this.map = L.map("map", {
|
||||
fullscreenControl: true
|
||||
});
|
||||
this.map.setView(Config.default_location, Config.default_zoom);
|
||||
|
||||
this.layer_openstreet = Leaflet.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
|
||||
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>"
|
||||
|
|
9
package-lock.json
generated
9
package-lock.json
generated
|
@ -25,6 +25,15 @@
|
|||
"@types/geojson": "*"
|
||||
}
|
||||
},
|
||||
"@types/leaflet-fullscreen": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/leaflet-fullscreen/-/leaflet-fullscreen-1.0.4.tgz",
|
||||
"integrity": "sha512-53z8+QALEkgVmsEp14EY89WqgAI/h9U2buJXOg/J5OtlV6PtpyO8+r0m44hSM9+HUCwUpSf1cZjLs76orZT1Tg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/leaflet": "*"
|
||||
}
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "10.12.18",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz",
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/leaflet": "^1.2.14",
|
||||
"@types/leaflet-fullscreen": "^1.0.4",
|
||||
"postcss-import": "^12.0.1",
|
||||
"postcss-url": "^8.0.0",
|
||||
"rollup": "^1.1.0",
|
||||
|
|
Loading…
Reference in a new issue