[mapserver-users] WMS Server problem
Tony Baylis
baylis.tony at gmail.com
Wed Mar 24 15:51:42 PDT 2010
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
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Open Layers MapServer</title>
<style type="text/css">
#map {
width: 800px;
height: 550px;
border: 3px solid black;
}
</style>
<script src='
http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ
'></script>
<script src="http://www.openlayers.org/api/OpenLayers.js"></script>
<script type="text/javascript">
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);
}
</script>
</head>
<body onload="init()">
<div id="map"></div>
</body>
</html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100325/04ccea0a/attachment.htm>
More information about the MapServer-users
mailing list