forked from kartoza/leaflet-wms-legend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
55 lines (52 loc) · 1.89 KB
/
example.html
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
50
51
52
53
54
55
<!DOCTYPE html>
<html>
<head>
<title>Team Building Hike in Boosmansbos, August 2014</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" /> -->
<link rel="stylesheet" href="../css/leaflet.css"/>
<link rel="stylesheet" href="../css/leaflet.zoomdisplay.css"/>
<link rel="stylesheet" href="../css/leaflet.wmslegend.css"/>
<style>
body {
padding: 0;
margin: 0;
}
html, body, #map {
height: 100%;
width: 100%;
background: white;
}
</style>
<link rel="shortcut icon"
href="http://kartoza.com/wp-content/uploads/2014/08/kartoza-favicon.ico"/>
</head>
<body>
<div id="map"></div>
<!-- <script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script> -->
<script src="../js/leaflet.js"></script>
<script src="../js/leaflet.zoomdisplay.js"></script>
<script src="../js/leaflet.wmslegend.js"></script>
<script>
var map = L.map('map', {
center: [-33.95293, 20.82824],
zoom: 14,
minZoom: 14,
maxZoom: 18,
maxBounds: [
[-33.91444, 20.75351],
[-33.98731, 20.90626]
]
});
var qgis = L.tileLayer.wms("http://maps.kartoza.com/cgi-bin/qgis_mapserv.fcgi?map=/web/Boosmansbos/Boosmansbos.qgs", {
layers: 'Boosmansbos',
format: 'image/png',
transparent: true,
attribution: '(c)<a href="http://kartoza.com">Kartoza.com</a> and <a href="http://www.ngi.gov.za/">SA-NGI</a>'
}).addTo(map);
uri = "http://maps.kartoza.com/cgi-bin/qgis_mapserv.fcgi?map=/web/Boosmansbos/Boosmansbos.qgs&&SERVICE=WMS&VERSION=1.3.0&SLD_VERSION=1.1.0&REQUEST=GetLegendGraphic&FORMAT=image/jpeg&LAYER=Boosmansbos&STYLE=",
L.wmsLegend(uri);
</script>
</body>
</html>