#14 add line edition in leaflet in sandbox

This commit is contained in:
nobohan
2021-08-25 10:15:16 +02:00
parent cdf6e4ac45
commit 07e76fa6a8
61 changed files with 34775 additions and 14 deletions

View File

@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="../../lib/leaflet/leaflet.css" />
</head>
<body>
<div id="map"></div>
<script src="../../lib/leaflet/leaflet.js"></script>
<script src="../../lib/proj4-compressed.js"></script>
<script src="../../src/proj4leaflet.js"></script>
<script src="script.js"></script>
</body>
</html>

View File

@@ -0,0 +1,30 @@
/*
Example using Sweden Lantmäteriet Topografisk Webbkarta
https://opendata.lantmateriet.se/#apis
*/
/*** INSERT YOUR LANTMÄTERIET API TOKEN BELOW ***/
var token = '';
var crs = new L.Proj.CRS('EPSG:3006',
'+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
{
resolutions: [
4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8
],
origin: [-1200000.000000, 8500000.000000 ],
bounds: L.bounds( [-1200000.000000, 8500000.000000], [4305696.000000, 2994304.000000])
}),
map = new L.Map('map', {
crs: crs,
continuousWorld: true,
});
new L.TileLayer('https://api.lantmateriet.se/open/topowebb-ccby/v1/wmts/token/'+ token +'/?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=topowebb&STYLE=default&TILEMATRIXSET=3006&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&FORMAT=image%2Fpng', {
maxZoom: 9,
minZoom: 0,
continuousWorld: true,
attribution: '&copy; <a href="https://www.lantmateriet.se/en/">Lantmäteriet</a> Topografisk Webbkarta Visning, CCB',
}).addTo(map);
//Set view over Stockholm Södermalm
map.setView([59.3167, 18.0667], 7);

View File

@@ -0,0 +1,10 @@
html, body {
height: 100%;
padding: 0;
margin: 0;
}
#map {
width: 100%;
height: 100%;
}