OpenLayers OpenLayers

Changeset 6765

Show
Ignore:
Timestamp:
04/02/08 10:08:01 (8 months ago)
Author:
crschmidt
Message:

The FramedCloud popup throws an error if you attempt to call setContentHTML
before you add the popup to the map. To prevent this, don't call construct
or updateBlocks if relativePosition is null, to prevent this error message.
r=elemoine, (Pullup #1479)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Popup/Framed.js

    r6718 r6765  
    249249     */ 
    250250    createBlocks: function() { 
     251        if (!this.relativePosition) { 
     252            // this.relativePosition can't be set until we have a map 
     253            // set: if it's not set, we can't create blocks. (See #1479)  
     254            return false;  
     255        }     
     256         
    251257        this.blocks = []; 
    252258 
     
    275281            this.groupDiv.appendChild(block.div); 
    276282        } 
     283         
     284        return true; 
    277285    }, 
    278286 
     
    284292     */ 
    285293    updateBlocks: function() { 
    286  
    287294        if (!this.blocks) { 
    288             this.createBlocks(); 
    289         } 
    290  
     295            var cont = this.createBlocks(); 
     296            if (!cont) {  
     297                return false; 
     298            }      
     299        } 
     300         
     301         
    291302        var position = this.positionBlocks[this.relativePosition]; 
    292303        for (var i = 0; i < position.blocks.length; i++) { 
  • trunk/openlayers/tests/list-tests.html

    r6723 r6765  
    4141    <li>Popup/Anchored.html</li> 
    4242    <li>Popup/AnchoredBubble.html</li> 
     43    <li>Popup/FramedCloud.html</li> 
    4344    <li>Feature.html</li> 
    4445    <li>Feature/Vector.html</li>