[OpenLayers-Users] Openlayers with mapserv

James McManus McManus jmpmcmanus at yahoo.com
Mon Aug 20 16:12:21 EDT 2007


I am attempting to use OpenLayers with mapserver. I have been able to bring up the OL zoom and directional buttons, but my maps are not appearing. Somethings is incorrect in how I am trying to access mapserver and the mapfile. However, I am not getting any server errors. The same mapfile works outside of OpenLayers. When I configured mapserver, I specified --with-wmsclient. Is there something else I have to do to setup mapserver or the mapfile, so It can be access through OpenLayers? Below is my html file:

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <style type="text/css">
    v\:* {
      behavior:url(#default#VML);
    }
    </style>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <script src="lib/OpenLayers.js"></script>
  </head>
  <body>
    <div id="map" style="width: 400px; height: 400px"></div>
    <script defer="defer" type="text/javascript">
       var map = new OpenLayers.Map( 'map', {'projection':'EPSG:4326', 'units':'DD',
                     'maxExtent': new OpenLayers.Bounds(-68.50, 44.117, -68.00, 44.615),
                     'maxResolution': 146095 } );
       var wmsurl =  "http://www.aratasystems.com/cgi-bin/mapserv?map=\\mapdata\\MDI.map&"
       var wmsmdi = new OpenLayers.Layer.WMS( "MDI", wmsurl, 
                    {layers: "DEM30,ponds,streams,roads", transparent:"true",format: "image/png"},
                    {tileSize: new OpenLayers.Size(400, 400), buffer: 1 },
                    {'isBaseLayer':true} );
       map.addLayer(wmsmdi);

       var MDI = new OpenLayers.LonLat(-68.5, 44.63);
       map.setCenter(MDI, 3);
       map.addControl(new OpenLayers.Control.LayerSwitcher());
    </script>
  </body>
</html>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070820/01a3828f/attachment.html


More information about the Users mailing list