<html><body><div style="color:; background-color:; font-family:arial, helvetica, sans-serif;font-size:13px"><div><span>Thanks for your help</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>I changed my file to follows:</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span></head><br>    <script language="JavaScript"><br>        function zoom(){<br>        </span><span class="tab">    </span><span>document.forms['mapserv'].submit();<br>        }<br>    </script><br><body><br><h1> A Dynamic Map </h1><br><p></p><br><h3> use form to make map dynamic +
 scripting </h3><br>    <form name="mapserv" method="get" action="/cgi-bin/mapserv.exe"><br>        <input type="hidden" name="imgxy" value="[center]"><br>        <input type="hidden" name="map" value="[map]" /><br>        <input type="hidden" name="imgext" value="[mapext]" /><br>        <input type="hidden" name="layers" value="[layers]" />    <br>        <input type="hidden" name="mode" value="map" /><br><br>        <input type="hidden" name="zoomsize" value="2" /><br>        <br>        <input type="image" name="img" src="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/ms101/htdocs/ms101.map&layers=all&mode=map" 
 onclick="zoom()"/><br><br>    </form><br><br></body><br><html></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>If i click on image, i get a response from mapserver correctly. In fact, in loading the above page, mapserver properly fills variables like [map]. This is the url after clicking map:</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style:
 normal;"><span>http://localhost/cgi-bin/mapserv.exe?imgxy=400+200&map=%2Fms4w%2Fapps%2Fms101%2Fhtdocs%2Fms101.map&imgext=-180+-90+180+90&layers=[layers]&mode=map&zoomsize=2&img.x=228&img.y=108<br></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span> </span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>But when i remove </span><span><input type="hidden" name="imgxy" value="[center]">, mapserver does not substitutes any variable.<br></span></div><div> this is the url after clicking map:<br>http://localhost/cgi-bin/mapserv.exe?map=[map]&imgext=[mapext]&layers=[layers]&mode=map&zoomsize=2&img.x=618&img.y=160<br><br>Why MapServer behaves like this? (useful for mentioning, there is no
 template defined in map file)<br><br> <div>----- Original Message -----<br> From: Alan Boudreault <aboudreault@mapgears.com><br> To: mapserver-users@lists.osgeo.org<br> Cc: <br> Sent: Monday, September 10, 2012 5:58 AM<br> Subject: Re: [mapserver-users] mapserver+javascript without template example?!!!<br> <br>You should verify what exact request is sent to the server... I would <br>assume something like "map=[map]" is sent. Use Firebug of any other <br>debugging tool.<br><br>Alan<br><br>On 12-09-09 01:54 PM, Saka Royban wrote:<br>> Hi all.<br>> I'm just looking for some examples of using javascript with mapserver<br>> without using html templates.<br>> I know that there are some libraries around like OpenLayers, but i wanna<br>> see what happens in background first and then move to use these libraries.<br>> This is what i have written which does not works: (i get a error saying<br>> MS_DEFAULT_MAPFILE_PATTERN validation
 failed )<br>> <html><br>> <head><br>> </head><br>>      <script language="JavaScript"><br>>          function zoom(){<br>>          document.forms['mapserv'].imgxy.value = "400 200";<br>>          document.forms['mapserv'].zoom.value = 2;<br>>          document.forms['mapserv'].submit();<br>><br>>          }<br>>      </script><br>> <body><br>> <h1> A Dynamic Map </h1><br>> <p></p><br>> <h3> use form to make map dynamic + scripting </h3><br>>      <form name="mapserv" method="GET" action="/cgi-bin/mapserv.exe"><br>>          <input type="hidden" name="imgxy" value="400 200"><br>>          <input
 type="hidden" name="map" value="[map]" /><br>>      <input type="hidden" name="imgext" value="[mapext]" /><br>>          <input type="hidden" name="imgxy" value="[center]" /><br>>          <input type="hidden" name="zoomsize" value="2" /><br>><br>>          <input type="image" name="img"<br>> src="<a href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/ms101/htdocs/ms101.map&layers=all&mode=map" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/ms101/htdocs/ms101.map&layers=all&mode=map</a>"<br>> onclick="zoom()"/><br>><br>>      </form><br>><br>> </body><br>><br>> Thanks in advance<br>> <html><br>><br>><br>> _______________________________________________<br>> mapserver-users mailing list<br>> <a
 ymailto="mailto:mapserver-users@lists.osgeo.org" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>> <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>><br><br><br>-- <br>Alan Boudreault<br><a href="http://www.mapgears.com/" target="_blank">http://www.mapgears.com/</a><br>_______________________________________________<br>mapserver-users mailing list<br><a ymailto="mailto:mapserver-users@lists.osgeo.org" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br> </div> </div> </div></body></html>