[Mapserver-users] Question/Bug on CGI/Template Interface

woodbri at swoodbridge.com woodbri at swoodbridge.com
Mon Dec 22 22:16:37 PST 2003


Hi all,

I have run into an interesting problem. I would like to be able to 
have some fixed zoom scales so I built the template below. You will 
notice that in the <INPUT NAME="img1" ..> tag I named the image 
"img1" this is because if I name it "img" I get the following error:

msCalculateScale(): General error message. Invalid image extent. 
msCalculateScale(): General error message. Invalid image extent. 

BUT, if I add the <input type=hidden name=IMGEXT ...> then the zoom 
to scale does not work. But without the "img" tag I can't pan the 
map.

So is this a bug, A miss-application, Or what?

I would like to be able to pan and zoom, but also be able to force 
the map to a specific scale. What am I missing here?

Thanks,
  -Steve W.


------------------------------ main template file -------------------
<html>
<head><title>MapServer Demo Interface</title></head>
<body bgcolor=#FFFFFF>

<center><h1>MapServer Demo Interface</h1></center>
<hr>
<form method=GET action="/cgi-bin/mapserv">

<center>
<table border=0 cellspacing=0 cellpadding=4 bgcolor="#000000">
<tr>
<td valign="top" align=center>
  <table cellpadding="0" cellspacing="0" border="0">
    <tr>
      <td colspan="2">
        <INPUT NAME="img1" TYPE="image" SRC="[img]" width=[mapwidth] 
height=[mapheight] border=0>
      </td>
    </tr>
    <tr>
      <td> <font size=-1 face="arial,helvetica" 
color="#FFFFFF"><b>Powered by MapServer</b></font></td>
      <td align="right"><img src="[scalebar]"></td>
    </tr>
  </table>
</td>
<td valign="top" bgcolor=#ffffff>
  <table cellpadding="5" cellspacing="0" border="0" 
bgcolor="#ffffff">
    <tr><td>
      <center><input type="submit" value="Refresh/Query"></center>
      <p>

      <input type="radio" name="mode" value="browse" checked> 
<b>Browse map</b><br>
      <input type="radio" name="mode" value="query"> <b>Query 
feature</b><br>
      <input type="radio" name="mode" value="nquery"> <b>Query 
multiple features</b>

      <hr>
      <p>
      <input type="radio" name="scale" value="20000000"> Scale 
1:20M<br>
      <input type="radio" name="scale" value="4000000"> Scale 
1:4M<br>
      <input type="radio" name="scale" value="1000000"> Scale 
1:1M<br>
      <input type="radio" name="scale" value="500000"> Scale 
1:500K<br>
      <input type="radio" name="scale" value="150000"> Scale 
1:150K<br>
      <input type="radio" name="scale" value="50000"> Scale 1:50K<br>
      <input type="radio" name="scale" value="25000"> Scale 1:25K<br>
      <input type="radio" name="scale" value="15000"> Scale 1:15K<br>
      <input type="radio" name="scale" value="10000"> Scale 1:10K<br>
      <input type="radio" name="scale" value="7500"> Scale 1:7500<br>
      <input type="radio" name="scale" value="5000"> Scale 1:5000<br>
      <input type="radio" name="scale" value="2000"> Scale 1:2000<br>

    </td></tr></table>

  </td></tr>
</table>
</center>

<input type="hidden" name="mapxy"                value="[mapx] 
[mapy]">
<input1 type="hidden" name="imgxy"                value="299.5 
299.5">
<input1 type="hidden" name="imgext"               value="[mapext]">
<input type="hidden" name="map"                  value="[map]">
<input type="hidden" name="map_web_template"     
value="[map_web_template]">
<input type="hidden" name="map_size"             value="[map_size]">
<input type="hidden" name="map_legend_status"    value=off>
<input type="hidden" name="map_scalebar_status"  value=on>
<input1 type="hidden" name="savequery"            value="true">
<input1 type="hidden" name="mapext"               value="shapes">

</form>

<p><hr><p>
Scale 1:[scale]
</body></html>




More information about the MapServer-users mailing list