Making it so the Google layer is not visible if used as an overlay with visibility false. Container is offset to allow proper calculation of size. r=ahocevar (closes #2730)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10480 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2010-07-09 21:52:04 +00:00
parent 3d0c264198
commit afa7b9c2bb
4 changed files with 79 additions and 5 deletions

View File

@@ -226,7 +226,7 @@
gmap.repositionMapElements = function() {
++called;
original.apply(gmap, arguments);
}
}
gmap.setVisibility(true);
t.delay_call(2, function() {
@@ -235,6 +235,32 @@
});
}
function test_allOverlays_invisible(t) {
t.plan(1);
var map = new OpenLayers.Map('map', {allOverlays: true});
var osm = new OpenLayers.Layer.OSM();
var gmap = new OpenLayers.Layer.Google("Google Streets", {visibility: false});
// keep track of last argument to setGMapVisibility
var visible;
var original = gmap.setGMapVisibility;
gmap.setGMapVisibility = function(vis) {
visible = vis;
original.apply(gmap, arguments);
}
map.addLayers([osm, gmap]);
map.zoomToMaxExtent();
t.ok(visible === false, "setGMapVisibility last called with false");
map.destroy();
}
</script>
</head>
<body>