[OpenLayers-Users] How to add OverviewMap that is open?

Christopher Schmidt crschmidt at metacarta.com
Thu Apr 19 23:28:41 EDT 2007


On Thu, Apr 19, 2007 at 11:10:36PM -0400, Stephen Woodbridge wrote:
> I would like to add the OverviewMap, but have it start in the open 
> position? How do I do this?
> 
> I tried:
> 
> var ovm = new OpenLayers.Control.OverviewMap();
> ovm.maximizeControl();
> map.addControl(ovm);
> 
> but it was not happy with this, probably because this is not an event. I 
> looked through the code but it was not obvious whether there was an 
> option for this.

I just did tested this -- it seems to work after the control is added to
the map, and layers are added to the map. (It doesn't actually populate
the overview map until after it has a base layer to clone.)

var ovm = new OpenLayers.Control.OverviewMap();
map.addControl(ovm);
map.addLayer(wms);
ovm.maximizeControl();

Will that work for you?

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list