[mapserver-commits] r8717 - trunk/docs/tutorial

svn at osgeo.org svn at osgeo.org
Mon Mar 9 14:45:35 EDT 2009


Author: jmckenna
Date: 2009-03-09 14:45:35 -0400 (Mon, 09 Mar 2009)
New Revision: 8717

Added:
   trunk/docs/tutorial/example1-2-map.txt
Modified:
   trunk/docs/tutorial/example1-2.txt
Log:
add styling

Added: trunk/docs/tutorial/example1-2-map.txt
===================================================================
--- trunk/docs/tutorial/example1-2-map.txt	                        (rev 0)
+++ trunk/docs/tutorial/example1-2-map.txt	2009-03-09 18:45:35 UTC (rev 8717)
@@ -0,0 +1,72 @@
+.. _example1-2-map:
+
+Example1-2.map
+--------------
+
+.. code-block:: mapfile
+
+	# The annotated map file (sort of)
+	# Created by Pericles S. Nacionales for the MapServer tutorial
+	# 20050408
+	#
+	# MapServer map file uses the pound sign (#) to denote the start of a line
+	# comment--each line that needs to be commented has to be prepended with a "#".
+	#
+	# Map files begin with MAP keyword to signify the start of the map object.
+	# Well, the entire map file is THE map object.  Enclosed between MAP and END
+	# at the very bottom of this map file, are keyword/value pairs and other
+	# objects.
+	MAP
+	  IMAGETYPE      PNG
+	  EXTENT         -97.238976 41.619778 -82.122902 49.385620
+	  SIZE           400 300
+	  SHAPEPATH      "/ms4w/apps/tutorial/data"
+	  IMAGECOLOR     255 255 255
+	
+	  # Layer objects are defined beneath the map object.  You need at least one
+	  # layer defined in your map file before you can display a map...  You can
+	  # define as many layers as you'd like although a limit is typically hard-coded
+	  # in map.h in the MapServer source.  The default limit is set at 100.  You'd
+	  # have to have a very specialized application to need more than 100 layers in
+	  # your application.
+	
+	  # Start of LAYER DEFINITIONS ---------------------------------------------
+	  LAYER # States polygon layer begins here
+	    NAME         states_poly
+	    DATA         states_ugl
+	    STATUS       OFF
+	    TYPE         POLYGON
+	
+	    # The class object is defined within the layer object.  You can define as
+	    # many classes as you need (well, there are limits as with layers, but it's
+	    # senseless to define more than ten on a "normal" layer.  There are
+	    # situations, however, where you might have to do it.)
+	    CLASS
+	      NAME       "States"
+	
+	      # There are styles in a class, just like there are classes in a layer,
+	      # just like there are layers in a map.  You can define multiple styles in
+	      # a class just as you can define multiple classes in a layer and multiple
+	      # layers in a map.
+	      STYLE
+	        COLOR    232 232 232
+	      END
+	    END
+	  END # States polygon layer ends here
+	
+	  LAYER # States line layer begins here
+	    NAME         states_line
+	    DATA         states_ugl
+	    STATUS       OFF
+	    TYPE         LINE
+	
+	    CLASS
+	      NAME       "State Boundary"
+	      STYLE
+	        COLOR    32 32 32
+	      END
+	    END
+	  END # States line layer ends here
+	  # End of LAYER DEFINITIONS -------------------------------
+	
+	END # All map files must come to an end just as all other things must come to...
\ No newline at end of file

Modified: trunk/docs/tutorial/example1-2.txt
===================================================================
--- trunk/docs/tutorial/example1-2.txt	2009-03-09 18:31:45 UTC (rev 8716)
+++ trunk/docs/tutorial/example1-2.txt	2009-03-09 18:45:35 UTC (rev 8717)
@@ -10,14 +10,18 @@
 
 As in the first example, this image was generated by linking the source of the
 <img> tag to this URL: 
-`<http://terrasip.gis.umn.edu/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/example1-2.map&mode=map>`_. This is how most of the examples in this section work.
+`<http://terrasip.gis.umn.edu/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/example1-2.map&mode=map>`_. 
+This is how most of the examples in this section work.
 
 Anyway, you'll notice that the map here is the same as the first example. Yes, 
 but the mapfile is different. Have a look.
 
 This is what the mapfile looks like: 
-`Example1-2.map <http://biometry.gis.umn.edu/tutorial/example1-2.map>`_.
+:ref:`Example1-2.map <example1-2-map>`
 
+MapFile Structure
+#################
+
 The mapfile structure, by objects, looks like this:
 
 ::
@@ -28,11 +32,46 @@
           STYLE-|       |-STYLE</pre>
 
 Here we split the original layer into two layers. The first layer is still a 
-polygon layer but the STYLE no longer has OUTLINECOLOR. The second layer is 
-similar to the first except that the TYPE is changed to LINE and the COLOR in 
-the STYLE is changed to the same color as the OUTLINECOLOR in the first example. 
-This produces the same image as the first one... So, why do it this way? If we 
-continue to add layers on top of the states layer, the outline will most likely 
+polygon layer but the :ref:`STYLE object <style>` no longer has OUTLINECOLOR, 
+such as:
+
+.. code-block:: mapfile
+
+	  LAYER
+	    ...
+	    TYPE         POLYGON
+	    ...
+	    CLASS
+	      NAME       "States"
+	      STYLE
+	        COLOR    232 232 232
+	      END
+	    END
+	  END
+
+The second layer is similar to the first except that the TYPE is changed to 
+LINE and the COLOR in the STYLE is changed to the same color as the OUTLINECOLOR 
+in the first example. This produces the same image as the first one.
+
+.. code-block:: mapfile
+
+  	LAYER
+  	  ...
+  	  TYPE         LINE
+  	  CLASS
+  	    NAME       "State Boundary"
+  	    STYLE
+  	      COLOR    32 32 32
+  	    END
+  	  END
+  	END
+
+
+
+So, why do it this way?
+#######################
+
+If we continue to add layers on top of the states layer, the outline will most likely 
 be covered up by these other layers.  To still see the state boundaries after 
 we add these other layers, we have to separate the states boundary line layer 
 from the states polygon layer and put it on top of the other other layers.  



More information about the mapserver-commits mailing list