my app can not find template
Joseph Norris
sirronj at PACBELL.NET
Thu Nov 18 16:44:18 PST 2004
Ok - here is what I have.
I have a perl cgi that builds my primary page, builds the map file and uses
the perl api to build the map image, then displays the page. In the initial
page I have all of the hidden fields that will direct that are to be read by
the mapserver to allow me to zoom into different polygons on my California
zip map ( each polygon representing a zip ).
The cgi produces the following html:
<html>
<head>
<title>MapServer - CS CGI Application</title>
</head>
<body bgcolor="#ffffff">
<!-- map_template.html -->
<center><h1>MapServer - CS CGI Application</h1></center>
<hr>
<form method="GET" action="/cgi-bin/teacher/makmap.cgi"
name="mapserv_select">
<center>
<table border="0" cellspacing="0" cellpadding="4">
<tr>
<td>
Teacher Type: <SELECT NAME="type">
<OPTION VALUE="type1" >First Grade Teacher</option>
<OPTION VALUE="type2" >Second Grade Teacher</option>
<OPTION VALUE="type3" >Third Grade Teacher</option>
<OPTION VALUE="none" SELECTED></option>
</SELECT>
<input type="submit" value="Submit">
<input type="hidden" name="action" value="submit">
</form>
<form method="GET" action="/cgi-bin/mapserv" name="mapserv">
<input type="hidden" name="zoomsize" value=2>
<input type="hidden" name="map"
value="/usr/local/apache/htdocs/mco.communityservers.com/htdocs/tmp/filetRBR
Uk.map">
<input type="hidden" name="map_web_imagepath"
value="/usr/local/apache/htdocs/mco.communityservers.com/htdocs/maps/tmp/fil
eWHBLVG.gif">
<input type="hidden" name="map_web_template"
value="/usr/local/apache/htdocs/mco.communityservers.com/htdocs/maps/teacher
/templates/map_template.html">
<input type="hidden" name="map_web_imageurl" value="/maps/tmp">
<input type="hidden" name="root" value="/maps/teacher";
></td>
</tr>
<tr>
<td valign="top" align="center">
<table width="390" border="0" cellspacing="0" cellpadding="4"
align="center" bgcolor="#666666">
<tr>
<td align="center"><input type="image" name="img"
src="/maps/tmp/fileWHBLVG.gif" width="600" height="600" border="0" alt="this
is the map">
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
The html consists of two forms one for selection of the criteria which
rebuilds the map just fine. The second for looking at the polygons. My map
file that is produced appears as follows on the initial display of the map:
MAP
NAME CalMap
STATUS ON
EXTENT 5890870.385 -192053.200 8943310.847 3226086.749
IMAGETYPE GIF
SIZE 600 600
SHAPEPATH
"/usr/local/apache/htdocs/mco.communityservers.com/htdocs/maps/teacher/tdata
"
IMAGECOLOR 255 255 255
SYMBOL
NAME 'circle'
TYPE ELLIPSE
POINTS 1 1 END
FILLED TRUE
END
LAYER
NAME "cal_zp_st"
TYPE POLYGON
DATA "cal_zp_st"
STATUS DEFAULT
CLASSITEM "ZCTA"
CLASS
EXPRESSION /./
OUTLINECOLOR 204 204 204
END
END
END # end map from header
And after selection of specific criteria:
MAP
NAME CalMap
STATUS ON
EXTENT 5890870.385 -192053.200 8943310.847 3226086.749
IMAGETYPE GIF
SIZE 600 600
SHAPEPATH
"/usr/local/apache/htdocs/mco.communityservers.com/htdocs/maps/teacher/tdata
"
IMAGECOLOR 255 255 255
SYMBOL
NAME 'circle'
TYPE ELLIPSE
POINTS 1 1 END
FILLED TRUE
END
LAYER
NAME "cal_zp_st"
TYPE POLYGON
DATA "cal_zp_st"
STATUS DEFAULT
CLASSITEM "ZCTA"
CLASS
EXPRESSION
/94087|90408|94107|95118|94530|94596|90037|91016|92024|94954|93901|92503/
STYLE
SYMBOL 'circle'
SIZE 2
COLOR 255 102 102
END
END
CLASS
EXPRESSION /./
OUTLINECOLOR 204 204 204
END
END
END # end map from header
My error condition comes about when I try to click on one of the polygons in
the map.
#Joseph Norris (Perl - what else is there?/Linux/CGI/Mysql) print @c=map chr
$_+100,(6,17,15,16,-68,-3,10,11,16,4,1,14,-68,12,1,14,8,-68,4,-3,-1,7,1,14,-
68,-26,11,15,1,12,4,-68,-22,11,14,14,5,15,-90);
-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at lists.umn.edu]On
Behalf Of Ryan, Adam
Sent: Thursday, November 18, 2004 3:02 PM
To: MAPSERVER-USERS at lists.umn.edu
Subject: Re: [UMN_MAPSERVER-USERS] my app can not find template
> -----Original Message-----
> From: Joseph Norris [mailto:sirronj at PACBELL.NET]
> Sent: Thursday, November 18, 2004 2:25 PM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: [UMN_MAPSERVER-USERS] my app can not find template
>
>
> Hello,
>
> I am getting this message:
>
> mapserv(): Web application error. No template provided
>
> I have a hidden field <input type="hidden"
> name="map_web_template" value=" this I am not sure of ">
>
> Should my hidden field be the root relative or absolute path?
>
> No matter what I try my app is not finding my template.
>
> Thanks ahead of time.
>
>
> #Joseph Norris (Perl - what else is there?/Linux/CGI/Mysql)
> print @c=map chr
> $_+100,(6,17,15,16,-68,-3,10,11,16,4,1,14,-68,12,1,14,8,-68,4,
> -3,-1,7,1,14,-
> 68,-26,11,15,1,12,4,-68,-22,11,14,14,5,15,-90);
>
Joseph,
Just want to make sure your setting the value to a file, not just a path,
and not a url. Give us the examples that you've used.
Adam
More information about the MapServer-users
mailing list