[OpenLayers-Users] Error when adding OpenLayers.Control.OverviewMap

Claudio V. claudio.carvalho at lemaf.ufla.br
Wed Jul 10 07:27:59 PDT 2013


I second Alexandre, i think you'll need to add some layers on the
constructor. The overview control expects a base layer to be set or that
you supply some, otherwise it'll have nothing to display.


2013/7/10 Alexandre Dubé <adube at mapgears.com>

>  Hi Robert,
>
>   You could try to create your overview map with its own layers:
>
>   new OpenLayers.Control.OverviewMap({
>     layers: [
>       new OpenLayers.Layer...
>     ]
>   });
>
> HTH,
>
> Alexandre
>
>
>
> On 13-07-10 07:34 AM, Rob Hyx wrote:
>
> Alexandre, thanks for your reply.
>
>  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:
>
>  zoomToExtent(bounds=-180,-90,180,90 { left=-180, bottom=-90, right=180,
> more...}, closest=undefined)
> zoomToMaxExtent(options=undefined)
> createMap()
> update()
> draw()
> addControlToMap(control=Object { layers=[1], handlers={...},
> displayClass="olControlOverviewMap", more...}, px=undefined)
> addControl(control=Object { layers=[1], handlers={...},
> displayClass="olControlOverviewMap", more...}, px=undefined)
>
>  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.
>
>
>
> --
> Alexandre Dubé
> Mapgearswww.mapgears.com
>
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130710/04b063b8/attachment.html>


More information about the Users mailing list