[OpenLayers-Users] controls apearing vertically..

Imran Rajjad rajjad at gmail.com
Mon Jun 7 06:59:34 EDT 2010


Hi,

`I`m trying to add a control panel to a div outside map. However the
problem is that the controls are verticaly oriented and are disturbing
my whole page. I did not have much luck with my css , can somebody
point out what am i doing wrong here.

css

.olControlPanel  {
          display:block;
          width:  100px;
          height: 24px;
          margin: 5px;
          top :   500px;
          background-color:red;
        }


html

<div id="basicnav"  class="olControlPanel"></div>



javascript

 var zb = new OpenLayers.Control.ZoomBox({title:"Zoom box: zoom on an
area by clicking and dragging."});
 var nav=new OpenLayers.Control.MouseDefaults({title:"mouse
panning"}); // default navigation
  var container=document.getElementById("basicnav");
  var panel = new OpenLayers.Control.Panel({div: container});
  panel.addControls([nav,zb]); // nav and zoom box
  map.addControl(panel); // adding map control

-- 
I.R



More information about the Users mailing list