[OpenLayers-Users] WMS servers/Brititish National Grid and Projection issues

Eric Lemoine eric.c2c at gmail.com
Tue Jul 15 12:09:35 EDT 2008


Hi Dave. Two notes (most probably un-relevant to your problem, sorry):
the srs WMS param isn't necessary, nor is the bounds arg to
zoomToMaxExtent. Cheers. Eric

2008/7/15, Dave Potts <dave.potts at pinan.co.uk>:
> Hi
>
> I am trying to view a shape file from a GeoServer(Release 1.64) WMs
> server,  I can access the shapeview via udig, and Geoserver generates a
> lot of logging messages describing the access attempt.
>
> But if I attempt to access the same view via openlayer request, a
> Javascript bounds error is reported( at line 1915, bounds=
> getCenterLonLat). The shapefile uses the British Natonal Grid (EPSG 27700).
>
> The stops if I remove the Zoom to Max Extent request
>
> Openlayer correctly draws the conrols.
>
> I belive that I correctly set the bounds object correctly for the Brtish
> national grid.
>
> What ever I do, no  access attempt is reported by the WMS server
> implying that openlayers never makes a WMS request.
>
>
> Has anybody any Idea what I am doing incorrectly?
>
> DAVE
> ------------------------------------------
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> <html>
> <head>
> <style type="text/css">
> #map {
> width:500px;
> height:250px;
> border: 1px solid black;
> }
> </style>
> <script src="js/lib/OpenLayers.js"> </script>
> <script type="text/javascript">
>
> var uk;
>
> function init(){
>            // create base map, set to BNG
>            var map = new OpenLayers.Map('map',{
>
>
>                    maxExtent: new OpenLayers.Bounds(0,0,5000000,6000000),
>                units: 'meters',
>                    maxResolution: 'auto',
>                projection: 'EPSG:27700' });
>
>
>         // access wms server
>         uk = new OpenLayers.Layer.WMS("Kent WMS
> layer","http://localhost:8080/geoserver/wms?"
>                          ,{
>                                 layers: 'kentc:kent_boundry' ,
>                                 src: 'EPSG:27700' } );
>         map.addLayers(uk);
>         map.zoomToMaxExtent(new OpenLayers.Bounds(0,0,5000000,6000000));
>
>         //  aDD controls
>         map.addControl( new OpenLayers.Control.LayerSwitcher());
>         map.addControl( new OpenLayers.Control.MousePosition());
>
>
> }
> </script>
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
> <title>Hello world</title>
> </head>
> <body onload="init()">
> <div id="map"></div>
> A mapping example program blah blah
> </body>
> </html>
>
>
>



More information about the Users mailing list