[OpenLayers-Commits] r10898 - in trunk/openlayers: lib/OpenLayers/Control tests/Control

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Tue Nov 16 10:15:07 EST 2010


Author: bartvde
Date: 2010-11-16 07:15:06 -0800 (Tue, 16 Nov 2010)
New Revision: 10898

Modified:
   trunk/openlayers/lib/OpenLayers/Control/SLDSelect.js
   trunk/openlayers/tests/Control/SLDSelect.html
Log:
remove deprecated Layer.WMS.Post from SLDSelect control, r=ahocevar (closes #2930)

Modified: trunk/openlayers/lib/OpenLayers/Control/SLDSelect.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Control/SLDSelect.js	2010-11-15 09:48:10 UTC (rev 10897)
+++ trunk/openlayers/lib/OpenLayers/Control/SLDSelect.js	2010-11-16 15:15:06 UTC (rev 10898)
@@ -5,7 +5,7 @@
 
 /**
  * @requires OpenLayers/Control.js
- * @requires OpenLayers/Layer/WMS/Post.js
+ * @requires OpenLayers/Layer/WMS.js
  * @requires OpenLayers/Handler/RegularPolygon.js
  * @requires OpenLayers/Handler/Polygon.js
  * @requires OpenLayers/Handler/Path.js
@@ -119,7 +119,7 @@
      * APIProperty: layerCache
      * {Object} Cache to use for storing references to the selection layers.
      *     Normally each source layer will have exactly 1 selection layer of
-     *     type OpenLayers.Layer.WMS.Post. If not provided, layers will
+     *     type OpenLayers.Layer.WMS. If not provided, layers will
      *     be cached on the prototype. Note that if <clearOnDeactivate> is
      *     true, the layer will no longer be cached after deactivating the
      *     control.
@@ -158,7 +158,8 @@
             click: this.select}, this.callbacks);
         this.handlerOptions = this.handlerOptions || {};
         this.layerOptions = OpenLayers.Util.applyDefaults(this.layerOptions, {
-            displayInLayerSwitcher: false
+            displayInLayerSwitcher: false,
+            tileOptions: {maxGetUrlLength: 2048}
         });
         if (this.sketchStyle) {
             this.handlerOptions.layerOptions = OpenLayers.Util.applyDefaults(
@@ -207,14 +208,14 @@
      *     is performed.
      *
      * Returns:
-     * {<OpenLayers.Layer.WMS.Post>} A WMS Post layer since SLD selections can
-     *     easily get quite long.
+     * {<OpenLayers.Layer.WMS>} A WMS layer with maxGetUrlLength configured to 2048
+     *     since SLD selections can easily get quite long.
      */
     createSelectionLayer: function(source) {
         // check if we already have a selection layer for the source layer
         var selectionLayer;
         if (!this.layerCache[source.id]) {
-            selectionLayer = new OpenLayers.Layer.WMS.Post(source.name, 
+            selectionLayer = new OpenLayers.Layer.WMS(source.name, 
                 source.url, source.params, 
                 OpenLayers.Util.applyDefaults(
                     this.layerOptions,
@@ -567,4 +568,4 @@
     },
 
     CLASS_NAME: "OpenLayers.Control.SLDSelect"
-});
\ No newline at end of file
+});

Modified: trunk/openlayers/tests/Control/SLDSelect.html
===================================================================
--- trunk/openlayers/tests/Control/SLDSelect.html	2010-11-15 09:48:10 UTC (rev 10897)
+++ trunk/openlayers/tests/Control/SLDSelect.html	2010-11-16 15:15:06 UTC (rev 10898)
@@ -31,7 +31,7 @@
     }
 
     function test_select(t) {
-        t.plan(8);
+        t.plan(9);
         var parser = new OpenLayers.Format.WFSDescribeFeatureType();
         var map = new OpenLayers.Map('map');
         var layer = new OpenLayers.Layer.WMS('Foo', 'http://foo', {LAYERS: 'AAA64'});
@@ -80,7 +80,8 @@
         control.select(geometry);
         control.events.unregister("selected", this, testEvent);
         t.eq(map.layers.length, 2, "Selection layer has been created and added to the map");
-        t.eq(map.layers[1] instanceof OpenLayers.Layer.WMS.Post, true, "A WMS Post layer has been created as the selection layer");
+        t.eq(map.layers[1] instanceof OpenLayers.Layer.WMS, true, "A WMS layer has been created as the selection layer");
+        t.eq(map.layers[1].tileOptions.maxGetUrlLength, 2048, "Selection layer will automatically switch to HTTP Post if content gets longer than 2048");
         var expected_sld = '<sld:StyledLayerDescriptor xmlns:sld="http://www.opengis.net/sld" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"><sld:NamedLayer><sld:Name>AAA64</sld:Name><sld:UserStyle><sld:Name>default</sld:Name><sld:FeatureTypeStyle><sld:Rule><ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:BBOX><ogc:PropertyName>geometry</ogc:PropertyName><gml:Box xmlns:gml="http://www.opengis.net/gml"><gml:coordinates decimal="." cs="," ts=" ">-3.5355339059327,-3.5355339059327 3.5355339059327,3.5355339059327</gml:coordinates></gml:Box></ogc:BBOX></ogc:Filter><sld:LineSymbolizer><sld:Stroke><sld:CssParameter name="stroke">#FF0000</sld:CssParameter><sld:CssParameter name="stroke-width">2</sld:CssParameter></sld:Stroke></sld:LineSymbolizer></sld:Rule></sld:Featur
 eTypeStyle></sld:UserStyle></sld:NamedLayer></sld:StyledLayerDescriptor>';
 
         t.xml_eq(map.layers[1].params.SLD_BODY, expected_sld, "SLD generated correctly");



More information about the Commits mailing list