No subject


Fri Feb 8 15:06:04 EST 2008


via the function because they are not used. I posted a question
previously regarding this but with everyone busy preparing for the
conference nobody has had a chance to answer yet.
Most of this was taken directly from the howto doc.

HTH

Lowell

----------------------- processtemplate.cgi --------------------------
!/usr/bin/perl -w
use strict;
use mapscript;
use CGI qw(:standard *table);
use CGI::Carp qw(fatalsToBrowser set_message);
#
# Set variables.
$|=1;
my $minx = 2164714.53870837;
my $miny = 527860.008639881;
my $maxx = 2179450.00584917;
my $maxy = 542595.475780681;
my $mapname = 'popup.map';
my @names = ("map","imgext");
my @values = ("popup.map","$minx $miny $maxx $maxy");
#
# Send html header.
print header();
$ENV{MS_ERRORFILE} = "../html/tmp/mapserver.log";
#
# Open map using default map file.
my $map = new mapscript::mapObj("$mapname") or die('Unable to Open
Default MapFi
le!');
#
# Set map legend template.
$map->{legend}->{template} = "legend.html";
#
# Create html file.
#my $htmlpage = $map->processTemplate(1,\@names,\@values);
my $htmlpage = $map->processLegendTemplate(\@names,\@values);
#
# Didn't get this to work yet - not because the typemap doesn't work
#   but rather creating a map of query results from inside a cgi that can
#   manipulate the map directly to create a map of query results from a
#   set of results it could query is confusing at the moment.
#my $htmlpage = $map->processQueryTemplate(\@names,\@values);
#
# Pipe out the html file.
print $htmlpage;

---------------------- legend.html ---------------------------------
[leg_header_html]
<html>
<head>
<title>Legend.html</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table align="left" border="0">
[/leg_header_html]
[leg_layer_html]
<tr>
  <td>
    <input type=checkbox name="map_[leg_layer_name]_status"
    value=1 [if name=layer_status oper=eq value=2]CHECKED[/if]>
  </td>
  <td colspan=2>
    [metadata name=title]
  </td>
</tr >
[/leg_layer_html]

[leg_class_html]
<tr>
  <td width=15> </td>
  <td>
     <img src="[leg_icon width=20 height=10]" width=20 height=10>
  </td>
  <td>
     [leg_class_name]
  </td>
</tr>
[/leg_class_html]
[leg_footer_html]
</table>
</body>
</html>
[/leg_footer_html]



More information about the mapserver-users mailing list