[OpenLayers-Commits] r12114 - trunk/openlayers/examples

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Tue Jun 21 05:58:05 EDT 2011


Author: ahocevar
Date: 2011-06-21 02:58:04 -0700 (Tue, 21 Jun 2011)
New Revision: 12114

Modified:
   trunk/openlayers/examples/wms-long-url.js
Log:
adding a singleTile overlay (see #3376)

Modified: trunk/openlayers/examples/wms-long-url.js
===================================================================
--- trunk/openlayers/examples/wms-long-url.js	2011-06-20 15:30:45 UTC (rev 12113)
+++ trunk/openlayers/examples/wms-long-url.js	2011-06-21 09:58:04 UTC (rev 12114)
@@ -2,18 +2,25 @@
 var longText = new Array(205).join("1234567890");
 
 var map = new OpenLayers.Map( 'map' );
-var layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
+var base = new OpenLayers.Layer.WMS( "OpenLayers WMS",
         "http://vmap0.tiles.osgeo.org/wms/vmap0",
         {layers: 'basic', makeTheUrlLong: longText},
         {tileOptions: {maxGetUrlLength: 2048}}
 );
-map.addLayer(layer);
+var overlay = new OpenLayers.Layer.WMS("Overlay",
+    "http://suite.opengeo.org/geoserver/wms",
+    {layers: "usa:states", transparent: true},
+    {ratio: 1, singleTile: true, tileOptions: {maxGetUrlLength: 2048}}
+);
+map.addLayers([base, overlay]);
 map.zoomToMaxExtent();
 
 // add behavior to dom elements
 document.getElementById("longurl").onclick = function() {
-    layer.mergeNewParams({makeTheUrlLong: longText})
-}
+    base.mergeNewParams({makeTheUrlLong: longText});
+    overlay.mergeNewParams({makeTheUrlLong: longText});
+};
 document.getElementById("shorturl").onclick = function() {
-    layer.mergeNewParams({makeTheUrlLong: null})
-}
+    base.mergeNewParams({makeTheUrlLong: null});
+    overlay.mergeNewParams({makeTheUrlLong: null});
+};



More information about the Commits mailing list