Re: [mapserver-users] WMS Server problem

2010-03-24 Thread Lars Lingner
Tony Baylis schrieb:
> Hi guys,
> 
> Apologies for adding another question related to a similar previous post but
> I too am having problems getting MapServer to serve a WMS layer.  At this
> stage I can't get a GetCapabilities (it wants to download the mapserv file)
> or Mode=map to work via the browser. I have been able to get the layer to
> render correctly using openLayers in WMS mode however.
> 

The mapserv file is actually the response. If you save it and open it in
an text editor you can view the content.

The MapServer FAQ has also an entry to this question:
http://mapserver.org/faq.html#when-i-do-a-getcapabilities-why-does-my-browser-want-to-download-mapserv-exe-mapserv

Lars
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] WMS Server problem

2010-03-24 Thread Tony Baylis
Hi guys,

Apologies for adding another question related to a similar previous post but
I too am having problems getting MapServer to serve a WMS layer.  At this
stage I can't get a GetCapabilities (it wants to download the mapserv file)
or Mode=map to work via the browser. I have been able to get the layer to
render correctly using openLayers in WMS mode however.

Below is my basic mapfile and openLayers file.  Note I have stripped most of
the styling out of the mapfile.

Tony

MAPFILE

MAP
  NAME "Roads250k"
  SIZE 800 500
  STATUS ON
  EXTENT 140 -23.25 150 -17
  UNITS DD
  SYMBOLSET "/var/www/remwms/htdocs/includes/symbols.sym"
  FONTSET "/usr/share/fonts/truetype/font.list"
  SHAPEPATH "/var/www/rem_openlayers/Data/"
  DEBUG 2
  CONFIG "MS_ERRORFILE" "/var/www/ms_tmp/ms_error.txt"

  OUTPUTFORMAT
  NAME "AGGA"
  MIMETYPE "image/png"
  DRIVER "AGG/PNG"
  EXTENSION "png"
  IMAGEMODE RGBA
  TRANSPARENT ON
  END

  PROJECTION
  "init=epsg:4283"
  END

  WEB
  IMAGEPATH "/var/www/ms_tmp/"
  IMAGEURL "http://mapserver1/ms_tmp/";
  METADATA
"wms_version" "1.1.1"
"wms_title" "Geography250k"
"wms_onlineresource" "
http://mapserver1/cgi-bin/mapserv?map=/var/www/rem_openlayers/roads250k.map&;
"
"wms_srs" "EPSG:4283 EPSG:4326"
  END
  END

  LAYER
  NAME "Roads_250k"
  GROUP "Geography"
  EXTENT 140 -23.25 150 -17
  CONNECTIONTYPE postgis
  CONNECTION "host=localhost port=5432 dbname=ga_250k user=postgres
password=postgres"
  DATA  "wkb_geometry FROM topo250k_majorroads using unique ogc_fid
using srid=4283"
  METADATA
  "wms_title" "roads250k"
  "wms_group_title" "Geography"
  END
   PROJECTION
  "init=epsg:4283"
  END
  TYPE LINE
  DUMP TRUE
  STATUS ON
  CLASS
  COLOR 255 64 64
  END
  END

END

OPENLAYERS

http://www.w3.org/1999/xhtml";>
  
Open Layers MapServer
  
#map {
width: 800px;
height: 550px;
border: 3px solid black;
}


  http://www.openlayers.org/api/OpenLayers.js";>
  

var lon = 147;
var lat = -20;
var zoom = 6;
  var map;
  var layer;
  var gsat = new OpenLayers.Layer.Google(
"Google Earth",
{type: G_HYBRID_MAP, numZoomLevels: 30}
);
  var qld_epm = new OpenLayers.Layer.WMS( "Current EPM's",
  "
http://atlas.information.qld.gov.au/ArcGIS/services/IRTM/MapServer/WMSServer
?",
  {isBaseLayer:false, transparent:true, layers: "56"} );

  var mapserver_wms = new OpenLayers.Layer.WMS ( "Geography 250k",
  "
http://mapserver1/cgi-bin/mapserv?map=/var/www/rem_openlayers/roads250k.map
",
  {layers: "roads250k", isBaseLayer:false,
transparent:true} );
function init(){
map = new OpenLayers.Map( 'map', {

  controls: [
  new OpenLayers.Control.LayerSwitcher( {title: "Layer
Control"} ),
  new OpenLayers.Control.Navigation(),
  new OpenLayers.Control.ScaleLine(),
  new OpenLayers.Control.MousePosition(),
  new OpenLayers.Control.PanZoomBar( {title: "Navigation
Bar"} )]
});
map.addLayers([gsat,qld_epm,mapserver_wms]);
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
}


  
  

  

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users