Map all but done. What event to listen to?
This commit is contained in:
parent
aec68620ae
commit
ef490bc302
10
less/leaflet.geolets.less
Normal file
10
less/leaflet.geolets.less
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
//Map is full screen
|
||||||
|
html, body, main {
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#map {
|
||||||
|
min-height:100%;
|
||||||
|
background:grey;
|
||||||
|
}
|
||||||
@ -1 +1,2 @@
|
|||||||
@import "leaflet";
|
@import "leaflet";
|
||||||
|
@import "leaflet.geolets.less";
|
||||||
|
|||||||
@ -11,12 +11,13 @@
|
|||||||
|
|
||||||
<!-- CSS -->
|
<!-- CSS -->
|
||||||
<link rel="stylesheet" href="/css/main${data.css.suffix}.css">
|
<link rel="stylesheet" href="/css/main${data.css.suffix}.css">
|
||||||
|
<script src="/js/app${data.js.suffix}.js"></script>``
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<h1>Hello</h1>
|
<div id="map"></div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
12
src/app.js
12
src/app.js
@ -1 +1,13 @@
|
|||||||
const L = require('leaflet');
|
const L = require('leaflet');
|
||||||
|
L.Icon.Default.imagePath = 'node_modules/leaflet/dist/images/';
|
||||||
|
|
||||||
|
document.onload = function () {
|
||||||
|
const Map = L.map('map');
|
||||||
|
Map.setView([47.63, -122.32], 11);
|
||||||
|
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||||
|
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
|
||||||
|
maxZoom: 18,
|
||||||
|
id: 'your.mapbox.project.id',
|
||||||
|
accessToken: 'your.mapbox.public.access.token'
|
||||||
|
}).addTo(Map);
|
||||||
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user