[OpenLayers-Users] Not quite there, still get a (bigger) pink box

djs7743 at att.net djs7743 at att.net
Wed Mar 12 17:45:25 EDT 2008


Thanks to Christian, I made some progress, but the following program still does not work. I've figured out Firebug enough that I think the problem is with the url that gets constructed. It comes across as:

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

For some reason my BBOX is getting changed from what I set it to in the program (via OpenLayers.Bounds). Any suggestions?

-Darrin

<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: 644px;
            height: 289px;
            border: 1px solid black;
        }
    </style>
    <script src="../lib/OpenLayers.js"></script>
    <script type="text/javascript">
        var map, layer, bounds;
        function init(){
            map = new OpenLayers.Map( 'map' );
            map.tileSize = (new OpenLayers.Size(644,289));
    
            bounds = new OpenLayers.Bounds(-180,-90,180,90);
            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', 
            styles: "opaque",
            bbox: bounds,
            crs: 'CRS:84'});

            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>
-------------- next part --------------
Skipped content of type multipart/related


More information about the Users mailing list