diff --git a/lib/OpenLayers/Layer/HTTPRequest.js b/lib/OpenLayers/Layer/HTTPRequest.js index 50bd287175..70a9c84efb 100644 --- a/lib/OpenLayers/Layer/HTTPRequest.js +++ b/lib/OpenLayers/Layer/HTTPRequest.js @@ -35,10 +35,13 @@ OpenLayers.Layer.HTTPRequest = OpenLayers.Class(OpenLayers.Layer, { /** * APIProperty: reproject + * *Deprecated*. See http://trac.openlayers.org/wiki/SpatialMercator + * for information on the replacement for this functionality. * {Boolean} Whether layer should reproject itself based on base layer * locations. This allows reprojection onto commercial layers. * Default is false: Most layers can't reproject, but layers - * which can create non-square geographic pixels can, like WMS. + * which can create non-square geographic pixels can, like WMS. + * */ reproject: false, diff --git a/lib/OpenLayers/Layer/TMS.js b/lib/OpenLayers/Layer/TMS.js index 6a73f89e2e..4d87528c20 100644 --- a/lib/OpenLayers/Layer/TMS.js +++ b/lib/OpenLayers/Layer/TMS.js @@ -13,12 +13,6 @@ */ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { - /** - * APIProperty: reproject - * {Boolean} - */ - reproject: false, - /** * APIProperty: isBaseLayer * {Boolean} diff --git a/lib/OpenLayers/Layer/TileCache.js b/lib/OpenLayers/Layer/TileCache.js index 8e29c8699d..f5ca846b1d 100644 --- a/lib/OpenLayers/Layer/TileCache.js +++ b/lib/OpenLayers/Layer/TileCache.js @@ -16,13 +16,6 @@ */ OpenLayers.Layer.TileCache = OpenLayers.Class(OpenLayers.Layer.Grid, { - /** - * APIProperty: reproject - * {Boolean} Try to reproject this layer if it is used as an overlay. - * Default is false. - */ - reproject: false, - /** * APIProperty: isBaseLayer * {Boolean} Treat this layer as a base layer. Default is true. diff --git a/lib/OpenLayers/Layer/WMS.js b/lib/OpenLayers/Layer/WMS.js index aaea0dca0e..518ab68284 100644 --- a/lib/OpenLayers/Layer/WMS.js +++ b/lib/OpenLayers/Layer/WMS.js @@ -31,12 +31,14 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, { /** * Property: reproject + * *Deprecated*. See http://trac.openlayers.org/wiki/SpatialMercator + * 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 true. * Set this in the layer options. Should be set to false in * most cases. */ - reproject: true, + reproject: false, /** * APIProperty: isBaseLayer diff --git a/lib/OpenLayers/Tile.js b/lib/OpenLayers/Tile.js index 280953baab..fef62dcefb 100644 --- a/lib/OpenLayers/Tile.js +++ b/lib/OpenLayers/Tile.js @@ -205,6 +205,12 @@ OpenLayers.Tile = OpenLayers.Class({ * bounds - {} */ getBoundsFromBaseLayer: function(position) { + OpenLayers.Console.warn("You are using the 'reproject' option " + + "on the " + this.layer.name + " layer. This option is deprecated: " + + "its use was designed to support displaying data over commercial " + + "basemaps, but that functionality should now be achieved by using " + + "Spherical Mercator support. More information is available from " + + "http://trac.openlayers.org/wiki/SphericalMercator."); var topLeft = this.layer.map.getLonLatFromLayerPx(position); var bottomRightPx = position.clone(); bottomRightPx.x += this.size.w; diff --git a/tests/Layer/test_WMS.html b/tests/Layer/test_WMS.html index 31f561758f..d52a4f483b 100644 --- a/tests/Layer/test_WMS.html +++ b/tests/Layer/test_WMS.html @@ -282,7 +282,7 @@ var layer = new OpenLayers.Layer.Google("Google"); map.addLayer(layer); var wmslayer = new OpenLayers.Layer.WMS(name, url, params, - {isBaseLayer: false}); + {isBaseLayer: false, reproject:true}); wmslayer.isBaseLayer=false; map.addLayer(wmslayer); map.setCenter(new OpenLayers.LonLat(0,0), 5); diff --git a/tests/Tile/test_Image.html b/tests/Tile/test_Image.html index de264e7d2d..17bed356b0 100644 --- a/tests/Tile/test_Image.html +++ b/tests/Tile/test_Image.html @@ -168,7 +168,7 @@ var size = new OpenLayers.Size(5,6); var map = new OpenLayers.Map('map'); var layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", - "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'}); + "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'}, {'reproject': true}); map.addLayer(layer); map.zoomToMaxExtent(); tile = new OpenLayers.Tile.Image(layer, position, new OpenLayers.Bounds(-90,-85,-90,85), url, size); @@ -176,7 +176,7 @@ tile.moveTo(new OpenLayers.Bounds(-185,-90,-180,-80), new OpenLayers.Pixel(-180,-85), true); t.delay_call( 1, function() { t.eq(tile.imgDiv, null, "Tile imgDiv is null.") } ); var layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", - "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'}, {'alpha':true}); + "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'}, {'reproject': true, 'alpha':true}); map.addLayer(layer); tile = new OpenLayers.Tile.Image(layer, position, new OpenLayers.Bounds(-90,-85,-90,85), url, size); tile.draw();