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: [email protected]
[mailto:[email protected]] On Behalf Of Richard Jones
Sent: 29 July 2012 13:35
To: [email protected]
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
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to