diff --git a/lib/OpenLayers/Layer/VirtualEarth.js b/lib/OpenLayers/Layer/VirtualEarth.js index 445b7d82b8..03ba7e389a 100644 --- a/lib/OpenLayers/Layer/VirtualEarth.js +++ b/lib/OpenLayers/Layer/VirtualEarth.js @@ -4,52 +4,6 @@ // @require: OpenLayers/Layer.js -if (typeof VEMap != "undefined") { - - /** Hack-on function because VE does not give it to us - * - * @param {VELatLong} veLatLng - * - * @returns A Pixel specifying veLatLong translated into "Container" coords - * @type Pixel - */ - VEMap.prototype.fromLatLngToContainerPixel = function(veLatLong) { - - // first we translate into "DivPixel" - var pixel = this.LatLongToPixel(veLatLong); - - // locate the upper-left tile - var tile = this.mapelement.firstChild.childNodes[2]; - - // adjust by the offset of tile - pixel.x += tile.offsetLeft; - pixel.y += tile.offsetTop; - - return pixel; - }; - - /** Hack-on function because VE does not give it to us - * - * @param {Pixel} pixel - * - * @returns A VELatLong specifying "Container" pixel translated to lonlat - * @type VELatLong - */ - VEMap.prototype.fromContainerPixelToLatLng = function(pixel) { - - // locate the upper-left tile - var tile = this.mapelement.firstChild.childNodes[2]; - - // adjust by the offset of tile - pixel.x -= tile.offsetLeft; - pixel.y -= tile.offsetTop; - - // first we translate into "DivPixel" - return this.PixelToLatLong(pixel); - }; - -} - /** * @class */ @@ -218,10 +172,7 @@ OpenLayers.Layer.VirtualEarth.prototype = var lonlat = null; if (this.vemap != null) { var pixel = this.getPixelFromOLPixel(viewPortPx); - - // note we use special hacked function here - var veLatLong = this.vemap.fromContainerPixelToLatLng(pixel) - + var veLatLong = this.vemap.PixelToLatLong(pixel) lonlat = this.getOLLonLatFromVELatLong(veLatLong); } return lonlat; @@ -240,10 +191,7 @@ OpenLayers.Layer.VirtualEarth.prototype = var viewPortPx = null; if (this.vemap != null) { var veLatLong = this.getVELatLongFromOLLonLat(lonlat); - - // note we use special hacked function here - var pixel = this.vemap.fromLatLngToContainerPixel(veLatLong); - + var pixel = this.vemap.LatLongToPixel(veLatLong); viewPortPx = this.getOLPixelFromPixel(pixel); } return viewPortPx;