Revert "Merge pull request #708 from mpriour/displayEvent"
This reverts commit0b3f582e10, reversing changes made to74103ec3e0. The reason for reverting this is a regression. See #997.
This commit is contained in:
committed by
Bart van den Eijnden
parent
fe0ffbf56e
commit
cc69b73dcf
@@ -743,6 +743,12 @@ OpenLayers.Layer = OpenLayers.Class({
|
||||
this.visibility = visibility;
|
||||
this.display(visibility);
|
||||
this.redraw();
|
||||
if (this.map != null) {
|
||||
this.map.events.triggerEvent("changelayer", {
|
||||
layer: this,
|
||||
property: "visibility"
|
||||
});
|
||||
}
|
||||
this.events.triggerEvent("visibilitychanged");
|
||||
}
|
||||
},
|
||||
@@ -759,11 +765,6 @@ OpenLayers.Layer = OpenLayers.Class({
|
||||
display: function(display) {
|
||||
if (display != (this.div.style.display != "none")) {
|
||||
this.div.style.display = (display && this.calculateInRange()) ? "block" : "none";
|
||||
if(this.map){
|
||||
this.map.events.triggerEvent("changelayer", {
|
||||
layer: this, property: "visibility"
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -2038,7 +2038,9 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
if (!inRange) {
|
||||
layer.display(false);
|
||||
}
|
||||
|
||||
this.events.triggerEvent("changelayer", {
|
||||
layer: layer, property: "visibility"
|
||||
});
|
||||
}
|
||||
if (inRange && layer.visibility) {
|
||||
layer.moveTo(bounds, zoomChanged, options.dragging);
|
||||
|
||||
Reference in New Issue
Block a user