forked from MapServer/basemaps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
55 lines (52 loc) · 1.54 KB
/
index.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>DEMO</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="shortcut icon"
type="image/x-icon"
href="docs/images/favicon.ico"
/>
<link
rel="stylesheet"
href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""
/>
<script
src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"
integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew=="
crossorigin=""
></script>
</head>
<body>
<div id="mapid" style="width: 1000px; height: 800px;"></div>
<script>
var mymap = L.map("mapid").setView([52.37, 4.9], 17);
var osmDefault = L.tileLayer
.wms("http://localhost/cgi-bin/mapserv?map=/app/osm-default.map", {
layers: "default",
format: "image/png",
transparent: true
})
.addTo(mymap);
var osmDefaultGrey = L.tileLayer.wms(
"http://localhost/cgi-bin/mapserv?map=/app/osm-default.map",
{
layers: "default",
format: "image/png;mode=8bit,grayscale",
transparent: true
}
);
L.control
.layers(
{ default: osmDefault, "default-grey": osmDefaultGrey },
{},
{ collapsed: false }
)
.addTo(mymap);
</script>
</body>
</html>