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

Christopher Schmidt crschmidt at metacarta.com
Fri Apr 20 07:36:21 EDT 2007


On Fri, Apr 20, 2007 at 12:03:02AM -0400, Stephen Woodbridge wrote:
> Christopher Schmidt wrote:
> >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?
> 
> Yes, that works and I almost had it right :)
> 
> So one more question then its time for sleep, Is it possible to tell OL 
> to use an alternate theme? How?

Pass a 'theme' option to the map, with the web-location of a replacement
stylesheet. The default OL stylesheet is in theme/default/style.css, for
which properties you can change. (It's significantly fewer than I would
like.)

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list