hi Tim,<br><br>Thanks for the debugging. I know about the adding layers
at once. I have been writing a php class for openlayers. I first added
layers to an array every time a baselayer-var was defined and then
outputed the array in an addlayer-statement at the end of the map, but
noticed that openlayers is a bit picky about the order of statements
(adding controls, adding baselayers, setting center, etc.), so I made
it more modular and less beautiful/efficient.
<br><br>This shows no overviewmap control at all:<span class="q"><br><br><html><br> <head><br> <title>Test</title><br> <style type="text/css"><br> #map {
<br> width: 512px;
<br> height: 512px;<br> border: 1px solid gray;<br> }<br> </style><br></span> <script src="<a href="http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js
</a>" type="text/javascript"><<div id="mb_6">/script><br> <script src="<a href="http://www.openlayers.org/api/OpenLayers.js" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.openlayers.org/api/OpenLayers.js</a>"></script><span class="q"><br>
</head><br> <body><br> <div id="map"></div><br> <script defer="defer" type="text/javascript"><br> var map = new OpenLayers.Map('map');
<br></span> var virtualearth = new OpenLayers.Layer.VirtualEarth(<br> "VirtualEarth");<span class="q"><br> var metacarta = new OpenLayers.Layer.WMS(<br> "Metacarta",
<br> "
<a href="http://labs.metacarta.com/wms/vmap0" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://labs.metacarta.com/wms/vmap0</a>",<br> {layers: 'basic'});<br></span>
map.addLayers([virtualearth,metacarta]);<span class="q"><br> map.addControl
(new OpenLayers.Control.OverviewMap());<br> map.setCenter(new OpenLayers.LonLat(5.69, 50.85), 15);<br> </script><br> </body><br></html><br><br></span>This creates weird behaviour (1. overviewmap-control, but no overview-map. 2. mouse keeps dragging):
<span class="q"><br><br><html><br> <head><br> <title>Test</title><br> <style type="text/css"><br> #map {<br> width: 512px;<br> height: 512px;
<br> border: 1px solid gray;<br> }<br> </style><br></span> <script src="<a href="http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js
</a>" type="text/javascript"></script><br> <script src="<a href="http://www.openlayers.org/api/OpenLayers.js" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.openlayers.org/api/OpenLayers.js
</a>"></script><br>
<script src="<a href="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAmbYSvchg-WUKZ1VciMUQehT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTM_U0Wb-HnwWqFxi6YDlhfBryn8w" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAmbYSvchg-WUKZ1VciMUQehT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTM_U0Wb-HnwWqFxi6YDlhfBryn8w
</a>" type="text/javascript"></script><span class="q"><br> </head><br> <body><br> <div id="map"></div><br> <script defer="defer" type="text/javascript">
<br> var map = new OpenLayers.Map('map');<br></span><span class="q"> var google = new OpenLayers.Layer.Google("Google Map");<br> <br></span><span class="q"> var metacarta = new
OpenLayers.Layer.WMS(<br> "Metacarta",
<br> "<a href="http://labs.metacarta.com/wms/vmap0" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://labs.metacarta.com/wms/vmap0</a>",<br> {layers: 'basic'});
<br></span> map.addLayers([google,metacarta]);<span class="q"><br>
map.addControl(new OpenLayers.Control.OverviewMap());<br> map.setCenter(new OpenLayers.LonLat(5.69, 50.85), 15);<br> </script><br> </body><br></html><br><br></span>As
you can see, the problem is the baselayer. Whenever it isn't the(/a?)
wms layer, the overviewmap control breaks. Maybe the overviewmapcontrol
should default to the metacarta wms baselayer?
<br><br>I don't know much about the inside of the ol-api, I am just
using the excellent bricks you provide to build a php/mysql
'application' that non-technical users can use and configure. Maybe I
could do something back by releasing the php-class when it is finished
(if there isn't released one already)?
<br><span class="sg"><br>Robert,</span></div>