Ticket #445 promises a way of easily putting controls outside the main map -- a great help if there is more than just very simple mouse interaction since that seems to confuse many browsers.<br><br>The way I understand it, to utilise this one, I have to pass in the id of the div where the control is supposed to be located when creating the control, such as
<br><br> overview = new OpenLayers.Control.OverviewMap({div : 'controls'});<br> map.addControl(overview);<br><br>However, when running this it gives me the following exception:<br><br><div style="margin-left: 40px;">
Error: this.div.appendChild is not a function<br>Source File: <a href="http://localhost/javascripts/openlayers/lib/OpenLayers/Control/OverviewMap.js">http://localhost/javascripts/openlayers/lib/OpenLayers/Control/OverviewMap.js
</a><br>Line: 117<br></div><br>Is there a working example (with current svn head) someone could point me to? I am actually not that keen on this particular control, I am looking for a working starting point for my own control, so any control would do.
<br><br>Ludwig<br><br>The full script:<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: 80%;<br> height: 100%;<br> top: 0;<br> left: 0;<br> position: absolute;<br> }<br> #controls {<br> width: 20%;<br> position: absolute;
<br> top: 0;<br> right: 0;<br> height: 100%;<br> }<br> </style><br><br> <script src="/javascripts/openlayers/lib/OpenLayers.js"></script><br><br> <script type="text/javascript">
<br> <!--<br> function init(){<br> var map = new OpenLayers.Map('map');<br> boundary = new OpenLayers.Layer.WMS.Untiled('Boundary', <br> "<a href="http://localhost/cgi-bin/yunnanserver?">
http://localhost/cgi-bin/yunnanserver?</a>", {layers: "Watersheds",<br> transparent: "false", format:"image/png" } );<br> boundary.setVisibility(true);<br> map.addLayers
([boundary]);<br> overview = new OpenLayers.Control.OverviewMap({div : 'controls'});<br> map.addControl(overview);<br> bounds = new OpenLayers.Bounds(-180,-90,180,90);<br> map.zoomToExtent
(bounds);<br> }<br> </script><br> </head><br> <body onload="init()"><br> <div id="controls"></div><br> <div id="map"></div><br> </body>
<br></html><br><br><br>