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:
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
<title>OpenLayers Virtual Earth Example</title>
|
<title>OpenLayers Virtual Earth Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||||
<script src='http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js'></script>
|
<script src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1'></script>
|
||||||
|
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|||||||
@@ -209,7 +209,10 @@ OpenLayers.Layer.VirtualEarth = OpenLayers.Class(
|
|||||||
* {Object} MapObject LonLat translated from MapObject Pixel
|
* {Object} MapObject LonLat translated from MapObject Pixel
|
||||||
*/
|
*/
|
||||||
getMapObjectLonLatFromMapObjectPixel: function(moPixel) {
|
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
|
* {Object} MapObject Pixel from x and y parameters
|
||||||
*/
|
*/
|
||||||
getMapObjectPixelFromXY: function(x, y) {
|
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"
|
CLASS_NAME: "OpenLayers.Layer.VirtualEarth"
|
||||||
|
|||||||
Reference in New Issue
Block a user