[OpenLayers-Users] A very simple application doesn't work
Stephen Woodbridge
woodbri at swoodbridge.com
Wed Apr 4 10:09:49 EDT 2007
Dmitri,
Is your mapfile set up to serve WMS layers?
If NOT, then you probably want to use Layer.Mapserver or
Layer.Mapserver.Untiled instead of Layer.WMS
The Untiled, option will require you to use OL 2.4-RC1
-Steve W
Dmitri Mizerkin wrote:
> 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
> <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=map
> <http://localhost:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/test/htdocs/test.map&layers=Flaeche&mode=map>
> into 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
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
More information about the Users
mailing list