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

git-svn-id: http://svn.openlayers.org/trunk/openlayers@3843 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2007-08-03 19:27:39 +00:00
parent b09585b603
commit f3593fc839
3 changed files with 150 additions and 2 deletions

View File

@@ -59,10 +59,22 @@ OpenLayers.Layer.Yahoo = OpenLayers.Class(
*/
loadMapObject:function() {
try { //do not crash!
this.mapObject = new YMap(this.div, this.type);
var size = this.getMapObjectSizeFromOLSize(this.map.getSize());
this.mapObject = new YMap(this.div, this.type, size);
this.mapObject.disableKeyControls();
} catch(e) {}
},
/**
* Method: onMapResize
*
*/
onMapResize: function() {
try {
var size = this.getMapObjectSizeFromOLSize(this.map.getSize());
this.mapObject.resizeTo(size);
} catch(e) {}
},
/**
@@ -336,6 +348,21 @@ OpenLayers.Layer.Yahoo = OpenLayers.Class(
getMapObjectPixelFromXY: function(x, y) {
return new YCoordPoint(x, y);
},
// Size
/**
* APIMethod: getMapObjectSizeFromOLSize
*
* Parameters:
* olSize - {<OpenLayers.Size>}
*
* Return:
* {Object} MapObject Size from olSize parameter
*/
getMapObjectSizeFromOLSize: function(olSize) {
return new YSize(olSize.w, olSize.h);
},
CLASS_NAME: "OpenLayers.Layer.Yahoo"
});