[OpenLayers-Users] Hiding map temporarily

Donald Kerr donald.kerr at dkerr.co.uk
Sun Jul 29 05:45:00 PDT 2012


Richard,

To do this, I have a blank layer and switch from my main map layer to the
blank layer by using the setBaseLayer function.

My blank layer is defined as follows:

var layerBlank = new OpenLayers.Layer.Image(
    'No Map',
    '../images/BlankMap.gif',
    new OpenLayers.Bounds(0, 0, 670000, 1230000),
    new OpenLayers.Size(8, 8),
    {
        isBaseLayer: true,
        displayInLayerSwitcher: false
    }
);
myMap.addLayer(layerBlank);

myMap.setBaseLayer(layerBlank) or your actual map layer. Switch between the
layers using this function.

BlankMap.gif is an 8 px x 8px white image.

I hope this helps.

Regards,

Donald



-----Original Message-----
From: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] On Behalf Of Richard Jones
Sent: 29 July 2012 13:35
To: openlayers-users at lists.osgeo.org
Subject: [OpenLayers-Users] Hiding map temporarily


I am driving the web browser from an external program, and I'm trying to
figure out how to "hide" the map temporarily - that is, clear the browser
pane to white until I want to display the map again.

I have experimented with using map.render() to switch between two divs one
of which is "display : none" but this causes all kinds of weird behaviour
with the marker, and loses styles in the vector layers, so I guess this is
not the way to go.

I can't find any OpenLayer.Map methods to make the whole map
hidden/invisible.

Can anyone suggest how I can do this?

_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list