Skip to content

Commit

Permalink
Added WMS example
Browse files Browse the repository at this point in the history
  • Loading branch information
perliedman committed Nov 21, 2013
1 parent d824d64 commit 36c252a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/wms/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
</head>
<body>
<div id="map"></div>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script src="../../lib/proj4-compressed.js"></script>
<script src="../../src/proj4leaflet.js"></script>
<script src="script.js"></script>
</body>
</html>
25 changes: 25 additions & 0 deletions examples/wms/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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: [
8192, 4096, 2048, 1024, 512, 256, 128,
64, 32, 16, 8, 4, 2, 1, 0.5
],
origin: [0, 0]
}),
map = new L.Map('map', {
crs: crs,
continuousWorld: true,
worldCopyJump: false
});

L.tileLayer.wms('http://geodatatest.havochvatten.se/geoservices/ows', {
layers: 'hav-fisketsgeografier:havet-ostersjons-delomraden',
format: 'image/png',
maxZoom: 14,
minZoom: 0,
continuousWorld: true,
attribution: '&copy; <a href="https://www.havochvatten.se/kunskap-om-vara-vatten/kartor-och-geografisk-information/karttjanster.html">Havs- och vattenmyndigheten (Swedish Agency for Marine and Water Management)</a>'
}).addTo(map);

map.setView([55.8, 14.3], 6);
10 changes: 10 additions & 0 deletions examples/wms/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
html, body {
height: 100%;
padding: 0;
margin: 0;
}

#map {
width: 100%;
height: 100%;
}

0 comments on commit 36c252a

Please sign in to comment.