Removing getBoundsFromBaseLayer method.
This method is only needed when the deprecated reproject option is set to true.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user