[OpenLayers-Users] A very simple application doesn't work

Dmitri Mizerkin eisberg at gmail.com
Wed Apr 4 09:53:07 EDT 2007


Hi!

I'm new to OpenLayers. I would like to build a simple application with a
single layer to decide how good the OpenLayers are, but have no luck.
For this purpose I use the source code posted on the first page of the
OpenLayers documentation and my application looks like that:

<html>
<head>
<script src="http://www.openlayers.org/api/OpenLayers.js"></script>
</head>
<body>
  <div style="width:100%; height:100%" id="map"></div>
  <script defer="defer" type="text/javascript">
    var map = new OpenLayers.Map('map');
    var wms2 = new OpenLayers.Layer.WMS("BGL Abschnitte", "
http://localhost:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/test/htdocs/test.map",
{layers: 'Flaeche'});
    map.addLayer(wms2);
    map.zoomToMaxExtent();
  </script>
</body>
</html>

The point is that the mapfile I use can be viewed with the MapServer (that
means typing
http://localhost:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/test/htdocs/test.map&layers=Flaeche&mode=mapinto
the address field of a browser causes the map to be shown with no
problem), but building it as a layer into an OpenLayers-application results
in an empty page. Could someone assume, what could be wrong? Are the
shapefiles not compatible with OpenLayers? Am I using a wrong layer-type?

Thanks in advance!

Dmitri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070404/ac1bfe78/attachment.html


More information about the Users mailing list