Get our VirtualEarth layer working again with the latest (6.1) version. Backwards compatible with earlier versions thanks to soft insistence of cr5. Thanks to funkyc for the co-sleuthing. r=cr5 (Closes #1540)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@7660 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2008-08-01 15:34:50 +00:00
parent 558cd57e41
commit 6f73b412c2
2 changed files with 8 additions and 3 deletions

View File

@@ -209,7 +209,10 @@ OpenLayers.Layer.VirtualEarth = OpenLayers.Class(
* {Object} MapObject LonLat translated from MapObject Pixel
*/
getMapObjectLonLatFromMapObjectPixel: function(moPixel) {
return this.mapObject.PixelToLatLong(moPixel.x, moPixel.y);
//the conditional here is to test if we are running the v6 of VE
return (typeof VEPixel != 'undefined')
? this.mapObject.PixelToLatLong(moPixel)
: this.mapObject.PixelToLatLong(moPixel.x, moPixel.y);
},
/**
@@ -325,7 +328,9 @@ OpenLayers.Layer.VirtualEarth = OpenLayers.Class(
* {Object} MapObject Pixel from x and y parameters
*/
getMapObjectPixelFromXY: function(x, y) {
return new Msn.VE.Pixel(x, y);
//the conditional here is to test if we are running the v6 of VE
return (typeof VEPixel != 'undefined') ? new VEPixel(x, y)
: new Msn.VE.Pixel(x, y);
},
CLASS_NAME: "OpenLayers.Layer.VirtualEarth"