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

@@ -102,8 +102,8 @@ OpenLayers.Layer.Google.v3 = {
OpenLayers.Function.bind(this.repositionMapElements, this)
);
}
this.mapObject = mapObject;
this.setGMapVisibility(this.visibility);
},
/**
@@ -146,7 +146,7 @@ OpenLayers.Layer.Google.v3 = {
poweredBy.className = "olLayerGooglePoweredBy olLayerGoogleV3 gmnoprint";
poweredBy.style.display = "";
cache.poweredBy = poweredBy;
this.setGMapVisibility(true);
},
@@ -183,7 +183,7 @@ OpenLayers.Layer.Google.v3 = {
var container = this.mapObject.getDiv();
if (visible === true) {
this.mapObject.setMapTypeId(this.type);
container.style.display = "";
container.style.left = "";
if (cache.termsOfUse && cache.termsOfUse.style) {
cache.termsOfUse.style.left = "";
cache.termsOfUse.style.display = "";
@@ -195,7 +195,7 @@ OpenLayers.Layer.Google.v3 = {
delete cache.displayed;
}
if (!cache.displayed) {
container.style.display = "none";
container.style.left = "-9999px";
if (cache.termsOfUse && cache.termsOfUse.style) {
cache.termsOfUse.style.display = "none";
// move ToU far to the left in addition to setting