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:
@@ -85,10 +85,14 @@ 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) {
|
||||
this.controls = [];
|
||||
this.controls = [];
|
||||
this.addControl(new OpenLayers.Control.MouseDefaults(), null );
|
||||
this.addControl(new OpenLayers.Control.PanZoom(),
|
||||
new OpenLayers.Pixel(4,4) );
|
||||
@@ -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