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

Arnd Wippermann arnd.wippermann at web.de
Thu Mar 13 14:20:03 EDT 2008


Hi Darrin,

from this WMS service you can only get images for fixed width and height and
for fixed BBOX values.

The adequate title for this service : NASA SVS Image Server

Example: 
http://svs.gsfc.nasa.gov/cgi-bin/wms?LAYERS=3193_21991&VERSION=1.3.0&FORMAT=
image%2Fpng&STYLES=opaque&BBOX=0,-90,-0.0001,90&CRS=CRS%3A84&SERVICE=WMS&REQ
UEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&WIDT
H=360&HEIGHT=180


Request for the GetCapabilities and have a look for the layer descriptions
http://svs.gsfc.nasa.gov/cgi-bin/wms?&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetC
apabilities


With the OL WMS Layer you can't request for fixed values. But perhaps you
can use OL IMAGE Layer to request for the images.

Mit freundlichen Grüssen

Arnd Wippermann
http://gis.ibbeck.de/




________________________________

Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von djs7743 at att.net
Gesendet: Mittwoch, 12. März 2008 22:45
An: users at openlayers.org
Betreff: [OpenLayers-Users] Not quite there, still get a (bigger) pink box


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&SER
VICE=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 <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' );
          &nbs p; 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
<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>
 
 




More information about the Users mailing list