Merge branch 'upstream-master' into deprecated.js

This commit is contained in:
fredj
2011-11-18 13:51:19 +01:00
11 changed files with 107 additions and 158 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

@@ -7,8 +7,6 @@
/**
* @requires OpenLayers/BaseTypes/Class.js
* @requires OpenLayers/Util.js
* @requires OpenLayers/Console.js
* @requires OpenLayers/Lang.js
*/
/*
@@ -236,43 +234,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"
});

View File

@@ -136,7 +136,9 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
draw: function() {
var drawn = OpenLayers.Tile.prototype.draw.apply(this, arguments);
if (drawn) {
// The layer's reproject option is deprecated.
if (this.layer != this.layer.map.baseLayer && this.layer.reproject) {
// getBoundsFromBaseLayer is defined in deprecated.js.
this.bounds = this.getBoundsFromBaseLayer(this.position);
}
if (this.isLoading) {