[OpenLayers-Dev] Mouse Control positioning

Christopher Schmidt crschmidt at metacarta.com
Wed Feb 28 23:16:42 EST 2007


On Thu, Mar 01, 2007 at 03:03:04PM +1100, bradleyspencer wrote:
> Can you help me here? I have implemented a getfeatureinfo listener which
> works just fine.
> 
> And in order to not conflict with the zoom and mouse controls, I have been
> able to move the zoom control bar outside the map area which is also fine.
> I used a div and placed control in it this way.
> 
> map.addControl(new
> OpenLayers.Control.PanZoomBar({div:$('zoomLevelContainer')}));
> 
> But I cannot do the same for the mouse control so I was wondering if this is
> a bug and if someone could fix it?
> 
> So I would like to know precisely how to  move the mouse control outside the
> map area without having to modify the code.

Assuming you mean the MouseToolbar: You can't. You'll need to change the
code to support putting itself in a seperate div. (Alternatively, after
adding the control to the map, take controlvar.div and detach it,
reattaching it elsewhere in the DOM. If you do that I recommend passing
a position argument to the initializer with an OpenLayers.Pixel(0,0) so
that the control paints itslef in the upper left corner of the div.

Good luck.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Dev mailing list