Create a new reliable updatesize event.
The resize event is not fired in all browsers. What we actually need is an event that is called every time the updateSize method is called.
This commit is contained in:
@@ -99,7 +99,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
|
||||
this.map.events.un({
|
||||
"changebaselayer": this.redraw,
|
||||
"resize": this.redraw,
|
||||
"updatesize": this.redraw,
|
||||
scope: this
|
||||
});
|
||||
|
||||
@@ -119,7 +119,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
OpenLayers.Control.PanZoom.prototype.setMap.apply(this, arguments);
|
||||
this.map.events.on({
|
||||
"changebaselayer": this.redraw,
|
||||
"resize": this.redraw,
|
||||
"updatesize": this.redraw,
|
||||
scope: this
|
||||
});
|
||||
},
|
||||
|
||||
@@ -83,6 +83,7 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
* mouseout - triggered after mouseout the map
|
||||
* mousemove - triggered after mousemove the map
|
||||
* changebaselayer - triggered after the base layer changes
|
||||
* updatesize - triggered after the <updateSize> method was executed
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -1490,6 +1491,7 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
|
||||
}
|
||||
}
|
||||
this.events.triggerEvent("updatesize");
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user