Changeset 1275
- Timestamp:
- 08/17/06 01:52:07 (2 years ago)
- Files:
-
- branches/openlayers/2.0/lib/OpenLayers/Layer.js (modified) (1 diff)
- branches/openlayers/2.0/lib/OpenLayers/Layer/Google.js (modified) (1 diff)
- branches/openlayers/2.0/lib/OpenLayers/Map.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/openlayers/2.0/lib/OpenLayers/Layer.js
r1259 r1275 149 149 }, 150 150 151 /** 152 * 153 */ 154 onMapResize: function() { 155 //this function can be implemented by subclasses 156 }, 151 157 152 158 /** branches/openlayers/2.0/lib/OpenLayers/Layer/Google.js
r1262 r1275 146 146 this.loadWarningMessage(); 147 147 } 148 }, 149 150 /** 151 * @param {Event} evt 152 */ 153 onMapResize: function() { 154 this.gmap.checkResize(); 148 155 }, 149 156 branches/openlayers/2.0/lib/OpenLayers/Map.js
r1259 r1275 149 149 this.updateSize.bindAsEventListener(this)); 150 150 } 151 151 152 152 //set the default options 153 153 this.setOptions(options); … … 471 471 this.size = oldSize = newSize; 472 472 if (!newSize.equals(oldSize)) { 473 // move the layer container so that the map is still centered 474 var dx = (newSize.w - oldSize.w) / 2, 475 dy = (newSize.h - oldSize.h) / 2; 476 var lcStyle = this.layerContainerDiv.style; 477 lcStyle.left = (parseInt(lcStyle.left) + dx) + "px"; 478 lcStyle.top = (parseInt(lcStyle.top ) + dy) + "px"; 479 // reset the map center 480 this.layerContainerOrigin = this.center.clone(); 473 474 //notify layers of mapresize 475 for(var i=0; i < this.layers.length; i++) { 476 this.layers[i].onMapResize(); 477 } 478 479 var center = new OpenLayers.Pixel(newSize.w /2, newSize.h / 2); 480 481 var zoom = this.getZoom(); 482 this.zoom = null; 483 this.setCenter(center, zoom); 484 481 485 // store the new size 482 486 this.size = newSize;
