[OpenLayers-Dev] A way to open/close the OpenLayers LayerSwitcher menu from the startup link?

Eric Lemoine eric.lemoine at camptocamp.com
Wed Mar 21 12:26:37 EDT 2012


On Wednesday, March 21, 2012, Bob Basques <Bob.Basques at ci.stpaul.mn.us>
wrote:
> Can the LayerSwitcher menu be opened/closed from the startup URL of a
page? as in:
>
> <myp-age-url>?LayerSwitcher=open  (or layerswticher=closed)??
>
> I have some automated system clients that would like use the two
different start up options in certain business applications.
>
> I could make another page I suppose, but that seems like the wrong
approach over the long run.

What about something like this:

var params = OpenLayers.Util.getParameters();
if (params.LayerSwitcher === 'open') {
   layersSwitcher.maximize();
} else {
   layerSwitcher.minimize();
}

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20120321/27735a51/attachment.html


More information about the Dev mailing list