Query template file question

Jim T. Bowen (GAIA Consultants Inc.) bowenj at gaiaenv.com
Fri Oct 29 11:49:25 EDT 1999


Thanks Ken,

MapServer was reporting that my php3 file was not a valid template file
(can't remember the exact error). I will give your suggestion a try
later today (along with Brent's).

It appears you have been passing variables to files (viz., apps. and
scripts) other than plain ol' hmtl files.  Thanks for your examples.


Cheers,
Jim

kenboss at dilbert.dnr.state.mn.us wrote:
> 
> Jim--
> 
> If I'm understanding your question correctly, all you need to do is to put the URL in quotes after the
> "template" keyword in the query block in your map file.  So, instead of something like this:
> 
> LAYER
>   ...
>   ...
>   QUERY
>     TEMPLATE "http://www.dnr.state.mn.us/someapp/somefile.html"
>   END
> END
> 
> You have something like this:
> 
> LAYER
>   ...
>   ...
>   QUERY
>     TEMPLATE "http://www.dnr.state.mn.us/perl/lk_search.pl?var1=[SOMEFIELD]&var2=[ANOTHER_FIELD]"
>   END
> END
> 
> Where [SOMEFIELD] and [ANOTHER_FIELD] are attributes of the shape that the user clicked on (eg., the
> unique id you want to pass to your PHP3 script).
> 
> This can have all sorts of cool applications, for example, we use:
> 
> LAYER
>   NAME counties
>   TYPE polyline
>   STATUS default
>   DATA counties
>   CLASS
>     NAME "County Boundaries"
>     SYMBOL 1
>     SIZE 1
>     COLOR 0 0 0
>   END
>   QUERY
>     TEMPLATE "http://www.ra.dnr.state.mn.us/cgi-bin/mapserv3.2?map=photos/etc/photos.map&mapext=[shpext]"
>   END
> END # Layer counties
> 
> to allow users to zoom in to the extent of a county from an initial statewide interface (see
> http://www.ra.dnr.state.mn.us/photos/photos_init.html).  Note that in this case [shpext] is not an
> attribute of the shape per se (that is, it's not stored in the .dbf file), but is a value calculated by
> the mapserver software (documented at http://mapserver.gis.umn.edu/templates.html).
> 
> Hope this helps,
> 
> --Ken
> 
> ============================================================================
> Ken Boss
> Digital Image Analysis / Web Stuff      Forestry Resource Assessment
> kenboss at dilbert.dnr.state.mn.us         Minnesota Dept. of Natural Resources
> Voice: 218 327 4449 ext. 237            413 SE 13th Street
> Fax:   218 327 4517                     Grand Rapids, MN  55744         USA
> ============================================================================

-- 
 ___________________________________    GGG G   AAA      III    AAA     
|  Jim T. Bowen, M.Sc., President   |  G   GG     A       I       A     
|                                   | G     G    A A      I      A A    
|Suite 306,  822-11th Ave. S.W.     | G     G    A A      I      A A    
|Calgary, Alberta, Canada  T2R 0E5  | G         A   A     I     A   A   
|Ph: 403-571-7213  Fax: 403-571-7211| G   GGGG  A   A     I     A   A   
|_______bowenj at gaiaenv.com__________| G     G   AAAAA     I     AAAAA   
           ICQ: 15567315              G     G  A     A    I    A     A  
      http://www.gaiaenv.com           G    G  A     A    I    A     A
                                        GGGG  AAA   AAA  III  AAA   AAA



More information about the mapserver-users mailing list