#14 add line edition in leaflet in sandbox
This commit is contained in:
@@ -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>
|
@@ -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: '© <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);
|
@@ -0,0 +1,10 @@
|
||||
html, body {
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#map {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
Reference in New Issue
Block a user