Changeset 1174
- Timestamp:
- 08/09/06 17:17:06 (2 years ago)
- Files:
-
- trunk/openlayers/examples/xhtml.html (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Map.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/examples/xhtml.html
r1098 r1174 1 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 2 2 "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml">4 <head>3 <html xmlns="http://www.w3.org/1999/xhtml" style="width:100%"> 4 <head> 5 5 <script src="../lib/OpenLayers.js"></script> 6 6 </head> 7 <body >7 <body style="width:100%"> 8 8 <div style="width:100%; height:500px" id="map"></div> 9 9 <script defer="defer" type="text/javascript"> trunk/openlayers/lib/OpenLayers/Map.js
r1173 r1174 469 469 updateSize: function() { 470 470 var newSize = this.getCurrentSize(); 471 472 if (!newSize.equals(this.getSize())) { 471 var oldSize = this.getSize(); 472 if (oldSize == null) 473 this.size = oldSize = newSize; 474 if (!newSize.equals(oldSize)) { 475 // move the layer container so that the map is still centered 476 var dx = (newSize.w - oldSize.w) / 2, 477 dy = (newSize.h - oldSize.h) / 2; 478 var lcStyle = this.layerContainerDiv.style; 479 lcStyle.left = (parseInt(lcStyle.left) + dx) + "px"; 480 lcStyle.top = (parseInt(lcStyle.top ) + dy) + "px"; 481 // reset the map center 482 this.layerContainerOrigin = this.center.clone(); 483 // store the new size 484 this.size = newSize; 485 // the div might have moved on the page, also 473 486 this.events.element.offsets = null; 474 this.size = newSize;475 487 } 476 488 },
