[mapserver-users] Creating legend

Fawcett, David David.Fawcett at state.mn.us
Tue Oct 7 12:04:25 PDT 2008


Or, just a straight mode=legend request to the CGI if you are using MapServer.  You can pass in your extent, that will manage the scale-dependent layers.
 
David.

	-----Original Message-----
	From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Roger André
	Sent: Tuesday, October 07, 2008 12:06 PM
	To: Steve Lime
	Cc: mapserver-users at lists.osgeo.org
	Subject: Re: [mapserver-users] Creating legend
	
	
	Also, you might want to consider making a separate GetLegendGraphic WMS request and putting the legend in a separate DIV element in your web page.  
	
	Just an idea.
	--
	
	
	On Tue, Oct 7, 2008 at 8:22 AM, Steve Lime <Steve.Lime at dnr.state.mn.us> wrote:
	

		Visit:
		
		 http://www.openlayers.org/dev/examples/example-list.html
		
		and search for untiled. There's a "WMS Untiled" example you can view the source of. The singleTile option goes in the "options" object as opposed the "params" object. Params get passed to the WMS service, options are handled by OL.
		
		Steve
		
		>>> Subha Ramakrishnan <subha at gslab.com> 10/07/08 9:58 AM >>>
		
		Hi Steve,
		It would be great if you can give me an example or tell me where it is
		usually set in OL.
		Thanks for your help.
		
		Subha
		
		Steve Lime wrote:
		> There's nothing you have to do on the MapServer side. Looks like your OL config is wrong
		> though. I think 'singleTile' is set in the wrong configuration object, perhaps others are in
		> the wrong place too.
		>
		> Steve
		>
		>
		>>>> Subha Ramakrishnan <subha at gslab.com> 10/07/08 1:30 AM >>>
		>>>>
		> Hi,
		>
		> I am using mapserver 5.0.2 with openlayers.
		> I've a problem while creating a legend for a map from mapserver.When i
		> try to overlay the image from the mapserver on openlayers' base map, the
		> images are rendered in tiles, and every tile has a legend and is limited
		> by the size of the tile. So, i see lots of legends on the map and only
		> half of them are visible as it is restricted by the tile size.
		>
		> This is my request to mapserver from openlayers
		>
		> var mapfile = layer_tablename+'.map';
		> twms1 = new OpenLayers.Layer.WMS(
		> layer_tablename,"http://localhost/cgi-bin/mapserv?",
		> { map: mapfile,
		>    transparent: 'true', layers:layer_tablename,
		>    format: 'image/png',
		>    projection:"EPSG:4326",reproject:false,
		>    units: "m",
		>    singleTile: true
		> },{numZoomLevels : MaxZoomLevel});
		> map.addLayer(twms1);
		>
		> I am using the option of singleTile. Is there any setting to be done in
		> the map file or mapserver for it render a single tile/single legend per
		> image?
		>
		> Thank you.
		>
		> Regards,
		> Subha
		>
		> _______________________________________________
		> mapserver-users mailing list
		> mapserver-users at lists.osgeo.org
		> http://lists.osgeo.org/mailman/listinfo/mapserver-users
		>
		>
		>
		
		
		_______________________________________________
		mapserver-users mailing list
		mapserver-users at lists.osgeo.org
		http://lists.osgeo.org/mailman/listinfo/mapserver-users
		


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20081007/bc695751/attachment.htm>


More information about the MapServer-users mailing list