[OpenLayers-Dev] controls outside the map viewport

Tim Schaub noreply at geocartic.com
Mon Dec 18 19:42:04 EST 2006


Hello-

I think there is consensus that controls should be allowed to live outside
the map viewport.  The map.addControlToMap method is the only place where
this is restricted.  

An easy fix to this checks if the control.div property is an element that
already exists in the DOM (or has a parent node, really).  With the patch
for #445 [1], if the control.div element has a parent node, it is not
appended to the map viewport (which seems a good caution anyway).

If this is accepted as the method for allowing controls to live outside the
viewport, the patch for #446 [2] is an example of how to create a control
(the overview map in this case) in an element other than the map viewport.
Note that it is only lines 150 & 151 of this patch that do the
outside-viewport checking.

The missing piece here is a way to effectively style elements with CSS.
Since the dev-list discussion on CSS has been somewhat flat, I'll make a
ticket for that.

Please review these two patches.  I'm happy to commit after review.

[1] http://trac.openlayers.org/attachment/ticket/445/externalControl.patch

[2] http://trac.openlayers.org/attachment/ticket/446/outside_viewport.patch


Thanks,
Tim




More information about the Dev mailing list