[OpenLayers-Users] What's wrong with this program?

Christian López Espínola penyaskito at gmail.com
Tue Mar 11 21:23:01 EDT 2008


Hi Darrin,

The WMS url that is being built is:
http://svs.gsfc.nasa.gov/cgi-bin/wms?LAYERS=3338_24550&VERSION=1.3.0&FORMAT=image%2Fpng&WIDTH=256&HEIGHT=256&STYLES=opaque&CRS=CRS%3A84&BBOX=-180,-90,180,270&SERVICE=WMS&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326

If you put that in your browser, you'll get an XML describing the error.


PS: See http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#HowcanIseetheURLstringthatOpenLayersissendingtoaWMSserver

On Wed, Mar 12, 2008 at 12:28 AM,  <djs7743 at att.net> wrote:
> Can anyone tell me what's wrong with the following simple OL program? All I get is a solid pink box. Starting with the "lite" example on OL.org, all I've done is replace the WMS with a different one.
>
>  I'm pretty sure all my OpenLayers.Layers.WMS params are correct, at least conceptually, because typing the following url into my browser brings up a nice image.
>
>  http://svs.gsfc.nasa.gov/cgi-bin/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=3338_24550&FORMAT=image/png&WIDTH=644&HEIGHT=289&CRS=CRS:84&BBOX=-180,-90,180,90&STYLES=
>
>  I'm guessing I might be botching the syntax to OpenLayers.Layers.WMS. Or maybe I need to do something with the size of the image that I don't realize I need to do?
>
>  Any help would be much appreciated. As you can probably tell, I'm a complete newbie at this.
>
>  Thanks,
>  Darrin
>
>  -------Program Follows------------
>
>  <html xmlns="http://www.w3.org/1999/xhtml">
>   <head>
>         <title>OpenLayers Basic Single WMS Example</title>
>     <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
>     <style type="text/css">
>         #map {
>             width: 512px;
>             height: 512px;
>             border: 1px solid black;
>         }
>     </style>
>     <script src="../lib/OpenLayers.js"></script>
>     <script type="text/javascript">
>         var map, layer;
>         function init(){
>             map = new OpenLayers.Map( 'map' );
>
>             // different layer added here by DJS, used to be
>
>             layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
>                         "http://svs.gsfc.nasa.gov/cgi-bin/wms?",
>                         {layers: '3338_24550',
>                         VERSION: "1.3.0",
>                         format: "image/png",
>                         width: 644, height: 289,
>                         styles: "opaque",
>                             crs: "CRS:84", bbox: "-180,-90,180,90"});
>
>             map.addLayer(layer);
>             map.zoomToMaxExtent();
>         }
>     </script>
>   </head>
>   <body onload="init()">
>         <h1 id="title">Basic Single WMS Example</h1>
>
>         <div id="tags"></div>
>
>         <div id="shortdesc">Show a Simple Map</div>
>
>          <div id="map"></div>
>
>         <div id="docs">
>                 This example shows a very simple layout with minimal controls.  This example uses a single WMS base layer.
>         </div>
>   </body>
>  </html>
>
>  _______________________________________________
>  Users mailing list
>  Users at openlayers.org
>  http://openlayers.org/mailman/listinfo/users
>



-- 
Regards,

Christian López Espínola


More information about the Users mailing list