[OpenLayers-Users] Nav div problems

bradleyspencer brad at cubewerx.com.au
Sat Dec 22 18:43:56 EST 2007


Andrew,

I’ve never repositioned this control within a Table so not sure if it works.
I just have a Control div positioned anywhere in the window and have a dive
for each of the PanZoomBar and NavToolbar controls.

See http://demo.cubewerx.com.au/sldviewer.html


#controls {
                        position:absolute;
                        top:120px; left:0px;
                        width:40px; height:400px;
                        z-index:500;
            }
#zoomControl{
                        position:absolute;
                        top:0px; left:0px;
            }
#mouseControl{
                        position:absolute;
                        top:20px; left:7px;
            }

In the javascript
.

map.addControl(new OpenLayers.Control.PanZoomBar({div:$('zoomControl')}));
map.addControl(new
OpenLayers.Control.NavToolbar({'div':OpenLayers.Util.getElement('mouseContro
l')}));

In HTML
.

<div id="controls">
            <div id="zoomControl" ></div>
            <div id="mouseControl" class="olControlNavToolbar" ></div>
</div> <!-- controls -->

Hope this helps


Merry Xmas

Brad Spencer


-----Original Message-----
From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]On
Behalf Of Andrew Murdoch
Sent: Sunday, 23 December 2007 4:28 AM
To: users at openlayers.org
Subject: [OpenLayers-Users] Nav div problems

I'm probably missing something basic regarding HTML but I'm having trouble
getting the PanZoomBar div named "nav" to be positioned anywhere other than
the upper right corner of the page.  I've tried adding the nav div to the td
table cell of a table, but the nav div never moves away from that corner.
I'm using OL 2.5.

Here are code snippets from my HTML, where the PanZoomBar is defined and
where the nav div is defined.

        themap.addControl(new
OpenLayers.Control.PanZoomBar({div:$('nav')}));

     <td align="center">
        <div id="nav" style="width:150px"></div>
     </td>

Thanks for your help!
Andrew Murdoch

  _____

The best games are on Xbox 360. Click here for a special offer on an Xbox
360 Console. Get it now! <http://www.xbox.com/en-US/hardware/wheretobuy/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20071223/f2b52ab9/attachment.html


More information about the Users mailing list