[OpenLayers-Dev] Control outside map (re #445)
Bart van den Eijnden (OSGIS)
bartvde at osgis.nl
Wed Jan 17 05:08:09 EST 2007
Have you tried this syntax:
overview = new OpenLayers.Control.OverviewMap({div: $('controls')});
Best regards,
Bart
--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl
--------- Oorspronkelijk bericht --------
Van: Ludwig Max Brinckmann <ludwigbrinckmann at gmail.com>
Naar: dev at openlayers.org <dev at openlayers.org>
Onderwerp: [OpenLayers-Dev] Control outside map (re #445)
Datum: 17/01/07 08:05
> 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.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
> overview = new
OpenLayers.Control.OverviewMap({div :
'controls'});
map.addControl(overview);However, when running this it gives me the
following exception:
> Error: this.div.appendChild is not a functionSource File:
http://localhost/javascripts/openlayers/lib/OpenLayers/Control/OverviewMap.js
> Line: 117Is 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.
> LudwigThe full script:<html
xmlns="http://www.w3.org/1999/xhtml">
<head> <style
type="text/css"> #map
{
> width:
80%;
height: 100%; top:
0; left:
0;
position: absolute;
} #controls
{ width:
20%;
position: absolute;
> top:
0; right:
0; height:
100%; }
</style> <script
src="/javascripts/openlayers/lib/OpenLayers.js"></script>
<script type="text/javascript">
>
<!-- function
init(){
var map = new OpenLayers.Map('map');
boundary = new
OpenLayers.Layer.WMS.Untiled('Boundary',
"
> http://localhost/cgi-bin/yunnanserver?", {layers:
"Watersheds",
transparent: "false", format:"image/png" }
);
boundary.setVisibility(true);
map.addLayers
> ([boundary]); overview = new
OpenLayers.Control.OverviewMap({div :
'controls'});
map.addControl(overview); bounds = new
OpenLayers.Bounds(-180,-90,180,90);
map.zoomToExtent
> (bounds); }
</script> </head> <body
onload="init()"> <div
id="controls"></div> <div
id="map"></div> </body>
> </html>
>
>
>
>
>
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>
More information about the Dev
mailing list