-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwmsview.php
49 lines (41 loc) · 1.39 KB
/
wmsview.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>WMS Viewer</title>
<link rel="stylesheet" href="leaflet.css" />
<link rel="stylesheet" type="text/css" media="all" href="style.css" />
<script src="leaflet.js"></script>
<script src="jquery.min.js"></script>
<script src="leaflet-hash.js"></script>
</head>
<body>
<div id='mapView'>
<div id="map">
<div id="init"></div>
</div>
</div>
</body>
</html>
<script>
$(document).ready(function(){
var map = L.map('map').setView( [50.93548,-1.396150], 12 );
L.tileLayer('https://{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>',
maxZoom: 17
}).addTo(map);
L.tileLayer('https://tiles.maps.southampton.ac.uk/aer/{z}/{x}/{y}.png', {
attribution: 'Aerial photography © Hampshire County Council',
maxZoom: 20,
minZoom: 15
}).addTo(map);
var wmsLayer = L.tileLayer.wms('<?php print $_GET['endpoint']; ?>', {
layers: '<?php print $_GET['layer']; ?>',
format: 'image/png',
opacity: 0.8,
transparent: true
}).addTo(map);
var hash = new L.Hash(map);
});
</script>