<div dir="ltr"><span style="font-size:medium;font-family:Helvetica">Alexandre, thanks for your reply.</span><div style="font-size:medium;font-family:Helvetica"><br></div><div style="font-size:medium;font-family:Helvetica">
I did try adding the control in via Firebug just from the console after the page has fully loaded and I get the same error. From looking at the call stack in FB:</div><div style="font-size:medium;font-family:Helvetica">
<br></div><div style="font-size:medium;font-family:Helvetica"><div>zoomToExtent(bounds=-180,-90,180,90 { left=-180, bottom=-90, right=180, more...}, closest=undefined)</div><div>zoomToMaxExtent(options=undefined)</div>
<div>createMap()</div><div>update()</div><div>draw()</div><div>addControlToMap(control=Object { layers=[1], handlers={...}, displayClass="olControlOverviewMap", more...}, px=undefined)</div><div>addControl(control=Object { layers=[1], handlers={...}, displayClass="olControlOverviewMap", more...}, px=undefined)<br>
<br></div><div>So it's the call to zoomToMaxExtent() in createMap() that does it. I can see in draw() that there are layers being assigned to the overview (the baseLayer of the the actual map object), but no baseLayer property.<br>
</div>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 8, 2013 at 1:52 PM, Alexandre Dubé <span dir="ltr"><<a href="mailto:adube@mapgears.com" target="_blank">adube@mapgears.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Hi Robert,<br>
<br>
Looking at the OverviewMap source code, in the draw method it
checks if this.map.baseLayer is defined and won't actually draw
the control, nor create the map, unless the baseLayer is set. I'm
not sure what's going on here, but it could be related to
something else.<br>
<br>
You could try adding your control after initializing your main
map view (extent / center) and see if it works. You could also
try to put a breakpoint on this line using firebug and look at the
call stack to see when this gets called and why. The line you
refer is inside the map zoomToExtent method. See what calls it
and why.<br>
<br>
HTH,<br>
<br>
Alexandre<div><div class="h5"><br>
<br>
<br>
On 13-07-08 01:11 PM, Rob Hyx wrote:<br>
</div></div></div>
<blockquote type="cite"><div><div class="h5">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>All,<br>
<br>
</div>
I am getting an error when trying to add an
overview map to my current map. This is how I am
adding the object:<br>
<br>
</div>
var overviewMap = new
OpenLayers.Control.OverviewMap();<br>
</div>
map.addControl(overviewMap);<br>
<br>
The error:<br>
<br>
</div>
TypeError: this.baseLayer is null (OpenLayers.debug.js
line 9808)<br>
</div>
if (this.baseLayer.wrapDateLine) {<br>
<br>
</div>
I've tried adding a check before the line OL errors on and
then adding in the baseLayer from the layers property, and
that works, but I don't want to be adding in lines of code
to OL. Is there something I can pass into the OverviewMap
constructor to fix this?<br>
<br>
</div>
The actual map renders fine and it does have a baseLayer so I
would expect the overview to just inherit that.<br>
<br>
</div>
Using OL 2.12 and Firefox 17.0.6<br>
<br>
Thanks in advance!<br clear="all">
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div><br>
-- <br>
<div style="text-align:left"><b>HYX</b> </div>
<div style="text-align:left"><a href="http://hyx-music.com" target="_blank">http://hyx-music.com</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
<br>
<pre cols="72">--
Alexandre Dubé
Mapgears
<a href="http://www.mapgears.com" target="_blank">www.mapgears.com</a>
</pre>
</font></span></div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div style="text-align:left"><b>HYX</b> </div><div style="text-align:left"><a href="http://hyx-music.com" target="_blank">http://hyx-music.com</a></div>
</div>