[OpenLayers-Commits] r4181 - in trunk/openlayers: lib/OpenLayers lib/OpenLayers/Layer tests/Layer tests/Tile

commits at openlayers.org commits at openlayers.org
Mon Sep 3 11:49:40 EDT 2007


Author: crschmidt
Date: 2007-09-03 11:49:39 -0400 (Mon, 03 Sep 2007)
New Revision: 4181

Modified:
   trunk/openlayers/lib/OpenLayers/Layer/HTTPRequest.js
   trunk/openlayers/lib/OpenLayers/Layer/TMS.js
   trunk/openlayers/lib/OpenLayers/Layer/TileCache.js
   trunk/openlayers/lib/OpenLayers/Layer/WMS.js
   trunk/openlayers/lib/OpenLayers/Tile.js
   trunk/openlayers/tests/Layer/test_WMS.html
   trunk/openlayers/tests/Tile/test_Image.html
Log:
the Reproject option on tiles has never worked quite perfectly (because of
#429). With the new GoogleMercator? layer going into 2.5, we shouldn't be
needing this anyway, so turn it *off* by default, so that we don't have to 
deal with the pain anymore. (Closes #881) Thx to euz for review. 


Modified: trunk/openlayers/lib/OpenLayers/Layer/HTTPRequest.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Layer/HTTPRequest.js	2007-09-03 12:59:30 UTC (rev 4180)
+++ trunk/openlayers/lib/OpenLayers/Layer/HTTPRequest.js	2007-09-03 15:49:39 UTC (rev 4181)
@@ -35,10 +35,13 @@
     
     /** 
      * 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,
 

Modified: trunk/openlayers/lib/OpenLayers/Layer/TMS.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Layer/TMS.js	2007-09-03 12:59:30 UTC (rev 4180)
+++ trunk/openlayers/lib/OpenLayers/Layer/TMS.js	2007-09-03 15:49:39 UTC (rev 4181)
@@ -14,12 +14,6 @@
 OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
 
     /**
-     * APIProperty: reproject
-     * {Boolean}
-     */
-    reproject: false,
-
-    /**
      * APIProperty: isBaseLayer
      * {Boolean}
      */

Modified: trunk/openlayers/lib/OpenLayers/Layer/TileCache.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Layer/TileCache.js	2007-09-03 12:59:30 UTC (rev 4180)
+++ trunk/openlayers/lib/OpenLayers/Layer/TileCache.js	2007-09-03 15:49:39 UTC (rev 4181)
@@ -17,13 +17,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.
      */

Modified: trunk/openlayers/lib/OpenLayers/Layer/WMS.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Layer/WMS.js	2007-09-03 12:59:30 UTC (rev 4180)
+++ trunk/openlayers/lib/OpenLayers/Layer/WMS.js	2007-09-03 15:49:39 UTC (rev 4181)
@@ -31,12 +31,14 @@
     
     /**
      * 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

Modified: trunk/openlayers/lib/OpenLayers/Tile.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Tile.js	2007-09-03 12:59:30 UTC (rev 4180)
+++ trunk/openlayers/lib/OpenLayers/Tile.js	2007-09-03 15:49:39 UTC (rev 4181)
@@ -205,6 +205,12 @@
      * bounds - {<OpenLayers.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;

Modified: trunk/openlayers/tests/Layer/test_WMS.html
===================================================================
--- trunk/openlayers/tests/Layer/test_WMS.html	2007-09-03 12:59:30 UTC (rev 4180)
+++ trunk/openlayers/tests/Layer/test_WMS.html	2007-09-03 15:49:39 UTC (rev 4181)
@@ -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);

Modified: trunk/openlayers/tests/Tile/test_Image.html
===================================================================
--- trunk/openlayers/tests/Tile/test_Image.html	2007-09-03 12:59:30 UTC (rev 4180)
+++ trunk/openlayers/tests/Tile/test_Image.html	2007-09-03 15:49:39 UTC (rev 4181)
@@ -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();



More information about the Commits mailing list