[Mapserver-users] no legend

Darren.Cope at statcan.ca Darren.Cope at statcan.ca
Thu Mar 18 08:20:52 EST 2004


Make sure you have a NAME for each CLASS.  Then the legend should work
properly!

-----Original Message-----
From: Elisabeth Nolz [mailto:e9625730 at student.tuwien.ac.at] 
Sent: March 18, 2004 7:21 AM
To: mapserver-users at lists.gis.umn.edu
Subject: [Mapserver-users] no legend


hi list.

i have a "simple" problem: there ist no legend indicated. not even an error
message. just an image with nothing in it. i can't imagine why. what am i
doing wrong? i am grateful for each assistance.

here is an extract of my mapfile (with only one layer):

NAME TEST
STATUS ON
SIZE 300 300
EXTENT 1100 340050 2000 339480
UNITS METERS
SHAPEPATH "data"
IMAGECOLOR 255 255 255
IMAGETYPE GIF

WEB
 IMAGEPATH "c:\apache\htdocs\bla\tmp\"
 IMAGEURL "/bla/TMP/"
END

LEGEND
 STATUS ON
 IMAGECOLOR 255 255 255
 TRANSPARENT OFF
 OUTLINECOLOR 0 0 0
 KEYSIZE 200 120
 POSITION LR
 LABEL
  TYPE BITMAP
  SIZE MEDIUM
  COLOR 160 220 255
 END
END

LAYER
 NAME "blabla"
 DATA "blabla"
 STATUS ON
 TYPE POLYGON
 CLASSITEM "blabla"
 CLASS
  EXPRESSION /./
  OUTLINECOLOR 0 0 0
  COLOR 255 255 255
 END
END


and an extract of my php-file:

<?php
 ...
 $map=ms_newMapObj($map_path.$map_file);
 $image=$map->draw();  $image_url=$image->saveWebImage(MS_GIF,1,1,0);
 $image_legend=$map->drawLegend();
$image_legend_url=$image_legend->saveWebImage(MS_GIF,1,1,0);
 ...
?>

<html>
...
<td valign="top">
 <table>
  <tr><td>
   <font size=+2><b>Legende</b></font><br>
   <img src="<?php echo $image_legend_url?>">
  </td></tr>
 </table>
</td>
...
</html>


thx, elisabeth.
_______________________________________________
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