hide Terms Of Use for invisible Google Layers using a negative offset,
because during GMap2 initialization, we don't have control over style.display. r=fredj (closes #2328) git-svn-id: http://svn.openlayers.org/trunk/openlayers@10069 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -217,7 +217,7 @@ OpenLayers.Layer.Google = OpenLayers.Class(
|
||||
delete layer._resized;
|
||||
layer.mapObject.checkResize();
|
||||
layer.moveTo(layer.map.getCenter(), layer.map.getZoom());
|
||||
})
|
||||
});
|
||||
}
|
||||
this._resized = true;
|
||||
}
|
||||
@@ -257,6 +257,7 @@ OpenLayers.Layer.Google = OpenLayers.Class(
|
||||
if (visible === true) {
|
||||
this.mapObject.setMapType(this.type);
|
||||
container.style.display = "";
|
||||
this.termsOfUse.style.left = "";
|
||||
this.termsOfUse.style.display = "";
|
||||
this.poweredBy.style.display = "";
|
||||
cache.displayed = this.id;
|
||||
@@ -267,6 +268,12 @@ OpenLayers.Layer.Google = OpenLayers.Class(
|
||||
if (!cache.displayed) {
|
||||
container.style.display = "none";
|
||||
this.termsOfUse.style.display = "none";
|
||||
// move ToU far to the left in addition to setting display
|
||||
// to "none", because at the end of the GMap2 load
|
||||
// sequence, display: none will be unset and ToU would be
|
||||
// visible after loading a map with a google layer that is
|
||||
// initially hidden.
|
||||
this.termsOfUse.style.left = "-9999px";
|
||||
this.poweredBy.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user