[mapserver-commits] r7552 - in trunk/docs: howto references/cgi

svn at osgeo.org svn at osgeo.org
Thu May 1 19:51:10 EDT 2008


Author: pramsey
Date: 2008-05-01 19:51:09 -0400 (Thu, 01 May 2008)
New Revision: 7552

Modified:
   trunk/docs/howto/tile_mode.txt
   trunk/docs/references/cgi/controls.txt
Log:
Update to reflect new "tilemode" behavior (gmap and ve modes)


Modified: trunk/docs/howto/tile_mode.txt
===================================================================
--- trunk/docs/howto/tile_mode.txt	2008-04-30 21:18:13 UTC (rev 7551)
+++ trunk/docs/howto/tile_mode.txt	2008-05-01 23:51:09 UTC (rev 7552)
@@ -68,9 +68,14 @@
 
  * *mode=tile* tells the server to generate tiles based on the other tile mode
    parameters
- * *tilemode=spheremerc* tells the server use the "spherical mercator" tile 
+ * *tilemode=gmap* tells the server use the Google Maps tile 
    scheme for the tiles
- * *tile=x+y+z* tells the server what tile you want to retrieve
+   * tile=x+y+z tells the server what tile you want to retrieve, using
+     the Google Maps tile addressing system
+ * *tilemode=ve* tells the server use the Virtual Earth tile naming 
+   scheme for the tiles
+   * tile=10231 tells the server what tile you want to retrieve, using
+     the Virtual Earth tile addressing system
  
  
 About Spherical Mercator
@@ -82,19 +87,26 @@
 
 A spherical mercator set of tiles has the following properties:
 
- * The data has been reprojected to mercator using a spherical 
+ * The map has been reprojected to mercator using a spherical 
    mercator algorithm
- * There is one tile in top zoom level, zoom level zero
- * Each succeeded zoom level (z) has 2^z tiles along each axis
- * The top left tile in each zoom level is at tile coordinate 0,0
- * The x tile coordinate increases left to right
- * The y tile coordinate increases top to bottom
+ * There is one tile in the top zoom level, zoom level zero
+ * Each successive zoom level (z) has 2^z tiles along each axis
  * Tiles are 256x256 in size
  
-The spherical mercator tiling scheme is currently the only one supported by the
-Mapserver tile mode.
+Google Maps and Virtual Earth both use spherical mercator as their underlying tile
+projection, but use different formats to address the individual tiles.
 
+Google Maps uses an "x", "y", "zoom" format.  The zoom indicates which level to pull 
+tiles from, and the "x" and "y" indicate while tile in that zoom level to pull.
 
+Virtual Earth uses a single string to address each tile.  The top zoom level in Virtual Earth has
+four tiles (equivalent to Google's zoom level 1). The top left tile in the Virtual Earth top zoom
+level is addessed as "0", top right as "1", bottom left as "2" and bottom right as "3".  Each tile 
+the next level is addressed by first referencing the top level tile that contains it, then its address 
+relative to that tile.  So the top left tile in the second zoom level is "00" and the bottom right one is "33".  
+See the Virtual Earth site for more details: http://msdn.microsoft.com/en-us/library/bb545006.aspx
+
+
 Using Google Maps
 -----------------
 
@@ -106,7 +118,7 @@
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
   <html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
+    <head>
     <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
     <title>Google/Mapserver Tile Example</title>
     <script src="http://maps.google.com/maps?file=api&v=2&key=[YOUR KEY HERE]"
@@ -119,7 +131,7 @@
             urlTemplate += 'map=/var/map.map&';
             urlTemplate += 'layers=layer1,layer2&';
             urlTemplate += 'mode=tile&';
-            urlTemplate += 'tilemode=spheremerc&';
+            urlTemplate += 'tilemode=gmap&';
             urlTemplate == 'tile={X}+{Y}+{Z}';
         var myLayer = new GTileLayer(null,0,18,{                                      
                                      tileUrlTemplate:urlTemplate,
@@ -163,7 +175,7 @@
             urlTemplate += 'map=/var/map.map&';
             urlTemplate += 'layers=layer1,layer2&';
             urlTemplate += 'mode=tile&';
-            urlTemplate += 'tilemode=spheremerc&';
+            urlTemplate += 'tilemode=gmap&';
             urlTemplate == 'tile={X}+{Y}+{Z}';
         var myLayer = new GTileLayer(null,0,18,{                                      
                                      tileUrlTemplate:urlTemplate,
@@ -186,9 +198,51 @@
   </html>
 
 The only change from the previous example is that we don't create a GTileLayerOverlay, 
-we create a GMapType, and add a map type, instead of an overlay.
+we create a GMapType, and use addMapType(), instead of addOverlay().
 
+
+Using Virtual Earth
+-------------------
+
+The `Virtual Earth API`_ also includes support for using alternative tile sets 
+as overlays, or as alternate base maps. Here is an example::
+
+  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+      <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+      <title>Virtual Earth Example</title>
+      <script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1"></script>
+      <script type="text/javascript">
+
+        var map = null;
+
+        function OnLoadMap () {
+          map = new VEMap("myMap");
+          map.LoadMap();
+
+          var url = "http://localhost/cgi-bin/mapserv?";
+          url += "map=/var/map.map&";
+          url += "mode=tile&";
+          url += "layers=layer1,layer2&";
+          url += "tilemode=ve&";
+          url += "tile=%4";
+
+          var tileSourceSpec = new VETileSourceSpecification( "myLayer", url );
+          tileSourceSpec.Opacity = 0.3;
+          map.AddTileLayer(tileSourceSpec, true);
+        }
+
+      </script>
+    </head>
+    <body onload="OnLoadMap();">
+      <div id="myMap" style="position:relative; width:500px; height:500px;"></div>
+    </body>
+  </html>
+
+
+
 .. RST Link Section
 
 .. _`GTileLayerOverlay`: http://code.google.com/apis/maps/documentation/reference.html#GTileLayer
-.. _`Google Maps API`: http://code.google.com/apis/maps/
\ No newline at end of file
+.. _`Google Maps API`: http://code.google.com/apis/maps/

Modified: trunk/docs/references/cgi/controls.txt
===================================================================
--- trunk/docs/references/cgi/controls.txt	2008-04-30 21:18:13 UTC (rev 7551)
+++ trunk/docs/references/cgi/controls.txt	2008-05-01 23:51:09 UTC (rev 7552)
@@ -221,16 +221,16 @@
     Used for index queries (in conjunction with INDEXQUERY), used with tiled 
     shapefile layers. 
     
-TILEMODE [spheremerc]
-    Used when MODE=TILE to specify the tile basis. Currently only supports
-    "spheremerc", the projection (spherical mercator, also known as "web
-    mercator") and tile layout (one tile at zoom level 0, descending by 
-    powers of two from there) used by Google Maps, 
-    Virtual Earth, Yahoo Maps and OpenStreetMap.  
+TILEMODE [gmap|ve]
+    Used when MODE=TILE to specify the tile naming scheme. Currently supports
+    "gmaps" for the Google Maps tile addressing scheme (x y zoom) and 
+    "ve" for the Virtual Earth tile addressing scheme (312310).
 
-TILE [X] [Y] [ZOOM]
-    Used when MODE=TILE to specify the tile desired, in tile coordinates.
-    Tile "0 0 1" is the top left tile at zoom level one.
+TILE [address]
+    Used when MODE=TILE to specify the tile desired, using the tile name scheme
+    indicated in the TILEMODE.  For Google Maps, supply the tile x, y and zoom level
+    in a space separated list, "x y z", for example, "1 1 3".  For Virtual Earth, supply a tile file name
+    in the Virtual Earth naming scheme, for example, "013142".
 
 ZOOM [number]
     Zoom scaling to apply to the creation of the new map. Values greater than 



More information about the mapserver-commits mailing list