Display MapServer Legend in GeoExt using OpenLayers

المشرف العام

Administrator
طاقم الإدارة
I have been trying to get my MapServer legend displayed in a GeoExt app using OpenLayers. I am quite new in MapServer and web mapping. Only a vector legend, and my OpenStreetMap legend is displayed.

My mapfile:

OUTPUTFORMAT NAME png DRIVER 'GD/PNG' MIMETYPE 'image/png' IMAGEMODE RGBA EXTENSION 'png'END# LegendLEGEND#IMAGECOLOR 255 255 255 STATUS DEFAULT KEYSIZE 18 12 LABEL TYPE BITMAP SIZE MEDIUM COLOR 0 0 89 ENDENDWEB TEMPLATE '/var/www/html/mapfile/template.html' IMAGEPATH '/var/www/html/mapfile/output/' IMAGEURL '../mapfile/output/' # WMS server settings METADATA 'ows_title' 'Mosaic' 'ows_onlineresource' 'http://localhost/cgi-bin/mapserv?map=/var/www/html/mapfile/mosaic.map' 'ows_srs' 'EPSG:4326' ENDEND

And my GeoExt:

var mosaic = new OpenLayers.Layer.MapServer('National Mosaic', "http://localhost/cgi-bin/mapserv?", { map: "/var/www/html/mapfile/mosaic2.map", transparent: true }, { numZoomLevels: 22, opacity: 0.5, visibility: false, isBaseLayer: false }); mosaic.setVisibility(false);mosaic.setIsBaseLayer(false);

أكثر...
 
أعلى