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

woodbri at swoodbridge.com woodbri at swoodbridge.com
Tue Dec 23 12:12:05 EST 2003


Steve,

Thank you for the explanation and suggestion. I will give that I try. 
What I am trying to achieve is to have fixed zoom scales and the 
ability to pan using the CGI interface. I can probably get a 
javascript version working when I have a few minutes to think it 
through.

Thanks again,
  -Steve W.


On 23 Dec 2003 at 9:23, Steve Lime wrote:

> Hi Steve: I think I'd classify this as both a bug and a mis-application.
> As I read the template I see that you're essentially telling MapServer 2
> ways to generate an image in the same form- from a mouse click and from
> a point/scale. That's likely confusing things. There is an order of
> precedence in place, but that addresses using an image zoom box vs a
> point zoom. The order of arguments could also be having an impact. I've
> tried to minimize confilcts like this but to a certain extent it's
> unavoidable. Perhaps setting a 'no scale' value where scale is ignored
> would help (that's the bug) but I'd have to check the source.
> 
> To fix? Well, if you can use javascript it's easy. I'd rename the
> control for setting scale to something else (so as not to confuse the
> CGI and have it call a small function to regenerate the interface at the
> right point. You'd move the substitutions for [mapx] and [mapx] into
> that function instead of hidden variables.
> 
> If you can't use javascript then you'd be best of having 2 forms. One
> for the main pan/zoom and another for the scale-based zoom.
> 
> Steve
> 
> >>> <woodbri at swoodbridge.com> 12/23/2003 12:16:37 AM >>>
> 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>&nbsp;<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>
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu 
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 





More information about the mapserver-users mailing list