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

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Wed Jan 5 12:37:58 EST 2011


Author: tschaub
Date: 2011-01-05 09:37:58 -0800 (Wed, 05 Jan 2011)
New Revision: 11005

Added:
   trunk/openlayers/examples/tile-extent.html
   trunk/openlayers/examples/tile-extent.js
Log:
Adding the tile extent examples as part of #3002.

Added: trunk/openlayers/examples/tile-extent.html
===================================================================
--- trunk/openlayers/examples/tile-extent.html	                        (rev 0)
+++ trunk/openlayers/examples/tile-extent.html	2011-01-05 17:37:58 UTC (rev 11005)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>OpenLayers Tile Extent Example</title>
+        <link rel="stylesheet" href="../theme/default/style.css" type="text/css">
+        <link rel="stylesheet" href="../theme/default/google.css" type="text/css">
+        <link rel="stylesheet" href="style.css" type="text/css">
+    </head>
+    <body>
+        <h1 id="title">Tile Extent</h1>
+        <div id="tags">
+            grid, tileExtent
+        </div>
+        <p id="shortdesc">
+            Demonstrates the use of the tileExtent property to differentiate 
+            between the maximum extent and the tile extent for a layer.
+        </p>
+        <div id="map" class="smallmap"></div>
+        <div id="docs">
+            <p>
+                This example uses a layer that requests map tiles from a WMS
+                that only generates image responses for requests that align with
+                a particular tile lattice.  In this case, the layer's 
+                <code>maxExtent</code> does not align with that tile lattice.  
+                To configure the layer with a tile extent that conforms to the 
+                tile extent configured on the server, use the layer's 
+                <code>tileExtent</code> property.
+            </p><p>
+                View the <a href="tile-extent.js" target="_blank">tile-extent.js</a>
+                source to see how this is done
+            </p>
+        </div>
+        <script src="../lib/OpenLayers.js"></script>
+        <script src="tile-extent.js"></script>
+    </body>
+</html>

Added: trunk/openlayers/examples/tile-extent.js
===================================================================
--- trunk/openlayers/examples/tile-extent.js	                        (rev 0)
+++ trunk/openlayers/examples/tile-extent.js	2011-01-05 17:37:58 UTC (rev 11005)
@@ -0,0 +1,16 @@
+var map = new OpenLayers.Map({
+    div: "map",
+    maxExtent: new OpenLayers.Bounds(-130, 30, -80, 55),
+    maxResolution: 360 / 256 / Math.pow(2, 4),
+    numZoomLevels: 12,
+    layers: [
+        new OpenLayers.Layer.WMS(
+            "Global Imagery",
+            "http://maps.opengeo.org/geowebcache/service/wms",
+            {layers: "bluemarble"},
+            {tileExtent: new OpenLayers.Bounds(-180, -90, 180, 90)}
+        )
+    ],
+    center: new OpenLayers.LonLat(-110, 45),
+    zoom: 0
+});



More information about the Commits mailing list