-
Notifications
You must be signed in to change notification settings - Fork 4
/
example-openlayers.html
82 lines (71 loc) · 2.43 KB
/
example-openlayers.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html>
<head>
<title>OpenLayers Example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="http://openlayers.org/api/OpenLayers.js"></script>
<link rel="stylesheet" href="http://openlayers.org/dev/theme/default/style.css" type="text/css">
<link rel="stylesheet" href="http://openlayers.org/dev/examples/style.css" type="text/css">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
var map, openlayer, osmlayer, layerSST, layerWSPD, layerSLP, layerAIRT;
function init(){
map = new OpenLayers.Map("map", {
controls: [
new OpenLayers.Control.LayerSwitcher(),
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.Attribution(),
new OpenLayers.Control.MousePosition(),
new OpenLayers.Control.Navigation(),
],
});
openlayer = new OpenLayers.Layer.WMS( "OpenLayers",
"http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic'});
osmlayer = new OpenLayers.Layer.WMS("OpenStreetMap",
"http://maps.opengeo.org/geowebcache/service/wms", {layers: 'openstreetmap', 'format': 'image/png'});
layerSST = new OpenLayers.Layer.WMS(
"Sea surface temperature", "http://test.pydap.org/coads.nc.wms?SST[0]",
{
layers: "SST",
transparent: "true",
format: "image/png",
},
{isBaseLayer: false}
);
layerWSPD = new OpenLayers.Layer.WMS(
"Wind speed", "http://test.pydap.org/coads.nc.wms?WSPD[0]",
{
layers: "WSPD",
transparent: "true",
format: "image/png",
},
{isBaseLayer: false}
);
layerAIRT = new OpenLayers.Layer.WMS(
"Air temperature", "http://test.pydap.org/coads.nc.wms?AIRT[0]",
{
layers: "AIRT",
transparent: "true",
format: "image/png",
},
{isBaseLayer: false}
);
layerSLP = new OpenLayers.Layer.WMS(
"Sea level pressure", "http://test.pydap.org/coads.nc.wms?SLP[0]",
{
layers: "SLP",
transparent: "true",
format: "image/png",
},
{isBaseLayer: false}
);
map.addLayers([osmlayer, openlayer, layerSST, layerWSPD, layerSLP, layerAIRT]);
map.setCenter(new OpenLayers.LonLat(0, 0), 2);
}
</script>
</head>
<body onload='init();'>
<div id="map" style="width:800px; height: 600px"></div>
</body>
</html>