Set up a resize event listener to call map.updateSize() as necessary.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@262 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -5,7 +5,8 @@ OpenLayers.Events.prototype = {
|
||||
BROWSER_EVENTS: [
|
||||
"mouseover", "mouseout",
|
||||
"mousedown", "mouseup", "mousemove",
|
||||
"click", "dblclick"
|
||||
"click", "dblclick",
|
||||
"resize", "focus", blur"
|
||||
],
|
||||
|
||||
// hash of Array(Function): events listener functions
|
||||
|
||||
@@ -85,6 +85,10 @@ OpenLayers.Map.prototype = {
|
||||
|
||||
this.events = new OpenLayers.Events(this, div, this.EVENT_TYPES);
|
||||
|
||||
this.updateSize();
|
||||
// update the internal size register whenever the div is resized
|
||||
this.events.register("resize", this, updateSize);
|
||||
|
||||
this.layers = [];
|
||||
|
||||
if (!this.controls) {
|
||||
@@ -96,8 +100,6 @@ OpenLayers.Map.prototype = {
|
||||
|
||||
this.popups = new Array();
|
||||
|
||||
this.updateSize();
|
||||
|
||||
// always call map.destroy()
|
||||
Event.observe(window, 'unload',
|
||||
this.destroy.bindAsEventListener(this));
|
||||
|
||||
Reference in New Issue
Block a user