1 <html xmlns="http://www.w3.org/1999/xhtml">
3 <title>OpenLayers Boxes 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">
11 [-122.6, 37.6, -122.3, 37.9],
16 map = new OpenLayers.Map('map');
18 var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
19 "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
21 var boxes = new OpenLayers.Layer.Boxes( "Boxes" );
23 for (var i = 0; i < box_extents.length; i++) {
25 bounds = new OpenLayers.Bounds(ext[0], ext[1], ext[2], ext[3]);
26 box = new OpenLayers.Marker.Box(bounds);
27 box.events.register("click", box, function (e) {
28 this.setBorder("yellow");
33 map.addLayers([ol_wms, boxes]);
34 map.addControl(new OpenLayers.Control.LayerSwitcher());
35 map.zoomToMaxExtent();
39 <body onload="init()">
40 <h1 id="title">Boxes Example</h1>
46 Demonstrate marker and box type annotations on a map.
49 <div id="map" class="smallmap"></div>