Map all but done. What event to listen to?

This commit is contained in:
Robin 2016-07-14 18:18:29 +02:00
parent aec68620ae
commit ef490bc302
4 changed files with 25 additions and 1 deletions

10
less/leaflet.geolets.less Normal file
View File

@ -0,0 +1,10 @@
//Map is full screen
html, body, main {
height: 100%;
margin: 0;
}
#map {
min-height:100%;
background:grey;
}

View File

@ -1 +1,2 @@
@import "leaflet"; @import "leaflet";
@import "leaflet.geolets.less";

View File

@ -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>

View File

@ -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 &copy; <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);
};