CGI Query Mode Variables

ANDY CANFIELD andy_canfield at HOTMAIL.COM
Sat Nov 13 18:17:54 EST 2004


You need to make a template for each layer. When you query the it will use
the template you specify for that layer.

Say you do a query like:
mode=QUERY&layer=AnyGivenLayer

Mapserver is going to look at the map file definition of "AnyGivenLayer" and
use the template specified in the layer definition for the display of the
returned query information.

You can use the same template for multiple layers if they have similar
attributes. For instance I have about twent eqpuitment layers in one of my
maps but all of them have the same five attribute fields so in the map file
I specify the same template for each of those layers.

When I use Mapserver in CGI mode I generally have about 75% of the amount of
templates as I do layers so for a map of 100 layers I have 75 specific
templates.

Does this help?

>From: Manjiri Andhare <mandhare at STATE.PA.US>
>Reply-To: Manjiri Andhare <mandhare at STATE.PA.US>
>To: MAPSERVER-USERS at LISTS.UMN.EDU
>Subject: [UMN_MAPSERVER-USERS] CGI Query Mode Variables
>Date: Fri, 12 Nov 2004 09:42:33 -0600
>
>Hello List,
>I wanted to display the data which is in the shape files about the layers.
>After the research, I have been up to the point that i can get the data
>about one layer using the mode=QUERY.
>I went throught the CGI Reference Documentation. But for me the explanation
>about mode variables..query, nquery itemquery etc. wasn't enough.
>So what i want to ask is..
>If I want to display information about any layer(I'll make the user to
>select a radio button for the layer about which he wants to see the
>information), which mode shall i use? And what additional code do i need to
>write in map file and in the html templet?
>Now while usig query mode, I have wrote the code in map file for 3 layer
>with TYPE=QUERY. But I don't know how to write the code to diaply the
>information in the resuling html template(tabular form)for any selection of
>the layer. Right now, I have wrote the code in the html file to display
>information about only one layer, but depending upon user selection of the
>layer, this information should change. How to make this change? Or do i
>need to write seperate template for every layer and call that template
>depending upon user selection? If yes, can someone provide informaiton
>about how to do that?
>Thank you all,
>Manjiri Andhare
>GIS Coordinator,
>PA Fish & Boat Commission,
>U.S.A.



More information about the mapserver-users mailing list