[mapserver-users] WMS + Layers with OPACITY

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Tue Jun 2 10:04:45 EDT 2009


Hi,

Satellite images tend to look ugly with 8 bits as you are serving now.
Try with 24-bit png by changing IMAGEMODE to RGB.

-Jukka Rahkonen-


Alvarez Saldarriaga wrote:
> 
> Hey, I'm trying to use a WMS map from the NASA as myy BASE 
> map and som other layers (SHP), but I don't know why the 
> image looks so ugly, I'm using OpenLayers to render the map 
> and mapserver on Ubuntu, I set the WMS as png and the other 
> layers too, can somebody help me with this?, the map and the 
> image are attached, Thx.
> 
> This is the mapserver config:
> 
> MapServer version 5.4.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG 
> OUTPUT=WBMP OUTPUT=SVG  SUPPORTS=PROJ SUPPORTS=AGG 
> SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER  
> SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT 
> SUPPORTS=WCS_SERVER  SUPPORTS=FASTCGI SUPPORTS=THREADS 
> SUPPORTS=GEOS INPUT=EPPL7 INPUT=POSTGIS INPUT =OGR INPUT=GDAL 
> INPUT=SHAPEFILE
> 
> My OpenLayers config:
> 
> 	function showMap()
> 	{
> 		objOpenLayers = new OpenLayers.Map( "show-map", 
> { controls: [], /*
> zoom: 5 */ maxResolution: 'auto' } );
> 
> 		objOpenLayers.addControl( new 
> OpenLayers.Control.PanZoomBar() );
> 		objOpenLayers.addControl( new 
> OpenLayers.Control.MouseToolbar() );
> 		objOpenLayers.addControl( new 
> OpenLayers.Control.LayerSwitcher() );
> 		// objOpenLayers.addControl( new 
> OpenLayers.Control.Permalink() );
> 		// objOpenLayers.addControl( new 
> OpenLayers.Control.ScaleLine() );
> 		// objOpenLayers.addControl( new 
> OpenLayers.Control.Permalink( 'permalink' ) );
> 		objOpenLayers.addControl( new 
> OpenLayers.Control.MousePosition() );
> 		// objOpenLayers.addControl( new 
> OpenLayers.Control.OverviewMap() );
> 		objOpenLayers.addControl( new 
> OpenLayers.Control.KeyboardDefaults() );
> 
>     var twms = new OpenLayers.Layer.WMS( "NASA",
>         "http://wms.jpl.nasa.gov/wms.cgi?",
>         { map: 
> '/home/jfalvarez/projects/cms/branches/V1/docroot/map-files/91
82340517c2d323061dc1cffea6e431.map',
>           layers: 'BMNG',
>           format: 'image/png'}, {isBaseLayer: true} );
>     objOpenLayers.addLayer(twms);
> 
> var objMapServer17 = new OpenLayers.Layer.MapServer(
> 			"Colombia Departamentos",
> 			"http://vesifront.org/cgi-bin/mapserv",
> 			{
> 				map: 
> "/home/jfalvarez/projects/cms/branches/V1/docroot/map-files/91
82340517c2d323061dc1cffea6e431.map",
> 				layers: "Colombia_Departamentos",
> 				// maxResolution: "auto",
> 				transparent: "true",
> 				format: "image/png"
> 							}
> 		);
> 		objOpenLayers.addLayer( objMapServer17 );
> 
> 					var objMapServer18 = 
> new OpenLayers.Layer.MapServer(
> 			"Zona Bananera 2",
> 			"http://vesifront.org/cgi-bin/mapserv",
> 			{
> 				map: 
> "/home/jfalvarez/projects/cms/branches/V1/docroot/map-files/91
82340517c2d323061dc1cffea6e431.map",
> 				layers: "Zona_Bananera_2",
> 				// maxResolution: "auto",
> 				transparent: "true",
> 				format: "image/png"
> 							}
> 		);
> 
> 		objOpenLayers.addLayer( objMapServer18 );
> 
> 					var objMapServer19 = 
> new OpenLayers.Layer.MapServer(
> 			"Zona Bananera 1",
> 			"http://vesifront.org/cgi-bin/mapserv",
> 			{
> 				map: 
> "/home/jfalvarez/projects/cms/branches/V1/docroot/map-files/91
82340517c2d323061dc1cffea6e431.map",
> 				layers: "Zona_Bananera_1",
> 				// maxResolution: "auto",
> 				transparent: "true",
> 				format: "image/png"
> 							}
> 		);
> 
> 		if ( !objOpenLayers.getCenter() )
> 		{
> 			objOpenLayers.zoomToMaxExtent();
> 		}
> 	}
> 


More information about the mapserver-users mailing list