OpenLayers OpenLayers

Changeset 3843

Show
Ignore:
Timestamp:
08/03/07 15:27:39 (1 year ago)
Author:
euzuro
Message:

fix for #677 -- making yahoo maps deal with size correctly (safari and general karma fix)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Layer/Yahoo.js

    r3787 r3843  
    6060    loadMapObject:function() { 
    6161        try { //do not crash!  
    62             this.mapObject = new YMap(this.div, this.type); 
     62            var size = this.getMapObjectSizeFromOLSize(this.map.getSize()); 
     63            this.mapObject = new YMap(this.div, this.type, size); 
    6364            this.mapObject.disableKeyControls(); 
    6465        } catch(e) {} 
    6566    }, 
     67 
     68    /** 
     69     * Method: onMapResize 
     70     *  
     71     */ 
     72    onMapResize: function() { 
     73        try { 
     74            var size = this.getMapObjectSizeFromOLSize(this.map.getSize()); 
     75            this.mapObject.resizeTo(size); 
     76        } catch(e) {}      
     77    },     
    6678     
    6779     
     
    337349        return new YCoordPoint(x, y); 
    338350    }, 
    339  
     351     
     352  // Size 
     353   
     354    /** 
     355     * APIMethod: getMapObjectSizeFromOLSize 
     356     *  
     357     * Parameters: 
     358     * olSize - {<OpenLayers.Size>} 
     359     *  
     360     * Return: 
     361     * {Object} MapObject Size from olSize parameter 
     362     */ 
     363    getMapObjectSizeFromOLSize: function(olSize) { 
     364        return new YSize(olSize.w, olSize.h); 
     365    }, 
     366     
    340367    CLASS_NAME: "OpenLayers.Layer.Yahoo" 
    341368}); 
  • trunk/openlayers/tests/list-tests.html

    r3807 r3843  
    5252    <li>Layer/test_TileCache.html</li> 
    5353    <li>Layer/test_Vector.html</li> 
     54    <li>Layer/test_Yahoo.html</li> 
    5455    <li>Layer/test_GML.html</li> 
    5556    <li>Layer/test_WrapDateLine.html</li>