[OpenLayers-Users] Toggle visibility controls
George Mu'ammar
George at muammar.net
Tue Aug 19 06:00:00 EDT 2008
Dear Bas, please see the code below.
I do something like that, also hiding a vector layer together with the
controls.
Regards
--
George Mu'ammar
function addControls()
{
vLayer.display(true);
layerSwitcher = new OpenLayers.Control.LayerSwitcher({'ascending':false});
panZoomBar = new OpenLayers.Control.PanZoomBar()
permalink = new OpenLayers.Control.Permalink('permalink');
map.addControl( layerSwitcher );
map.addControl( panZoomBar);
map.addControl(permalink);
}
function removeControls()
{
map.removeControl( layerSwitcher );
map.removeControl( panZoomBar);
map.removeControl(permalink);
vLayer.display(false);
}
Quoting Bas Couwenberg <bascouwenberg at gmail.com>:
> Hello,
>
> I am using OpenLayers in a Swing browser in our Java application. I have a
> method that captures the maps on screen in OL and saves them to the disk.
> Now I would like to have all the panning/zooming/layer controls to be
> invisible when I capture the screen so I only have the map saved. Is it
> possible to toggle the visibility of these controls?
>
> Best regards,
>
> Bas Couwenberg
>
More information about the Users
mailing list