diff --git a/lib/OpenLayers/Layer/Yahoo.js b/lib/OpenLayers/Layer/Yahoo.js index ab13d3ca47..689b7c3856 100644 --- a/lib/OpenLayers/Layer/Yahoo.js +++ b/lib/OpenLayers/Layer/Yahoo.js @@ -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 - {} + * + * Return: + * {Object} MapObject Size from olSize parameter + */ + getMapObjectSizeFromOLSize: function(olSize) { + return new YSize(olSize.w, olSize.h); + }, + CLASS_NAME: "OpenLayers.Layer.Yahoo" }); diff --git a/tests/Layer/test_Yahoo.html b/tests/Layer/test_Yahoo.html new file mode 100755 index 0000000000..5ec5978978 --- /dev/null +++ b/tests/Layer/test_Yahoo.html @@ -0,0 +1,120 @@ + + + + + + + +
+ + diff --git a/tests/list-tests.html b/tests/list-tests.html index aad909b016..c8fa8d7528 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -51,6 +51,7 @@
  • Layer/test_TMS.html
  • Layer/test_TileCache.html
  • Layer/test_Vector.html
  • +
  • Layer/test_Yahoo.html
  • Layer/test_GML.html
  • Layer/test_WrapDateLine.html
  • test_Tile.html