[mapserver-users] Creating legend

Subha Ramakrishnan subha at gslab.com
Tue Oct 7 02:30:34 EDT 2008


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



More information about the mapserver-users mailing list