Google layer improvements for maps with allOverlays set to true. r=tschaub (closes #2758)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10550 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2010-07-29 07:23:02 +00:00
parent ca27481c66
commit a5f2ddcfa1
4 changed files with 118 additions and 17 deletions

View File

@@ -156,13 +156,41 @@ OpenLayers.Layer.Google = OpenLayers.Class(
* visible - {Boolean} Display the layer (if in range)
*/
setVisibility: function(visible) {
this.setGMapVisibility(visible);
// sharing a map container, opacity has to be set per layer
var opacity = this.opacity == null ? 1 : this.opacity;
OpenLayers.Layer.EventPane.prototype.setVisibility.apply(this, arguments);
this.setOpacity(opacity);
},
/**
* APIMethod: display
* Hide or show the Layer
*
* Parameters:
* display - {Boolean}
*/
display: function(visible) {
if (!this._dragging) {
this.setGMapVisibility(visible);
}
OpenLayers.Layer.EventPane.prototype.display.apply(this, arguments);
},
/**
* Method: moveTo
*
* Parameters:
* bound - {<OpenLayers.Bounds>}
* zoomChanged - {Boolean} Tells when zoom has changed, as layers have to
* do some init work in that case.
* dragging - {Boolean}
*/
moveTo: function(bounds, zoomChanged, dragging) {
this._dragging = dragging;
OpenLayers.Layer.EventPane.prototype.moveTo.apply(this, arguments);
delete this._dragging;
},
/**
* APIMethod: setOpacity
* Sets the opacity for the entire layer (all images)