1 <html xmlns="http://www.w3.org/1999/xhtml">
3 <title>OpenLayers Teleporter 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>
8 <style type="text/css">
23 <script type="text/javascript">
25 var map, layer, spot=1;
27 map = new OpenLayers.Map({
30 map.addControl(new OpenLayers.Control.OverviewMap());
31 layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
32 "http://labs.metacarta.com/wms/vmap0",
44 map.render("spot" + spot);
49 <body onload="init()">
50 <h1 id="title">Map "Teleportation" and Rendering</h1>
54 <p id="shortdesc">Call the map's render method to change its container.</p>
57 <div id="spot1" class="smallmap spot1"></div>
58 <div id="spot2" class="smallmap spot2"></div>
61 <input type="button" onclick="teleport()" value="Teleport!"></input>
64 This example demonstrates how a map can be rendered initially in one
65 container and then moved to a new container. At any point after map
66 construction, the map's render method can be called with the id of
67 an empty container, moving the map to the new container.