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

svn at osgeo.org svn at osgeo.org
Mon Mar 9 11:15:03 EDT 2009


Author: pnaciona
Date: 2009-03-09 11:15:02 -0400 (Mon, 09 Mar 2009)
New Revision: 8699

Modified:
   trunk/docs/tutorial/example1-2.txt
Log:
Update tutorial example 1.2

Modified: trunk/docs/tutorial/example1-2.txt
===================================================================
--- trunk/docs/tutorial/example1-2.txt	2009-03-09 14:35:08 UTC (rev 8698)
+++ trunk/docs/tutorial/example1-2.txt	2009-03-09 15:15:02 UTC (rev 8699)
@@ -1,50 +1,40 @@
 .. _example1-2:
 
-Section 2: CGI variables and the User Interface
-===============================================
+===========
+Example 1.2
+===========
+Static Map with Two Layers
+--------------------------
 
-So far we have only looked at the mapfile when creating maps. In creating web mapping 
-applications, it is usually our intention to make maps that can be changed by the user 
-(of the application) interactively. That is, a user should be able to change the content 
-of (or the information in) the map. To accomplish this interactivity, we use the 
-MapServer HTML templates.
+.. image::  http://biometry.gis.umn.edu/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/example1-2.map&layer=states_poly&layer=states_line&mode=map
 
-A MapServer HTML template is essentially an HTML file with a few MapServer specific tags.
-These tags are the MapServer CGI variables and are enclosed in square brackets "[]". 
-When the MapServer CGI program processes an application, it first parses the query string 
-and the mapfile, and produces the necessary output. Some of this output will need to be 
-written to the HTML template file which you would have to also specify in the mapfile 
-using the web template keyword (or in a separate HTML initialization file). The CGI 
-program will replace all the variables in the HTML template with the proper value 
-before sending it back to the web browser. If you are to directly view an HTML template 
-on a web browser, there won't be any maps rendered and you will instead get blank 
-images and other junk.
+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.
 
-MapServer provides several variables for web mapping: the "img" variable which you've 
-seen in Example 1.9 is but one example. There area few core CGI variables originally 
-designed as part of the mapping interface but practically all the mapfile parameters
-can be defined as variables. The definitive reference to the CGI variables can be 
-found at :ref:`here <cgi>`.
+Anyway, you'll notice that the map here is the same as the first example. Yes, 
+but the mapfile is different. Have a look.
 
-We can also define our own variables, which MapServer will pass along to our application. 
-For example, we can create a variable called "root" to represent the root directory of 
-this tutorial, the value for "root" will then be "/tutorial". When the MapServer CGI 
-program processes our HTML template, it will replace every instance of he "[root]" tag 
-with "/tutorial". You will see this in action for each of the following examples.
+This is what the mapfile looks like: 
+`Example1-2.map <http://biometry.gis.umn.edu/tutorial/example1-2.map>`_.
 
-So, let's build an interactive interface for our application...
+The mapfile structure, by objects, looks like this:
 
-- Users of a web mapping application should be able to pan and zoom on the map:
-  `Example 2.1 - Pan and Zoom Controls <http://biometry.gis.umn.edu/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/example2.map&layer=states&zoom=0&mode=browse&root=/tutorial&program=/cgi-bin/mapserv.exe&map_web=template+example2-1.html>`_  
+::
 
-- They also should be able to turn on and off layers on a map:
-  `Example 2.2 - Layer Control <http://biometry.gis.umn.edu/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/example2.map&layer=states&zoom=0&mode=browse&root=/tutorial&program=/cgi-bin/mapserv.exe&map_web=template+example2-2.html>`_  
+                   MAP
+              LAYER-|-LAYER
+            CLASS-|   |-CLASS
+          STYLE-|       |-STYLE</pre>
 
-- A map should always include a scalebar.
-  `Example 2.3 - Adding a Scalebar <http://biometry.gis.umn.edu/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/example2.map&layer=states&zoom=0&mode=browse&root=/tutorial&program=/cgi-bin/mapserv.exe&map_web=template+example2-3.html>`_  
-
-- If users are to navigate through the map, a reference map should be provided:
-  `Example 2.4 - Adding a Reference Map <http://biometry.gis.umn.edu/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/example2.map&layer=states&zoom=0&mode=browse&root=/tutorial&program=/cgi-bin/mapserv.exe&map_web=template+example2-4.html>`_  
-
-- The map should include a legend.
-  `Example 2.5- Adding a Legend <http://biometry.gis.umn.edu/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/example2.map&layer=states&zoom=0&mode=browse&root=/tutorial&program=/cgi-bin/mapserv.exe&map_web=template+example2-5.html>`_  
\ No newline at end of file
+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 
+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.  
+There is order in how we define/add layers and you'll see it clearly as we 
+proceed in this section.
\ No newline at end of file



More information about the mapserver-commits mailing list