]> dev.renevier.net Git - syp.git/blob - late-render.html
12e3f83bef083b1eb4352360e21a37c2e06a7f8e
[syp.git] / late-render.html
1 <html xmlns="http://www.w3.org/1999/xhtml">
2   <head>
3     <title>OpenLayers Late Rendering Example</title>
4     <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
5     <link rel="stylesheet" href="style.css" type="text/css" />
6     <script src="../lib/OpenLayers.js"></script>    
7     <script type="text/javascript">
8     
9         var map, layer;
10         function init(){
11             map = new OpenLayers.Map();
12             layer = new OpenLayers.Layer.WMS(
13                 "OpenLayers WMS",
14                 "http://labs.metacarta.com/wms/vmap0",
15                 {layers: 'basic'}
16             );
17             map.addLayer(layer);
18             map.render("container_id");
19             map.zoomTo(2);
20         }
21
22     </script>
23   </head>
24   <body onload="init()">
25     <h1 id="title">Late Rendering</h1>
26
27     <div id="tags"></div>
28
29     <p id="shortdesc">
30         Demonstrates how a map can be rendered to an empty container after
31         construction by calling the render method.
32     </p>
33     <div id="container_id" class="smallmap"></div>    
34     <div id="docs">
35         In cases where you need to create a map first and render it to some
36         container later, call the map constructor without a "div" argument.
37         In this case, you can provide the options object as the first argument.
38         To render your map to some container after construction, call the map's
39         render method with the container id.
40     </div>
41   </body>
42 </html>