<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hello,</div><div>I'm trying to build a webgis application based on geoext and mapserver. With the wfs layer I have no problem, but I unable to visualize a WMS layer through the use of Mapserver. When I try a getMap request the map is displayed correctly. I can't understand where is the problem because with geoserver I never had problems.<br></div><div>This is an extract of my code:</div><div><br></div><div> .... <br> var ctrwms = new OpenLayers.Layer.WMS("CTR",<br> "http://localhost/cgi-bin/mapserv?map=/var/www/web/workspace/provawms/wms.map",<br>
{<br> 'layers': 'ctr1',<br> transparent: true,<br> format: 'image/png',<br> },<br> {<br> isBaseLayer: false,<br> unsupportedBrowsers:
[]<br> }<br> );</div><div><br></div><div>.....</div><div><br></div><div> mapPanel = new GeoExt.MapPanel({<br> border: true,<br> region: "center",<br> // we do not want all overlays, to try the OverlayLayerContainer<br> map: map,<br> center: new OpenLayers.LonLat(1401837, 5184672),<br> zoom: 12,<br> tbar: [toolbarItems,zoomSelector],<br> layers: [<br> mapnik,<br><span class="tab">
</span><span class="tab"> </span><span class="tab"> layer1,</span></div><div><span class="tab"> </span><span class="tab"> </span><span class="tab"> layer2,</span><br> ctrwms<br> <br> ]<br> });</div><div><br></div><div>.....<br></div><div><br></div><div>and this is my wms mapfile</div><div><br></div><div><br></div><div>MAP<br> NAME "WMS_server"<br> STATUS ON<br> SIZE 600 500<br> ##SYMBOLSET "../etc/symbols.txt"<br> EXTENT 1395920.955 5186948.808 1400773.272 5190970.799<br> UNITS METERS<br> IMAGECOLOR 0 0 255<br> IMAGETYPE image/png<br> ##FONTSET "../etc/fonts.txt"<br><br> WEB<br> IMAGEPATH "/tmp/"<br> IMAGEURL
"/tmp/"<br> METADATA<br> "wms_title" "WMS Demo Server for MapServer" ## REQUIRED<br> "wms_onlineresource" "http://demo.mapserver.org/cgi-bin/wms?" ## Recommended<br> <br> );"wms_srs" "epsg:900913" ## Recommended<br> "wms_abstract" "This text describes my WMS service." ## Recommended<br> "wms_enable_request" "*" # necessary<br> END<br> TEMPLATE 'prova_t.html'<br> HEADER 'prova_t_header.html'<br> FOOTER 'prova_t_footer.html'<br> END<br><br> PROJECTION<br>
"init=epsg:900913"<br> END<br><br><br>OUTPUTFORMAT ### 24 bit PNG<br> NAME 'agg_png'<br> DRIVER AGG/PNG<br> IMAGEMODE RGB<br>END<br><br> <br> LAYER<br> NAME "ctr1"<br> STATUS ON<br> METADATA<br> "wms_title" "ctr1" ##REQUIRED<br> "wms_srs" "epsg:900913" ## REQUIRED<br> "wms_onlineresource" "http://localhost/cgi-bin/mapserv?map=/var/www/web/workspace/provawms/wms.map" <br> "wms_enable_request" "*"<br> END<br> TYPE RASTER<br> DATA 'data/gggg.tif'<br> PROJECTION<br> "init=epsg:900913"<br> END<br> END
#layer<br>END #mapfile</div><div><br></div><div><br></div><div>Thanks to everybody</div><div><br></div><div>Francesco<br></div><div><br></div><div><br></div><div><br></div></div></body></html>