Re: [mapserver-users] Basic Templating
If you're using templates to present query results the template should be referenced in a layer. TEMPLATE in the web object is for mode=browse only and is generally not used much anymore. What does your query URL look like? The template you pasted below doesn't look to contain any references to layer attributes. It looks like just a stock browse template. From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Sowmya Tiramdasu Sent: Thursday, August 02, 2012 4:04 PM To: 'Mapserver-users' Subject: [mapserver-users] Basic Templating 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 #EXTENT1525556.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/ titleGoogle/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
[mapserver-users] Basic Templating
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 #EXTENT1525556.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/ titleGoogle/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 -- bMap Controls/bbr 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