[mapserver-commits] r11543 - trunk/docs/en/mapfile

svn at osgeo.org svn at osgeo.org
Tue Apr 12 08:12:42 EDT 2011


Author: jmckenna
Date: 2011-04-12 05:12:42 -0700 (Tue, 12 Apr 2011)
New Revision: 11543

Modified:
   trunk/docs/en/mapfile/union.txt
Log:
add mapscript example

Modified: trunk/docs/en/mapfile/union.txt
===================================================================
--- trunk/docs/en/mapfile/union.txt	2011-04-12 12:06:42 UTC (rev 11542)
+++ trunk/docs/en/mapfile/union.txt	2011-04-12 12:12:42 UTC (rev 11543)
@@ -10,6 +10,10 @@
 :Contact: jmckenna at gatewaygeomatics.com
 :Last Updated: 2011-04-11
 
+.. contents:: Table of Contents
+    :depth: 3
+    :backlinks: top
+
 Description
 -----------
 
@@ -34,8 +38,7 @@
     You may wish to disable the visibility (change their STATUS) of the source layers 
     to avoid displaying the features twice.
     
-Mapfile Example
----------------
+For example:
 
 .. code-block:: mapfile
 
@@ -102,9 +105,12 @@
 MapServer will reproject the source layers to the union layer if requested.  (for more information on projections
 in MapServer refer to :ref:`PROJECTION`)
 
-Working Mapfile Example
------------------------
+Examples
+--------
 
+Mapfile Example
+***************
+
 The follow example contains 3 source layers in different formats, and one layer (yellow)
 in a different projection.  The union layer uses the **STYLEITEM "AUTO"** parameter to 
 draw the styles from the source layers.  (in this case MapServer will reproject the yellow
@@ -183,4 +189,29 @@
     END    
   END
   
-  END # Map
\ No newline at end of file
+  END # Map
+  
+PHP MapScript Example
+*********************
+
+.. code-block:: php
+
+  <?php
+
+  // open map
+  $oMap = ms_newMapObj( "D:/ms4w/apps/osm/map/osm.map" );
+
+  // create union layer
+  $oLayer = ms_newLayerObj($oMap);
+  $oLayer->set("name", "unioned");
+  $oLayer->set("type", MS_LAYER_POLYGON); 
+  $oLayer->set("status", MS_ON);
+  $oLayer->setConnectionType(MS_UNION);
+  $oLayer->set("connection", "red,green,yellow");
+  $oLayer->set("styleitem", "AUTO");
+  $oLayer->setProjection("init=epsg:3978");
+  // create empty class
+  $oClass = ms_newClassObj($oLayer);
+  ...
+
+  ?>
\ No newline at end of file



More information about the mapserver-commits mailing list