<div>That would be fine if I was only drawing one box. My problem is I need to draw hundreds of them and they don't appear at the right location. Their height is off. The width appears to be fine but the height is not offset. I still think there is a bug here. I provided a very simple example. If the box is the same bounds as the viewport then why isn't the box the same size? It appears to have a problem with the sizing.
</div>
<div> </div>
<div>Linda Rawson<br><br> </div>
<div><span class="gmail_quote">On 9/27/07, <b class="gmail_sendername">Brent Pedersen</b> <<a href="mailto:bpederse@gmail.com">bpederse@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">probably something like:<br>var box = new OpenLayers.Marker.Box(map.getExtent());<br>since your map may not be able to display the exact bounds you request
<br>given set resolutions/scales.<br><br><br>On 9/27/07, Linda Rawson <<a href="mailto:linda.rawson@gmail.com">linda.rawson@gmail.com</a>> wrote:<br>><br>><br>> I switch the example.<br>><br>> var boxes = new
OpenLayers.Layer.Boxes("Images");<br>> var bounds = new OpenLayers.Bounds(-96.0051889, 28.9812486, -95.9925747,<br>> 28.9917903 );<br>> var box = new OpenLayers.Marker.Box(bounds);<br>> box.setBorder
("yellow",4);<br>> boxes.addMarker(box);<br>> map.addLayer(boxes);<br>><br>> map.zoomToExtent(bounds);<br>><br>> But then I get a yellow box in the middle of the map. I want a box the SAME
<br>> size as the viewport I am looking at. How do I do that?<br>> Linda Rawson<br>><br>><br>><br>> On 9/27/07, Brent Pedersen <<a href="mailto:bpederse@gmail.com">bpederse@gmail.com</a>> wrote:<br>
> > > var bounds = new OpenLayers.Bounds(-96.0051889, 28.9917903,<br>> -95.9925747, 28.9812486);<br>> ><br>> > hi, it looks like your ymin and ymax are switched.<br>> > -brent<br>> ><br>
> ><br>> > On 9/27/07, Linda Rawson <<a href="mailto:linda.rawson@gmail.com">linda.rawson@gmail.com</a>> wrote:<br>> > > I have the following code:<br>> > ><br>> > ><br>> > >
<br>> > > <html xmlns=" <a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>"><br>> > > <head><br>> > > <style type="text/css"><br>
> > > #map {<br>> > > width: 600px;<br>> > > height: 600px;<br>> > > border: 1px solid black;<br>> > > }<br>> > > </style>
<br>> > > <script src="../lib/OpenLayers.js"></script><br>> > > <script type="text/javascript"><br>> > > <!--<br>> > > function init()<br>
> > > {<br>> > > var map = new OpenLayers.Map( 'map');<br>> > ><br>> > > var ol_wms = new OpenLayers.Layer.WMS.Untiled( "OpenLayers WMS",<br>> > > "
<a href="http://labs.metacarta.com/wms/vmap0?">http://labs.metacarta.com/wms/vmap0?</a>",<br>> > > {<br>> > > layers : 'basic'<br>> > > }<br>> > > );<br>> > > ol_wms.addOptions(
<br>> > > {<br>> > > isBaseLayer : true,<br>> > > ratio: 1<br>> > > }<br>> > > );<br>> > > map.addLayers([ol_wms]);<br>> > ><br>> > >
map.addControl(new<br>> OpenLayers.Control.MousePosition());<br>> > ><br>> > > var boxes = new OpenLayers.Layer.Boxes("Images");<br>> > > var bounds = new OpenLayers.Bounds(-96.0051889
, 28.9917903,<br>> -95.9925747,<br>> > > 28.9812486);<br>> > > var box = new OpenLayers.Marker.Box(bounds);<br>> > > box.setBorder ("yellow",4);<br>> > > boxes.addMarker
(box);<br>> > > map.addLayer(boxes);<br>> > ><br>> > > map.zoomToExtent(bounds);<br>> > ><br>> > > }<br>> > > // --><br>> > > </script><br>
> > > </head><br>> > > <body onload="init()"><br>> > > <h1>OpenLayers Example</h1><br>> > > <div id="map"></div><br>> > > </body>
<br>> > > </html><br>> > ><br>> > ><br>> > > I get a map with the proper coordinates but the box is simply one line.<br>> I<br>> > > think there is a bug in the boxes that is not using the correct lat/lon
<br>> > > combinations. Has anybody else ran into this?<br>> > ><br>> > > Thanks,<br>> > ><br>> > > Linda Rawson<br>> > > _______________________________________________
<br>> > > Users mailing list<br>> > > <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>> > > <a href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users
</a><br>> > ><br>> > ><br>> ><br>><br>><br></blockquote></div><br>