Adding registerImageListener() function that sits around and waits until images load in our popups... and when they do, it calls updateSize() so that the popup is sized correctly. thanks for the sharp review cr5 (Closes #1469)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7887 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -879,11 +879,24 @@
|
||||
<div id="map" class="smallmap"></div>
|
||||
|
||||
<!-- preloading these images so the autosize will work correctly -->
|
||||
<img src="small.jpg" style="position:absolute; top:-5000px; left: -5000px"></img>
|
||||
<img src="wideshort.jpg" style="position:absolute; top:-5000px; left: -5000px"></img>
|
||||
<img src="widelong.jpg" style="position:absolute; top:-5000px; left: -5000px"></img>
|
||||
<img src="thinlong.jpg" style="position:absolute; top:-5000px; left: -5000px"></img>
|
||||
|
||||
<p> All of the images in this file a pre-cached, meaning they are
|
||||
loaded immediately when you load the page (they are just placed
|
||||
far offscreen, that's why you don't see them).
|
||||
</p>
|
||||
<br>
|
||||
<p> The only image that is *not* preloaded is small.jpg, the brazilian
|
||||
flag. We do this in order to test out to make sure that our auto-sizing
|
||||
code does in fact activate itself as the images load. To verify
|
||||
this, clear your cache and reload this example page. Click on
|
||||
any of the markers in the 'AutoSize' row. If the popup autosizes
|
||||
to correctly contain the entire flag: golden. If the popup is
|
||||
tiny and you can only see a corner of it, then this code is broken.
|
||||
</p>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user