[ka-Map-users] Re: Legend display problem

percy percyd at pdx.edu
Tue Oct 3 12:16:38 EDT 2006


Here's a chunk of php/html that I use to test my mapfiles, hope it helps,
Percy

<?php
// set error reporting
ini_set("display_errors", 1);
ini_set("display_startup_errors", 1);
error_reporting (E_ALL);

$map_file="./glaciers.map";
$map1 = ms_newMapObj($map_file);
$image1=$map1->draw();
$image2=$map1->drawreferencemap();
$image3=$map1->drawlegend();

$image_url1=$image1->saveWebImage();
$image_url2=$image2->saveWebImage();
$image_url3=$image3->saveWebImage();

?>
  <HTML>
  <HEAD>
  <TITLE>Test map elements</TITLE>
  </HEAD>
  <BODY>
  <?php
  // specify height/width to make the page render a bit faste
  echo "map: <br><img SRC=\"$image_url1\"><br>";
  echo "refmap: <br><img SRC=\"$image_url2\"<br>";
  echo "legend: <br><img SRC=\"$image_url3\"<br>";
?>

  </BODY>
</html>

ka-map-users-request at lists.maptools.org wrote:
> Send ka-Map-users mailing list submissions to
> 	ka-map-users at lists.maptools.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://lists.maptools.org/mailman/listinfo/ka-map-users
> or, via email, send a message with subject or body 'help' to
> 	ka-map-users-request at lists.maptools.org
> 
> You can reach the person managing the list at
> 	ka-map-users-owner at lists.maptools.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ka-Map-users digest..."
> 
> 
> Today's Topics:
> 
>    1. Re: Legend display problem (Paul Spencer)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Mon, 2 Oct 2006 22:34:09 -0400
> From: Paul Spencer <pspencer at dmsolutions.ca>
> Subject: Re: [ka-Map-users] Legend display problem
> To: Kumar <kumar at newfields.com>
> Cc: ka-map-users at lists.maptools.org
> Message-ID: <84F482A6-7C9C-4601-BC02-CEA6C9E24597 at dmsolutions.ca>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
> 
> Wierd ... ka-Map just uses mapserver's gif legend for each group by  
> turning the appropriate group on.  Not sure that helps much though.   
> Can you see if you get a legend using mapserver directly?  I don't  
> know how to do this, but I know it can be done using the cgi (try  
> mapserver site if you need help on this)
> 
> Cheers
> 
> Paul
> 
> On 28-Sep-06, at 11:54 PM, Kumar wrote:
> 
>> Hi,
>> I am having problems displaying my legends for all the layers. For  
>> some
>> reason some layers draw the legend and some don't. I don't have  
>> problems
>> displaying the layers, except for the legend. I have attached my layer
>> definition below. Hope someone can point me in the right direction.  
>> Thanks
>> in advance.
>>
>> - kumar
>>
>>
>>   #------------ This works with legend---------
>>   LAYER
>>   	NAME "KCSL"
>>     Group "Known Contaminated Site Location"
>>     STATUS OFF
>>     DATA "the_geom from (select pi_name,status,the_geom from  
>> public.kcsl) as
>> foo using SRID=32111 using unique the_geom"
>>     TYPE POINT
>>     CONNECTIONTYPE POSTGIS
>>     CONNECTION "user=xxx password=xxx dbname=test host=localhost  
>> port=5432"
>>     UNITS feet
>>     SIZEUNITS PIXELS
>>     TOLERANCE 0
>> 	LABELMAXSCALE 5000
>> 	LABELITEM "pi_name"
>>     TOLERANCEUNITS PIXELS
>>     METADATA
>>     END
>>     CLASS
>>       NAME "Active"
>> 	  EXPRESSION ('[status]'='Active')
>>       LABEL
>>         TYPE TRUETYPE
>>         FONT "Lucida-Console"
>>         SIZE 8
>>         MINSIZE 4
>>         MAXSIZE 256
>>         POSITION AUTO
>>         OFFSET 0 0
>>         ANGLE AUTO
>>         BUFFER 0
>>         MINDISTANCE -1
>>         MINFEATURESIZE -1
>>         COLOR 10 200 55
>> 		OUTLINECOLOR 255 255 255
>>         ANTIALIAS TRUE
>>         PARTIALS TRUE
>>         FORCE FALSE
>>       END
>>       STYLE
>>         SYMBOL 2
>>         COLOR 10 200 55
>>         SIZE 9
>> 		MAXSIZE 100
>>       END
>>     END
>>     CLASS
>>       NAME "NFA-A (Restricted Use)"
>> 	  EXPRESSION ('[status]'='NFA-A (Restricted Use)')
>>       LABEL
>>         TYPE TRUETYPE
>>         FONT "Lucida-Console"
>>         SIZE 8
>>         MINSIZE 4
>>         MAXSIZE 256
>>         POSITION AUTO
>>         OFFSET 0 0
>>         ANGLE AUTO
>>         BUFFER 0
>>         MINDISTANCE -1
>>         MINFEATURESIZE -1
>>         COLOR 200 0 55
>> 		OUTLINECOLOR 255 255 255		
>>         ANTIALIAS TRUE
>>         PARTIALS TRUE
>>         FORCE FALSE
>>       END
>>       STYLE
>>         SYMBOL 2
>>         COLOR 200 0 55
>>         SIZE 9
>> 		MAXSIZE 100
>>       END
>>     END
>>   END
>>   #------------ This doesn't work with the legend --------
>>   LAYER
>>   	NAME "njpdes"
>>     Group "New Jersey - NJPDES"
>>     STATUS OFF
>>     DATA "the_geom from (select facname,distype,the_geom from
>> public.vw_nj_npdes) as foo using SRID=32111 using unique the_geom"
>>     TYPE POINT
>>     CONNECTIONTYPE POSTGIS
>>     CONNECTION "user=xxx password=xxx dbname=test host=localhost  
>> port=5432"
>>     UNITS feet
>>     SIZEUNITS PIXELS
>>     TOLERANCE 0
>> 	LABELMAXSCALE 5000
>> 	LABELITEM "facname"
>>     TOLERANCEUNITS PIXELS
>>     METADATA
>>     END
>>     CLASS
>>       NAME "Petroleum hydrocarbon remediation"
>> 	  EXPRESSION ('[distype]'='B4B')
>>       LABEL
>>         TYPE TRUETYPE
>>         FONT "Lucida-Console"
>>         SIZE 8
>>         MINSIZE 4
>>         MAXSIZE 256
>>         POSITION AUTO
>>         OFFSET 0 0
>>         ANGLE AUTO
>>         BUFFER 0
>>         MINDISTANCE -1
>>         MINFEATURESIZE -1
>>         COLOR 0 200 0
>> 		OUTLINECOLOR 255 255 255
>>         ANTIALIAS TRUE
>>         PARTIALS TRUE
>>         FORCE FALSE
>>       END
>>       STYLE
>>         SYMBOL 7
>>         COLOR 0 200 0
>>         SIZE 9
>> 		MAXSIZE 100
>>       END
>>     END
>>     CLASS
>>       NAME "Undefined - BGR"
>> 	  EXPRESSION ('[distype]'='BGR')
>>       LABEL
>>         TYPE TRUETYPE
>>         FONT "Lucida-Console"
>>         SIZE 8
>>         MINSIZE 4
>>         MAXSIZE 256
>>         POSITION AUTO
>>         OFFSET 0 0
>>         ANGLE AUTO
>>         BUFFER 0
>>         MINDISTANCE -1
>>         MINFEATURESIZE -1
>>         COLOR 200 0 0
>> 		OUTLINECOLOR 255 255 255		
>>         ANTIALIAS TRUE
>>         PARTIALS TRUE
>>         FORCE FALSE
>>       END
>>       STYLE
>>         SYMBOL 7
>>         COLOR 200 0 0
>>         SIZE 9
>> 		MAXSIZE 100
>>       END
>>     END
>>   END
>>
>> _______________________________________________
>> ka-Map-users mailing list
>> ka-Map-users at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/ka-map-users
> 
> +-----------------------------------------------------------------+
> |Paul Spencer                           pspencer at dmsolutions.ca   |
> +-----------------------------------------------------------------+
> |Chief Technology Officer                                         |
> |DM Solutions Group Inc                 http://www.dmsolutions.ca/|
> +-----------------------------------------------------------------+
> 
> 
> 
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
> 
> 
> End of ka-Map-users Digest, Vol 18, Issue 3
> *******************************************
> 


More information about the ka-Map-users mailing list