OpenLayers OpenLayers

Changeset 7660

Show
Ignore:
Timestamp:
08/01/08 11:34:50 (4 months ago)
Author:
euzuro
Message:

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)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/examples/ve.html

    r7095 r7660  
    44    <link rel="stylesheet" href="../theme/default/style.css" type="text/css" /> 
    55    <link rel="stylesheet" href="style.css" type="text/css" /> 
    6     <script src='http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js'></script> 
     6    <script src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1'></script> 
    77 
    88    <script src="../lib/OpenLayers.js"></script> 
  • trunk/openlayers/lib/OpenLayers/Layer/VirtualEarth.js

    r7341 r7660  
    210210     */ 
    211211    getMapObjectLonLatFromMapObjectPixel: function(moPixel) { 
    212         return this.mapObject.PixelToLatLong(moPixel.x, moPixel.y); 
     212        //the conditional here is to test if we are running the v6 of VE 
     213        return (typeof VEPixel != 'undefined')  
     214            ? this.mapObject.PixelToLatLong(moPixel) 
     215            : this.mapObject.PixelToLatLong(moPixel.x, moPixel.y); 
    213216    }, 
    214217 
     
    326329     */ 
    327330    getMapObjectPixelFromXY: function(x, y) { 
    328         return new Msn.VE.Pixel(x, y); 
     331        //the conditional here is to test if we are running the v6 of VE 
     332        return (typeof VEPixel != 'undefined') ? new VEPixel(x, y) 
     333                         : new Msn.VE.Pixel(x, y); 
    329334    }, 
    330335