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

Dmitri Mizerkin eisberg at gmail.com
Wed Apr 4 11:12:44 EDT 2007


Hi Steve,

I assume it is working with the Layer/Mapserver class, only that the site is
still empty. I looked at the address of the map in the the properties window
- the part of it that as I suspect prevents it from working is the
mapextent, which is set to -180 -90 180 270 (initial maximum extent).
Setting up the extent via OpenLayers didn't bring any success neither over

var wms2 = new OpenLayers.Layer.MapServer("BGL Abschnitte", "
http://localhost:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/test/htdocs/test.map",
{mode: 'map', layers: 'Flaeche', mapext: '2574985.815002 5646323.449916
2587295.900005 5655021.169988'});

nor over

var bounds = new OpenLayers.Bounds(2574985.815002, 5646323.449916,
2587295.900005, 5655021.169988);
map.zoomToExtent(bounds);

Could there be still something I'm doing wrong?

Cheers,
Dmitri

On 4/4/07, Stephen Woodbridge < woodbri at swoodbridge.com> wrote:
>
> 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
>
>


-- 
Gruß,
Dmitri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070404/6b665646/attachment.html


More information about the Users mailing list