[mapserver-users] Template Substitution not working. MapServ 5.6.0
Lime, Steve D (DNR)
Steve.Lime at state.mn.us
Sun Apr 11 20:47:17 PDT 2010
How are you accessing the template? What's the call to MapServer look like?
Steve
________________________________________
From: mapserver-users-bounces at lists.osgeo.org [mapserver-users-bounces at lists.osgeo.org] On Behalf Of Teluk, Bill G [Bill.Teluk at team.telstra.com]
Sent: Sunday, April 11, 2010 9:12 PM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] Template Substitution not working. MapServ 5.6.0
Hi,
I am unable to get Template Substitution working in HTML files.
The HTML template has a <!-- mapserver template --> line at the very top.
The Map file works fine - the images are being generated in my tmp directory. But the HTML file returned to the browser, doesn't have any of the of the substitution variables actually substituted - so I get things like [img], [version] in the returned HTML.
My install is a FGS Ver 9.5 package, installed onto RHEL 5.2.
Mapserv Version is 5.6.0
Apache 2.2.11 (as per FGS version check)
Can anyone help please? (Thanks In Advance!)
My template file is accessed by an initial form to set the query parameters
Start File: Indexpathtest.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="english">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<title>Path Testing Index</title>
</head>
<body>
<H2>Path Testing Application</H2>
<DIV STYLE="{display:inline;}">
<FORM name="mapserv" METHOD=GET ACTION="http://mymachine.mynet:8080/cgi-bin/mapserv">
<INPUT TYPE="hidden" NAME="map" VALUE="/home/maptools/fgs/www/htdocs/sbbt/pathtest.map">
<INPUT TYPE="hidden" NAME="zoomdir" VALUE=1>
<INPUT TYPE="hidden" NAME="zoomsize" VALUE=2>
<INPUT TYPE="hidden" NAME="mapext" VALUE="105 -45 155 -5">
<input type="hidden" name="mode" value="browse">
<INPUT TYPE="hidden" NAME="program" VALUE="/home/maptools/fgs/www/cgi-bin/mapserv">
<INPUT TYPE="submit" value="Map View">
</FORM>
<BR>
</DIV>
<HR>
</body>
</html>
Templated File: pathtest.html
<!-- MAPSERVER TEMPLATE -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="english">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<title>Path Testing Index</title>
</head>
<body>
<H2>Saturn Map</H2>
<FORM name="mapserv" METHOD=GET ACTION="http://mymachine.mynet:8080/cgi-bin/mapserv">
<INPUT TYPE="image" NAME="img" SRC="http://mymachine.mynet:8080[img]" width="800" height="600" BORDER="1" ALT="Saturn Map" STYLE="{border-style:solid; border-width:1px;}">
<input type="hidden" name="map" value="[map]">
<INPUT TYPE="hidden" NAME="imgext" VALUE="[mapext]">
<INPUT TYPE="hidden" NAME="imgxy" VALUE="400 300">
<INPUT TYPE="hidden" NAME="zoom" VALUE="1">
<input type="hidden" name="mode" value="browse">
<input type="hidden" name="map_web" value="[map_web]">
<INPUT TYPE="submit" value="Map View">
</FORM>
<hr>
<small><b>Version: </b>[VERSION]</small><br>
<small><b>Errors: </b><font color="#ff0000">[ERRMSG]</font></small><br>
</body>
</html>
MAP Config File: pathtest.map
# pathtest.map
MAP
NAME PATHTEST
SIZE 800 600
STATUS ON
EXTENT 105 -45 155 -5
IMAGECOLOR 255 255 255
UNITS DD
SYMBOLSET "/home/maptools/fgs/mapconfig/common/vortrag/symbols/symbolsmod.sym"
FONTSET "/home/maptools/fgs/mapconfig/common/fonts.list"
PROJECTION
"init=epsg:4283" #GDA94
END
WEB
TEMPLATE "http://mymachine.mynet:8080/sbbt/pathtest.html"
IMAGEPATH "/home/maptools/fgs/www/htdocs/sbbt/tmp/"
IMAGEURL "/sbbt/tmp/"
LOG "/home/maptools/fgs/www/htdocs/sbbt/pathtestlog.txt"
MINSCALEDENOM 1000
END
LAYER
NAME Coastline
TYPE LINE
STATUS DEFAULT
DATA "/home/maptools/fgs/data/base/osdm/globalmap2001/Vector/boundaries/coastl.shp"
CLASS
NAME 'Coast Line'
STYLE
OUTLINECOLOR 0 0 0
COLOR 150 150 150
END
END
END
LAYER
NAME 'Capitals'
TYPE POINT
STATUS DEFAULT
FEATURE
POINTS
138.67286682128906 -34.715538024902344
END
TEXT "Adelaide"
END
FEATURE
POINTS
145.08828735351562 -37.826736450195312
END
TEXT "Melbourne"
END
CLASS
STYLE
SYMBOL "punkt"
SIZE 10
OUTLINECOLOR 255 0 0
COLOR 255 255 0
END
LABEL
COLOR 0 0 0 # LABEL FONT COLOR
FONT "arial-bold"
TYPE truetype
SIZE 12
POSITION AUTO
END
END
END
END
Regards,
Bill Teluk
More information about the MapServer-users
mailing list