Browse Source

Add leaflet-fullscreen

pull/26/head
Starbeamrainbowlabs 3 years ago
parent
commit
542f0afcb0
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
  1. 1
      client_src/css/main.css
  2. 10
      client_src/js/Map.mjs
  3. 9
      package-lock.json
  4. 1
      package.json

1
client_src/css/main.css

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
@import "../../node_modules/leaflet/dist/leaflet.css";
@import "../../node_modules/leaflet-fullscreen/dist/leaflet.fullscreen.css";
main {
position: absolute;

10
client_src/js/Map.mjs

@ -1,6 +1,8 @@ @@ -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 { @@ -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: "&copy; <a href='https://www.openstreetmap.org/copyright'>OpenStreetMap contributors</a>"

9
package-lock.json generated

@ -25,6 +25,15 @@ @@ -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",

1
package.json

@ -24,6 +24,7 @@ @@ -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…
Cancel
Save