[mapserver-users] Basic Templating

Sowmya Tiramdasu stiramdasu at qcoherent.com
Thu Aug 2 14:04:03 PDT 2012


Hi , 

 

  I am trying to implement templating taking the help of the mapserver
tutorial. I created my own map file, which works fine. I get the output as
desired when I use mode=map. Now I am trying to include a template for my
example. I created a new template file 'gmapNew.html' . I added the
reference to this template file in my map file. Yet When I am submitting a
query, the template values are not being substituted correctly and so not
getting my required result. 

----------------------------------------------------------------------------
------------------------------

The snippet of my map file where I am referencing my template file. 

 

MAP

                IMAGETYPE      PNG

                EXTENT        -9423052.40     4582638.15  -9414491.41
4589289.39 # extents of las file for 3875 using cs2cs

                #EXTENT        1525556.83 190608.70 1547770.63 207656.82
#las files

                #EXTENT         -9435462.86     4562596.42  -9387971.96
4608897.38 # sbet lat lon to extent using cs2cs

                SIZE           1020 980

                SHAPEPATH      "../data"

                SYMBOLSET      "../symbols/symbols35.sym"

                #TRANSPARENT ON

                IMAGECOLOR     0 0 0

                FONTSET        "../fonts/fonts.list"

                PROJECTION

                                #"init=epsg:2246"

                                "init=epsg:3857"

                END

                

                WEB

                                TEMPLATE  "gmapNew.html"

                                IMAGEPATH "/ms4w/tmp/ms_tmp/"

                                IMAGEURL "/ms_tmp/"

                                METADATA

                                                "wms_enable_request" "*"

                                                "wms_title" "WMS Lidar
Server"

                                                "wms_onlineresource"
"http://localhost:8080/keenland?"

                                                "wms_srs" "espg:32617"

                                END

                 END

                

                .....

                .....

END

 

----------------------------------------------------------------------------
---------------------------------

My template file. 

 

<!-- MapServer Template -->

<!DOCTYPE html

  PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8"/>

<title>Google/MapServer Tile Example</title>

<link type="text/css" rel="stylesheet" href="[root]/ms35.css" />

</head>

<body >

                <!-- The central form the application is based on. -->

                <form name="mapserv" method="GET" action="[program]">

                    <input type="hidden" name="root" value="[root]" />

                                <input type="hidden" name="program"
value="[program]" />

                                <input type="hidden" name="map_web"
value="[map_web]" />

                                <input type="hidden" name="map"
value="[map]" />

                                <input type="hidden" name="imgext"
value="[mapext]" />

                                <input type="hidden" name="imgxy"
value="[center]" />

                                <input type="hidden" name="layers"
value="[layers]" />

                                <input type="hidden" name="zoom"
value="[zoom]" />

                                <table border=0 cellpadding=5>

                                                <tr>

                                                                <!-- First
column: Map and scale bar -->

                                                                <td
align=center>

 
<!-- The map -->

 
<input type="image" name="img" src="[img]"
style="border:0;width:300;height:400">

 
<br>

 


                                                                </td>

                                                                <td>

 
<div align="center">

 
<input type="submit" name="submit" value="Refresh">

 
</div>

                                                                </td>

                                                                <!-- Second
column: Zoom direction, Legend and Reference -->

                                                                <td
valign=top>

 
<!-- Zoom direction -->

 
<b>Map Controls</b><br> Set your zoom option:<br>

 
<select name="zoom" size="1">

 
<option value="2" [ z o o m _ 2 _ s e l e c t ] > Zoom in 2 times

 
<option value="1" [ z o o m _ 1 _ s e l e c t ] > Recenter Map

 
<option value="-2" [ z o o m _ - 2 _ s e l e c t ] > Zoom out 2 times

 
</select>

 
<br>

 

 


                                                                </td>

                                                </tr>

                                </table>

                

                </form>

</body>

</html>

 

Can anyone please help me . Any help is greatly appreciated. Thanks in
advance!

 

-Sowmya. 

_______________________________

Sowmya Tiramdasu

QCoherent Software

9668 Madison Blvd., Suite 202

Madison, AL 35758

(256) 461-8289 Telephone 

(256) 461-8249 Fax

 <http://www.geocue.com/> www.geocue.com

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120802/479934bb/attachment-0001.html>


More information about the mapserver-users mailing list