[OpenLayers-Users] Openlayers with mapserv

Eric Lemoine eric.c2c at gmail.com
Tue Aug 21 00:39:04 EDT 2007


Hi,

One comment below.

On 8/20/07, James McManus McManus <jmpmcmanus at yahoo.com> wrote:
> 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} );

I know this has nothing to do w/ your problem, but you might want to know this:

isBaseLayer should be specified in the fourth argument, along with
tileSize and buffer. Also, transparent:true and isBaseLayer:true are
contradictory - transparent layers are always overlays.

Cheers,

--
Eric



More information about the Users mailing list