Removing getBoundsFromBaseLayer method.

This method is only needed when the deprecated reproject option is set to true.
This commit is contained in:
ahocevar
2011-11-18 13:06:28 +01:00
parent f713360c67
commit 4f58ff0352
10 changed files with 105 additions and 156 deletions

View File

@@ -31,17 +31,6 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
format: "image/jpeg"
},
/**
* Property: reproject
* *Deprecated*. See http://trac.openlayers.org/wiki/SphericalMercator
* for information on the replacement for this functionality.
* {Boolean} Try to reproject this layer if its coordinate reference system
* is different than that of the base layer. Default is false.
* Set this in the layer options. Should be set to false in
* most cases.
*/
reproject: false,
/**
* APIProperty: isBaseLayer
* {Boolean} Default is true for WMS layer

View File

@@ -236,43 +236,5 @@ OpenLayers.Tile = OpenLayers.Class({
// to be implemented by subclasses
},
/**
* Method: getBoundsFromBaseLayer
* Take the pixel locations of the corner of the tile, and pass them to
* the base layer and ask for the location of those pixels, so that
* displaying tiles over Google works fine.
*
* Parameters:
* position - {<OpenLayers.Pixel>}
*
* Returns:
* bounds - {<OpenLayers.Bounds>}
*/
getBoundsFromBaseLayer: function(position) {
var msg = OpenLayers.i18n('reprojectDeprecated',
{'layerName':this.layer.name});
OpenLayers.Console.warn(msg);
var topLeft = this.layer.map.getLonLatFromLayerPx(position);
var bottomRightPx = position.clone();
bottomRightPx.x += this.size.w;
bottomRightPx.y += this.size.h;
var bottomRight = this.layer.map.getLonLatFromLayerPx(bottomRightPx);
// Handle the case where the base layer wraps around the date line.
// Google does this, and it breaks WMS servers to request bounds in
// that fashion.
if (topLeft.lon > bottomRight.lon) {
if (topLeft.lon < 0) {
topLeft.lon = -180 - (topLeft.lon+180);
} else {
bottomRight.lon = 180+bottomRight.lon+180;
}
}
var bounds = new OpenLayers.Bounds(topLeft.lon,
bottomRight.lat,
bottomRight.lon,
topLeft.lat);
return bounds;
},
CLASS_NAME: "OpenLayers.Tile"
});