Fire the 'changelayer:visibility' event from layer's display method
Move the changelayer event firing logic for in / out of resolution range from the Map class to the Layer class. Tests have been also been created to specifically test that the display method works correctly and fires events only when needed.
This commit is contained in:
@@ -1976,9 +1976,7 @@ 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