[Mapserver-users] using CGI methods
Agneta Schick
schick at sdac.hannover.bgr.de
Tue Jan 21 08:25:56 PST 2003
Hello,
When generating html code in my perl script, I found a difference
between using methods in CGI.pm and print statements.
In the one case (print statements)
the mapping extents change with pan and in the other they remain unchanged.
Can somebody explain this?
Here is the part of the perl script which makes the difference:
<snip>========================================================
# ----------normal print statements with 'use CGI(:standard);'-------------
#print header();
#print start_html(-title=>'MapServer - Earthquake Mapper', -bgcolor=>"#ffffff");
#print "<form name=\"quakes\" action=\"/cgi-bin/maptest.pl\" method=\"get\"
enctype=\"application/x-www-form-urlencoded\">";
#print "<input type=\"image\" name=\"img\" src=\"". $image_virtual_path .
$image_id ."\" border=\"0\" >";
#print "<input type=\"hidden\" name=\"imgext\" value=\"" . join(' ',
$map->{extent}->{minx},$map->{extent}->{miny},$map->{extent}->{maxx},$map->{exte
nt}->{maxy}) ."\">";
#print "</form>";
#print end_html();
# -----here the same statements with 'use CGI;' ---------
print $query->header( "text/html" );
print $query->start_html(-title=>'MapServer - Earthquake Mapper',
-bgcolor=>"#ffffff");
print $query->startform(-name=>"quakes", -method=>GET,
-action=>"/cgi-bin/maptest.pl");
print $query->image_button(-name=>'img', -src=>$image_virtual_path .
$image_id, -border=>0 );
print $query->hidden( -name=>"imgext", -default=>join(' ',
$map->{extent}->{minx},$map->{extent}->{miny},$map->{extent}->{maxx},$map->{exte
nt}->{maxy}) );
print $query->end_form;
print $query->end_html;
<end snip>===============================================================
In both cases the html code is identical so what makes the difference?
Have I made a mistake or does this mean never use CGI methods in combination
with Mapscript?
I'm using Mapserver 3.6, Perl 5.6.1 on Sun Solaris8 with Apache server.
Thanks for any hints.
Agneta Schick
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Agneta Schick
Bundesanstalt fuer Geowissenschaften und Rohstoffe
Federal Institute for Geosciences and Natural Resources
Stilleweg 2
D- 30655 Hannover Tel.: +49 511 643 3136
GERMANY FAX.: +49 511 643 3663
schick at sdac.hannover.bgr.de http://www.seismologie.bgr.de
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
More information about the MapServer-users
mailing list