[OpenLayers-Users] Openlayers with mapserv
James McManus
jmpmcmanus at yahoo.com
Mon Aug 20 18:13:52 EDT 2007
I made both those changes, but did not get an image. I had
transparent:"true" which I got from an example. This seemed strange so I
changed it to false. I now get the level selection menu and pink tiles,
but no image. There are no errors in my error_log, but my access_log
shows that I am issuing the mapserver command. However, I am not
generating a png image in the cache (tmp) directory. If I use this
mapfile outside of OpenLayers I produce a png, so permissions to that
directory for apache is okay. Does OpenLayers use use IMAGEPATH in the
mapfile to try and find the png image? It seems like an error message
would be produced, say the image can not be found.
Jim
Christopher Schmidt wrote:
> On Mon, Aug 20, 2007 at 05:13:47PM -0400, Paul Spencer wrote:
>
>> James,
>>
>> I think your units might need to be lower case ('dd') and your
>> maxResolution is missing a decimal after the 1 (it should be 1.46095).
>>
>
> The former wouldn't actually matter (scale, by default, is the only
> thing affected by units) but the latter definitely would.
>
> -- Chris
>
>
>
>> Cheers
>>
>> Paul
>>
>> On 20-Aug-07, at 4:12 PM, James McManus McManus 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} );
>>> 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>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at openlayers.org
>>> http://openlayers.org/mailman/listinfo/users
>>>
>> +-----------------------------------------------------------------+
>> |Paul Spencer pspencer at dmsolutions.ca |
>> +-----------------------------------------------------------------+
>> |Chief Technology Officer |
>> |DM Solutions Group Inc http://www.dmsolutions.ca/ |
>> +-----------------------------------------------------------------+
>>
>>
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>>
>
>
More information about the Users
mailing list