Project

General

Profile

1
<html xmlns="http://www.w3.org/1999/xhtml">
2
  <head>
3
    <style type="text/css">
4
        #map {
5
            width: 512px;
6
            height: 400px;
7
            border: 1px solid black;
8
        }
9
    </style>
10
    <script src="../lib/OpenLayers.js"></script>
11
    <script type="text/javascript">
12
        <!--
13
var map,ia_wms;
14
        function init(){
15
            map = new OpenLayers.Map('map');
16

    
17
            var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", 
18
                "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
19

    
20
            var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
21
                "http://wms.jpl.nasa.gov/wms.cgi", 
22
                {layers: "modis,global_mosaic"});
23

    
24
	        ia_wms = new OpenLayers.Layer.WMS("Nexrad","http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?",{layers:"nexrad-n0r-wmst",transparent:true,format:'image/png',time:document.getElementById('time').value});
25

    
26
            jpl_wms.setVisibility(false);
27

    
28
            map.addLayers([ol_wms, jpl_wms, ia_wms]);
29
            map.addControl(new OpenLayers.Control.LayerSwitcher());
30
            map.zoomToMaxExtent();
31
        }
32
        // -->
33
    </script>
34
  </head>
35
  <body onload="init()">
36
    <h1>OpenLayers Example</h1>
37
    <p>WMS-T example: update the times, and the radar image will change. Uses Layer.changeParams. Thanks to David Bitner for the inspiration, the original code, and the kick in the butt!</p>
38
    <input type='text' id='time'  value="2005-08-29T13:00:00Z" onChange='ia_wms.mergeNewParams({"time":this.value});' >
39
    <div id="map"></div>
40
  </body>
41
</html>
42

    
(31-31/35)