From 8d01fa6fd8f605d41c2ca9c75340b3d5437e76e6 Mon Sep 17 00:00:00 2001 From: fredj Date: Fri, 18 Nov 2011 12:13:41 +0100 Subject: [PATCH 1/3] move Layer.Yahoo into deprecated.js --- examples/spherical-mercator.html | 22 +- examples/yahoo.html | 52 --- lib/OpenLayers.js | 1 - lib/OpenLayers/Layer/Yahoo.js | 431 ------------------------ lib/deprecated.js | 419 +++++++++++++++++++++++ tests/{ => deprecated}/Layer/Yahoo.html | 3 +- tests/list-tests.html | 2 +- 7 files changed, 425 insertions(+), 505 deletions(-) delete mode 100644 examples/yahoo.html delete mode 100644 lib/OpenLayers/Layer/Yahoo.js rename tests/{ => deprecated}/Layer/Yahoo.html (97%) diff --git a/examples/spherical-mercator.html b/examples/spherical-mercator.html index 88e207f27a..bb95cbb87d 100644 --- a/examples/spherical-mercator.html +++ b/examples/spherical-mercator.html @@ -20,7 +20,6 @@ - @@ -28,11 +27,11 @@

OpenLayers Spherical Mercator Example

- spherical, mercator, osm, xyz, google, virtual earth, yahoo, tile + spherical, mercator, osm, xyz, google, virtual earth, tile

Shows the use of the Spherical Mercator Layers, for overlaying - Google, Yahoo, Microsoft, and other layers with XYZ tiles. + Google, Microsoft, and other layers with XYZ tiles.

@@ -89,20 +88,6 @@ wrapDateLine: true }); - // create Yahoo layer - var yahoo = new OpenLayers.Layer.Yahoo( - "Yahoo Street", - {sphericalMercator: true} - ); - var yahoosat = new OpenLayers.Layer.Yahoo( - "Yahoo Satellite", - {'type': YAHOO_MAP_SAT, sphericalMercator: true} - ); - var yahoohyb = new OpenLayers.Layer.Yahoo( - "Yahoo Hybrid", - {'type': YAHOO_MAP_HYB, sphericalMercator: true} - ); - // create OSM layers var mapnik = new OpenLayers.Layer.OSM(); @@ -115,8 +100,7 @@ var vector = new OpenLayers.Layer.Vector("Editable Vectors"); map.addLayers([ - gphy, gmap, gsat, ghyb, veroad, veaer, vehyb, yahoo, yahoosat, - yahoohyb, mapnik, osmarender, vector + gphy, gmap, gsat, ghyb, veroad, veaer, vehyb, mapnik, osmarender, vector ]); map.addControl(new OpenLayers.Control.LayerSwitcher()); map.addControl(new OpenLayers.Control.EditingToolbar(vector)); diff --git a/examples/yahoo.html b/examples/yahoo.html deleted file mode 100644 index 6a584c7b41..0000000000 --- a/examples/yahoo.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - OpenLayers: Yahoo Layer - - - - - - - -

Yahoo Base Layer Example

- -
- yahoo, layer -
- -

- Shows how you would add a yahoo layer and add the LayerSwitcher control -

- -
- -
-

This is an example of how to add a yahoo layer to the OpenLayers - window. In order to enable a yahoo layer, also shown in this - example is the LayerSwitcher() control for toggling between both - the yahoo layer and the OSGeo WMS. -

- - - diff --git a/lib/OpenLayers.js b/lib/OpenLayers.js index 9a844176f1..c654d2e63e 100644 --- a/lib/OpenLayers.js +++ b/lib/OpenLayers.js @@ -128,7 +128,6 @@ "OpenLayers/Layer/FixedZoomLevels.js", "OpenLayers/Layer/Google.js", "OpenLayers/Layer/Google/v3.js", - "OpenLayers/Layer/Yahoo.js", "OpenLayers/Layer/HTTPRequest.js", "OpenLayers/Layer/Grid.js", "OpenLayers/Layer/MapGuide.js", diff --git a/lib/OpenLayers/Layer/Yahoo.js b/lib/OpenLayers/Layer/Yahoo.js deleted file mode 100644 index 281838708c..0000000000 --- a/lib/OpenLayers/Layer/Yahoo.js +++ /dev/null @@ -1,431 +0,0 @@ -/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for - * full list of contributors). Published under the Clear BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the - * full text of the license. */ - - -/** - * @requires OpenLayers/Layer/SphericalMercator.js - * @requires OpenLayers/Layer/EventPane.js - * @requires OpenLayers/Layer/FixedZoomLevels.js - * @requires OpenLayers/Lang.js - */ - -/** - * Class: OpenLayers.Layer.Yahoo - * - * Inherits from: - * - - * - - */ -OpenLayers.Layer.Yahoo = OpenLayers.Class( - OpenLayers.Layer.EventPane, OpenLayers.Layer.FixedZoomLevels, { - - /** - * Constant: MIN_ZOOM_LEVEL - * {Integer} 0 - */ - MIN_ZOOM_LEVEL: 0, - - /** - * Constant: MAX_ZOOM_LEVEL - * {Integer} 17 - */ - MAX_ZOOM_LEVEL: 17, - - /** - * Constant: RESOLUTIONS - * {Array(Float)} Hardcode these resolutions so that they are more closely - * tied with the standard wms projection - */ - RESOLUTIONS: [ - 1.40625, - 0.703125, - 0.3515625, - 0.17578125, - 0.087890625, - 0.0439453125, - 0.02197265625, - 0.010986328125, - 0.0054931640625, - 0.00274658203125, - 0.001373291015625, - 0.0006866455078125, - 0.00034332275390625, - 0.000171661376953125, - 0.0000858306884765625, - 0.00004291534423828125, - 0.00002145767211914062, - 0.00001072883605957031 - ], - - /** - * APIProperty: type - * {YahooMapType} - */ - type: null, - - /** - * APIProperty: wrapDateLine - * {Boolean} Allow user to pan forever east/west. Default is true. - * Setting this to false only restricts panning if - * is true. - */ - wrapDateLine: true, - - /** - * APIProperty: sphericalMercator - * {Boolean} Should the map act as a mercator-projected map? This will - * cause all interactions with the map to be in the actual map projection, - * which allows support for vector drawing, overlaying other maps, etc. - */ - sphericalMercator: false, - - /** - * Constructor: OpenLayers.Layer.Yahoo - * - * Parameters: - * name - {String} - * options - {Object} - */ - initialize: function(name, options) { - OpenLayers.Layer.EventPane.prototype.initialize.apply(this, arguments); - OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this, - arguments); - if(this.sphericalMercator) { - OpenLayers.Util.extend(this, OpenLayers.Layer.SphericalMercator); - this.initMercatorParameters(); - } - }, - - /** - * Method: loadMapObject - */ - loadMapObject:function() { - try { //do not crash! - var size = this.getMapObjectSizeFromOLSize(this.map.getSize()); - this.mapObject = new YMap(this.div, this.type, size); - this.mapObject.disableKeyControls(); - this.mapObject.disableDragMap(); - - //can we do smooth panning? (moveByXY is not an API function) - if ( !this.mapObject.moveByXY || - (typeof this.mapObject.moveByXY != "function" ) ) { - - this.dragPanMapObject = null; - } - } catch(e) {} - }, - - /** - * Method: onMapResize - * - */ - onMapResize: function() { - try { - var size = this.getMapObjectSizeFromOLSize(this.map.getSize()); - this.mapObject.resizeTo(size); - } catch(e) {} - }, - - - /** - * APIMethod: setMap - * Overridden from EventPane because we need to remove this yahoo event - * pane which prohibits our drag and drop, and we can only do this - * once the map has been loaded and centered. - * - * Parameters: - * map - {} - */ - setMap: function(map) { - OpenLayers.Layer.EventPane.prototype.setMap.apply(this, arguments); - - this.map.events.register("moveend", this, this.fixYahooEventPane); - }, - - /** - * Method: fixYahooEventPane - * The map has been centered, so the mysterious yahoo eventpane has been - * added. we remove it so that it doesnt mess with *our* event pane. - */ - fixYahooEventPane: function() { - var yahooEventPane = OpenLayers.Util.getElement("ygddfdiv"); - if (yahooEventPane != null) { - if (yahooEventPane.parentNode != null) { - yahooEventPane.parentNode.removeChild(yahooEventPane); - } - this.map.events.unregister("moveend", this, - this.fixYahooEventPane); - } - }, - - /** - * APIMethod: getWarningHTML - * - * Returns: - * {String} String with information on why layer is broken, how to get - * it working. - */ - getWarningHTML:function() { - return OpenLayers.i18n( - "getLayerWarning", {'layerType':'Yahoo', 'layerLib':'Yahoo'} - ); - }, - - /********************************************************/ - /* */ - /* Translation Functions */ - /* */ - /* The following functions translate GMaps and OL */ - /* formats for Pixel, LonLat, Bounds, and Zoom */ - /* */ - /********************************************************/ - - - // - // TRANSLATION: MapObject Zoom <-> OpenLayers Zoom - // - - /** - * APIMethod: getOLZoomFromMapObjectZoom - * - * Parameters: - * gZoom - {Integer} - * - * Returns: - * {Integer} An OpenLayers Zoom level, translated from the passed in gZoom - * Returns null if null value is passed in. - */ - getOLZoomFromMapObjectZoom: function(moZoom) { - var zoom = null; - if (moZoom != null) { - zoom = OpenLayers.Layer.FixedZoomLevels.prototype.getOLZoomFromMapObjectZoom.apply(this, [moZoom]); - zoom = 18 - zoom; - } - return zoom; - }, - - /** - * APIMethod: getMapObjectZoomFromOLZoom - * - * Parameters: - * olZoom - {Integer} - * - * Returns: - * {Integer} A MapObject level, translated from the passed in olZoom - * Returns null if null value is passed in - */ - getMapObjectZoomFromOLZoom: function(olZoom) { - var zoom = null; - if (olZoom != null) { - zoom = OpenLayers.Layer.FixedZoomLevels.prototype.getMapObjectZoomFromOLZoom.apply(this, [olZoom]); - zoom = 18 - zoom; - } - return zoom; - }, - - /************************************ - * * - * MapObject Interface Controls * - * * - ************************************/ - - - // Get&Set Center, Zoom - - /** - * APIMethod: setMapObjectCenter - * Set the mapObject to the specified center and zoom - * - * Parameters: - * center - {Object} MapObject LonLat format - * zoom - {int} MapObject zoom format - */ - setMapObjectCenter: function(center, zoom) { - this.mapObject.drawZoomAndCenter(center, zoom); - }, - - /** - * APIMethod: getMapObjectCenter - * - * Returns: - * {Object} The mapObject's current center in Map Object format - */ - getMapObjectCenter: function() { - return this.mapObject.getCenterLatLon(); - }, - - /** - * APIMethod: dragPanMapObject - * - * Parameters: - * dX - {Integer} - * dY - {Integer} - */ - dragPanMapObject: function(dX, dY) { - this.mapObject.moveByXY({ - 'x': -dX, - 'y': dY - }); - }, - - /** - * APIMethod: getMapObjectZoom - * - * Returns: - * {Integer} The mapObject's current zoom, in Map Object format - */ - getMapObjectZoom: function() { - return this.mapObject.getZoomLevel(); - }, - - - // LonLat - Pixel Translation - - /** - * APIMethod: getMapObjectLonLatFromMapObjectPixel - * - * Parameters: - * moPixel - {Object} MapObject Pixel format - * - * Returns: - * {Object} MapObject LonLat translated from MapObject Pixel - */ - getMapObjectLonLatFromMapObjectPixel: function(moPixel) { - return this.mapObject.convertXYLatLon(moPixel); - }, - - /** - * APIMethod: getMapObjectPixelFromMapObjectLonLat - * - * Parameters: - * moLonLat - {Object} MapObject LonLat format - * - * Returns: - * {Object} MapObject Pixel transtlated from MapObject LonLat - */ - getMapObjectPixelFromMapObjectLonLat: function(moLonLat) { - return this.mapObject.convertLatLonXY(moLonLat); - }, - - - /************************************ - * * - * MapObject Primitives * - * * - ************************************/ - - - // LonLat - - /** - * APIMethod: getLongitudeFromMapObjectLonLat - * - * Parameters: - * moLonLat - {Object} MapObject LonLat format - * - * Returns: - * {Float} Longitude of the given MapObject LonLat - */ - getLongitudeFromMapObjectLonLat: function(moLonLat) { - return this.sphericalMercator ? - this.forwardMercator(moLonLat.Lon, moLonLat.Lat).lon : - moLonLat.Lon; - }, - - /** - * APIMethod: getLatitudeFromMapObjectLonLat - * - * Parameters: - * moLonLat - {Object} MapObject LonLat format - * - * Returns: - * {Float} Latitude of the given MapObject LonLat - */ - getLatitudeFromMapObjectLonLat: function(moLonLat) { - return this.sphericalMercator ? - this.forwardMercator(moLonLat.Lon, moLonLat.Lat).lat : - moLonLat.Lat; - }, - - /** - * APIMethod: getMapObjectLonLatFromLonLat - * - * Parameters: - * lon - {Float} - * lat - {Float} - * - * Returns: - * {Object} MapObject LonLat built from lon and lat params - */ - getMapObjectLonLatFromLonLat: function(lon, lat) { - var yLatLong; - if(this.sphericalMercator) { - var lonlat = this.inverseMercator(lon, lat); - yLatLong = new YGeoPoint(lonlat.lat, lonlat.lon); - } else { - yLatLong = new YGeoPoint(lat, lon); - } - return yLatLong; - }, - - // Pixel - - /** - * APIMethod: getXFromMapObjectPixel - * - * Parameters: - * moPixel - {Object} MapObject Pixel format - * - * Returns: - * {Integer} X value of the MapObject Pixel - */ - getXFromMapObjectPixel: function(moPixel) { - return moPixel.x; - }, - - /** - * APIMethod: getYFromMapObjectPixel - * - * Parameters: - * moPixel - {Object} MapObject Pixel format - * - * Returns: - * {Integer} Y value of the MapObject Pixel - */ - getYFromMapObjectPixel: function(moPixel) { - return moPixel.y; - }, - - /** - * APIMethod: getMapObjectPixelFromXY - * - * Parameters: - * x - {Integer} - * y - {Integer} - * - * Returns: - * {Object} MapObject Pixel from x and y parameters - */ - getMapObjectPixelFromXY: function(x, y) { - return new YCoordPoint(x, y); - }, - - // Size - - /** - * APIMethod: getMapObjectSizeFromOLSize - * - * Parameters: - * olSize - {} - * - * Returns: - * {Object} MapObject Size from olSize parameter - */ - getMapObjectSizeFromOLSize: function(olSize) { - return new YSize(olSize.w, olSize.h); - }, - - CLASS_NAME: "OpenLayers.Layer.Yahoo" -}); diff --git a/lib/deprecated.js b/lib/deprecated.js index 3a844da75d..051ecfa76a 100644 --- a/lib/deprecated.js +++ b/lib/deprecated.js @@ -3589,3 +3589,422 @@ OpenLayers.Layer.VirtualEarth = OpenLayers.Class( CLASS_NAME: "OpenLayers.Layer.VirtualEarth" }); + +/** + * Class: OpenLayers.Layer.Yahoo + * + * Inherits from: + * - + * - + */ +OpenLayers.Layer.Yahoo = OpenLayers.Class( + OpenLayers.Layer.EventPane, OpenLayers.Layer.FixedZoomLevels, { + + /** + * Constant: MIN_ZOOM_LEVEL + * {Integer} 0 + */ + MIN_ZOOM_LEVEL: 0, + + /** + * Constant: MAX_ZOOM_LEVEL + * {Integer} 17 + */ + MAX_ZOOM_LEVEL: 17, + + /** + * Constant: RESOLUTIONS + * {Array(Float)} Hardcode these resolutions so that they are more closely + * tied with the standard wms projection + */ + RESOLUTIONS: [ + 1.40625, + 0.703125, + 0.3515625, + 0.17578125, + 0.087890625, + 0.0439453125, + 0.02197265625, + 0.010986328125, + 0.0054931640625, + 0.00274658203125, + 0.001373291015625, + 0.0006866455078125, + 0.00034332275390625, + 0.000171661376953125, + 0.0000858306884765625, + 0.00004291534423828125, + 0.00002145767211914062, + 0.00001072883605957031 + ], + + /** + * APIProperty: type + * {YahooMapType} + */ + type: null, + + /** + * APIProperty: wrapDateLine + * {Boolean} Allow user to pan forever east/west. Default is true. + * Setting this to false only restricts panning if + * is true. + */ + wrapDateLine: true, + + /** + * APIProperty: sphericalMercator + * {Boolean} Should the map act as a mercator-projected map? This will + * cause all interactions with the map to be in the actual map projection, + * which allows support for vector drawing, overlaying other maps, etc. + */ + sphericalMercator: false, + + /** + * Constructor: OpenLayers.Layer.Yahoo + * + * Parameters: + * name - {String} + * options - {Object} + */ + initialize: function(name, options) { + OpenLayers.Layer.EventPane.prototype.initialize.apply(this, arguments); + OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this, + arguments); + if(this.sphericalMercator) { + OpenLayers.Util.extend(this, OpenLayers.Layer.SphericalMercator); + this.initMercatorParameters(); + } + }, + + /** + * Method: loadMapObject + */ + loadMapObject:function() { + try { //do not crash! + var size = this.getMapObjectSizeFromOLSize(this.map.getSize()); + this.mapObject = new YMap(this.div, this.type, size); + this.mapObject.disableKeyControls(); + this.mapObject.disableDragMap(); + + //can we do smooth panning? (moveByXY is not an API function) + if ( !this.mapObject.moveByXY || + (typeof this.mapObject.moveByXY != "function" ) ) { + + this.dragPanMapObject = null; + } + } catch(e) {} + }, + + /** + * Method: onMapResize + * + */ + onMapResize: function() { + try { + var size = this.getMapObjectSizeFromOLSize(this.map.getSize()); + this.mapObject.resizeTo(size); + } catch(e) {} + }, + + + /** + * APIMethod: setMap + * Overridden from EventPane because we need to remove this yahoo event + * pane which prohibits our drag and drop, and we can only do this + * once the map has been loaded and centered. + * + * Parameters: + * map - {} + */ + setMap: function(map) { + OpenLayers.Layer.EventPane.prototype.setMap.apply(this, arguments); + + this.map.events.register("moveend", this, this.fixYahooEventPane); + }, + + /** + * Method: fixYahooEventPane + * The map has been centered, so the mysterious yahoo eventpane has been + * added. we remove it so that it doesnt mess with *our* event pane. + */ + fixYahooEventPane: function() { + var yahooEventPane = OpenLayers.Util.getElement("ygddfdiv"); + if (yahooEventPane != null) { + if (yahooEventPane.parentNode != null) { + yahooEventPane.parentNode.removeChild(yahooEventPane); + } + this.map.events.unregister("moveend", this, + this.fixYahooEventPane); + } + }, + + /** + * APIMethod: getWarningHTML + * + * Returns: + * {String} String with information on why layer is broken, how to get + * it working. + */ + getWarningHTML:function() { + return OpenLayers.i18n( + "getLayerWarning", {'layerType':'Yahoo', 'layerLib':'Yahoo'} + ); + }, + + /********************************************************/ + /* */ + /* Translation Functions */ + /* */ + /* The following functions translate GMaps and OL */ + /* formats for Pixel, LonLat, Bounds, and Zoom */ + /* */ + /********************************************************/ + + + // + // TRANSLATION: MapObject Zoom <-> OpenLayers Zoom + // + + /** + * APIMethod: getOLZoomFromMapObjectZoom + * + * Parameters: + * gZoom - {Integer} + * + * Returns: + * {Integer} An OpenLayers Zoom level, translated from the passed in gZoom + * Returns null if null value is passed in. + */ + getOLZoomFromMapObjectZoom: function(moZoom) { + var zoom = null; + if (moZoom != null) { + zoom = OpenLayers.Layer.FixedZoomLevels.prototype.getOLZoomFromMapObjectZoom.apply(this, [moZoom]); + zoom = 18 - zoom; + } + return zoom; + }, + + /** + * APIMethod: getMapObjectZoomFromOLZoom + * + * Parameters: + * olZoom - {Integer} + * + * Returns: + * {Integer} A MapObject level, translated from the passed in olZoom + * Returns null if null value is passed in + */ + getMapObjectZoomFromOLZoom: function(olZoom) { + var zoom = null; + if (olZoom != null) { + zoom = OpenLayers.Layer.FixedZoomLevels.prototype.getMapObjectZoomFromOLZoom.apply(this, [olZoom]); + zoom = 18 - zoom; + } + return zoom; + }, + + /************************************ + * * + * MapObject Interface Controls * + * * + ************************************/ + + + // Get&Set Center, Zoom + + /** + * APIMethod: setMapObjectCenter + * Set the mapObject to the specified center and zoom + * + * Parameters: + * center - {Object} MapObject LonLat format + * zoom - {int} MapObject zoom format + */ + setMapObjectCenter: function(center, zoom) { + this.mapObject.drawZoomAndCenter(center, zoom); + }, + + /** + * APIMethod: getMapObjectCenter + * + * Returns: + * {Object} The mapObject's current center in Map Object format + */ + getMapObjectCenter: function() { + return this.mapObject.getCenterLatLon(); + }, + + /** + * APIMethod: dragPanMapObject + * + * Parameters: + * dX - {Integer} + * dY - {Integer} + */ + dragPanMapObject: function(dX, dY) { + this.mapObject.moveByXY({ + 'x': -dX, + 'y': dY + }); + }, + + /** + * APIMethod: getMapObjectZoom + * + * Returns: + * {Integer} The mapObject's current zoom, in Map Object format + */ + getMapObjectZoom: function() { + return this.mapObject.getZoomLevel(); + }, + + + // LonLat - Pixel Translation + + /** + * APIMethod: getMapObjectLonLatFromMapObjectPixel + * + * Parameters: + * moPixel - {Object} MapObject Pixel format + * + * Returns: + * {Object} MapObject LonLat translated from MapObject Pixel + */ + getMapObjectLonLatFromMapObjectPixel: function(moPixel) { + return this.mapObject.convertXYLatLon(moPixel); + }, + + /** + * APIMethod: getMapObjectPixelFromMapObjectLonLat + * + * Parameters: + * moLonLat - {Object} MapObject LonLat format + * + * Returns: + * {Object} MapObject Pixel transtlated from MapObject LonLat + */ + getMapObjectPixelFromMapObjectLonLat: function(moLonLat) { + return this.mapObject.convertLatLonXY(moLonLat); + }, + + + /************************************ + * * + * MapObject Primitives * + * * + ************************************/ + + + // LonLat + + /** + * APIMethod: getLongitudeFromMapObjectLonLat + * + * Parameters: + * moLonLat - {Object} MapObject LonLat format + * + * Returns: + * {Float} Longitude of the given MapObject LonLat + */ + getLongitudeFromMapObjectLonLat: function(moLonLat) { + return this.sphericalMercator ? + this.forwardMercator(moLonLat.Lon, moLonLat.Lat).lon : + moLonLat.Lon; + }, + + /** + * APIMethod: getLatitudeFromMapObjectLonLat + * + * Parameters: + * moLonLat - {Object} MapObject LonLat format + * + * Returns: + * {Float} Latitude of the given MapObject LonLat + */ + getLatitudeFromMapObjectLonLat: function(moLonLat) { + return this.sphericalMercator ? + this.forwardMercator(moLonLat.Lon, moLonLat.Lat).lat : + moLonLat.Lat; + }, + + /** + * APIMethod: getMapObjectLonLatFromLonLat + * + * Parameters: + * lon - {Float} + * lat - {Float} + * + * Returns: + * {Object} MapObject LonLat built from lon and lat params + */ + getMapObjectLonLatFromLonLat: function(lon, lat) { + var yLatLong; + if(this.sphericalMercator) { + var lonlat = this.inverseMercator(lon, lat); + yLatLong = new YGeoPoint(lonlat.lat, lonlat.lon); + } else { + yLatLong = new YGeoPoint(lat, lon); + } + return yLatLong; + }, + + // Pixel + + /** + * APIMethod: getXFromMapObjectPixel + * + * Parameters: + * moPixel - {Object} MapObject Pixel format + * + * Returns: + * {Integer} X value of the MapObject Pixel + */ + getXFromMapObjectPixel: function(moPixel) { + return moPixel.x; + }, + + /** + * APIMethod: getYFromMapObjectPixel + * + * Parameters: + * moPixel - {Object} MapObject Pixel format + * + * Returns: + * {Integer} Y value of the MapObject Pixel + */ + getYFromMapObjectPixel: function(moPixel) { + return moPixel.y; + }, + + /** + * APIMethod: getMapObjectPixelFromXY + * + * Parameters: + * x - {Integer} + * y - {Integer} + * + * Returns: + * {Object} MapObject Pixel from x and y parameters + */ + getMapObjectPixelFromXY: function(x, y) { + return new YCoordPoint(x, y); + }, + + // Size + + /** + * APIMethod: getMapObjectSizeFromOLSize + * + * Parameters: + * olSize - {} + * + * Returns: + * {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/Yahoo.html b/tests/deprecated/Layer/Yahoo.html similarity index 97% rename from tests/Layer/Yahoo.html rename to tests/deprecated/Layer/Yahoo.html index b3b8372f9c..f7c67c0ce5 100755 --- a/tests/Layer/Yahoo.html +++ b/tests/deprecated/Layer/Yahoo.html @@ -1,7 +1,8 @@ - + + + + - - - -

Advanced OSM Layer

-
- openstreetmap advanced -
-
- - - - -