[OpenLayers-Users] problem with Firefox tabs

Bart van den Eijnden (OSGIS) bartvde at osgis.nl
Tue Oct 31 10:46:08 EST 2006


Hi list,

the following use case with 2.2RC2:

* open up an OpenLayers application with a few untiled WMS layers (1 
base layer, a few overlays) in Firefox
* open up a new tab in Firefox

will cause a displacement between the baselayer and the overlays.

Situation before adding a tab (screendump):
http://osgis.nl/download/openlayers_firefox_no_tab.png

Situation after adding a tab (screendump):
http://osgis.nl/download/openlayers_firefox_add_a_tab.png

Example HTML code to reproduce:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<HEAD><!-- javascript include OpenLayers.js -->
<script language="JavaScript" 
src="http://localhost/chameleon//common/openlayers/OpenLayers.js" 
type="text/javascript"></script>
<SCRIPT Language="JavaScript"  type="text/javascript">

var map;
        function mapinit(){
            map = new OpenLayers.Map( $('map'), { 'projection': 
'EPSG:4326', 'units':'degrees', 'maxExtent': new OpenLayers.Bounds(-180, 
-90, 180, 90) , 'maxResolution':'auto'});            var layer = new 
OpenLayers.Layer.WMS.Untiled( "WorldGen",
                "http://www2.dmsolutions.ca/cgi-bin/mswms_world?", 
{layers: 'WorldGen', 'format':'image/png', 'transparent':'true'}, 
{'ratio':1, isBaseLayer: true} );

            map.addLayers([layer]);            var layer = new 
OpenLayers.Layer.WMS.Untiled( "World Political",
                "http://www2.dmsolutions.ca/cgi-bin/mswms_world?", 
{layers: 'WorldPolitical', 'format':'image/png', 'transparent':'true'}, 
{'ratio':1, isBaseLayer: false} );

            map.addLayers([layer]);            var layer = new 
OpenLayers.Layer.WMS.Untiled( "WorldGen_Outline",
                "http://www2.dmsolutions.ca/cgi-bin/mswms_world?", 
{layers: 'WorldGen_Outline', 'format':'image/png', 
'transparent':'true'}, {'ratio':1, isBaseLayer: false} );

            map.addLayers([layer]);            var layer = new 
OpenLayers.Layer.WMS.Untiled( "WorldRoads",
                "http://www2.dmsolutions.ca/cgi-bin/mswms_world?", 
{layers: 'WorldRoads', 'format':'image/png', 'transparent':'true'}, 
{'ratio':1, isBaseLayer: false} );

            map.addLayers([layer]);            var layer = new 
OpenLayers.Layer.WMS.Untiled( "WorldPlaces",
                "http://www2.dmsolutions.ca/cgi-bin/mswms_world?", 
{layers: 'WorldPlaces', 'format':'image/png', 'transparent':'true'}, 
{'ratio':1, isBaseLayer: false} );

            map.addLayers([layer]);            var layer = new 
OpenLayers.Layer.WMS.Untiled( "WorldPOI",
                "http://www2.dmsolutions.ca/cgi-bin/mswms_world?", 
{layers: 'WorldPOI', 'format':'image/png', 'transparent':'true'}, 
{'ratio':1, isBaseLayer: false} );

            map.addLayers([layer]);            map.addControl(new 
OpenLayers.Control.LayerSwitcher());
            //map.addControl(new OpenLayers.Control.OverviewMap());

            map.zoomToMaxExtent();
        }

function CWC2OnLoadFunction()
{

mapinit();

}
</SCRIPT>

<title>Chameleon Sample - OGC Widgets</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">


<body onload="CWC2OnLoadFunction();">
<form>
<div id="map"></div>
</form>
</body>
</html>

Best regards,
Bart

-- 
Bart van den Eijnden
OSGIS, Open Source GIS
bartvde at osgis.nl
http://www.osgis.nl




More information about the Users mailing list