[mapserver-users] How to Create Legend for Single Layer
Venkat Rao Tammineni
vtammineni at roulacglobal.com
Tue Dec 23 00:42:31 PST 2008
Hi,
Thanks for your great response.I am not using CGI.I am using asp
C#.net.I have created a method which generates legend.But it is doing for
all the layers.And my layer does the expression property.based on the
expression I m displaying polygon.
Below code is for trying to get legend for single layer.But it is not
working.
layer = MapFunction.Map.getLayerByName("TestLayer");
classObj classLegend = new classObj(layer);
imageObj imagelegend = MapFunction.Map.drawLegend();
string strFile ="C:\\temp\\test.png";
imagelegend.save(strFile,MapFunction.Map);
Thanks
Venkat.
-----Original Message-----
From: Subha Ramakrishnan [mailto:subha at gslab.com]
Sent: Tuesday, December 23, 2008 2:00 PM
To: Venkat Rao Tammineni
Cc: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] How to Create Legend for Single Layer
Hi,
You can do so using mode=legend request. Eg:
"http://localhost/cgi-bin/mapserv?mode=legend&map=mapfile&layer=layer_name"
This will give the legend only for the layer that you pass in the url.
In addition to this, is there a facility to generate legend for a layer
with a filter, where the filter takes in parameters passed from URL to
generate polygons??
Thanks & regards,
Subha
Venkat Rao Tammineni wrote:
>
> Dear All,
>
>
>
> I want to create Legend for Single layer. I have 5 layers on my Map.
> But I need to generate legend for single layer. Is it possible to
> generate Legend for single layer. If some one done the same task.
> Please let me know.
>
>
>
> I am waiting for your great response.
>
>
>
> Thanks,
>
> Venkat.
>
>
> --
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.
> ------------------------------------------------------------------------
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
More information about the MapServer-users
mailing list