1

I am trying to add a WMS radar overlay to my map but it won't seem to gather it.

  noaaRdr = new OpenLayers.Layer.WMS("Latest Radar", "http://nowcoast.noaa.gov/wms/com.esri.wms.Esrimap/obs?", {
    layers: 'RAS_RIDGE_NEXRAD',
    transparent: true,
    format: 'image/png'
  }, {
    visibility: true, isBaseLayer: false, singleTile: true,
    ratio: 1,opacity: 0.7
  });


  radarArray = [noaaRdr];     //adding more layers later..
  map.addLayers(radarArray);

I have seen this URL used elsewhere but i can't figure out whats wrong. The layer shows up in the layer switcher but the image never shows on the map and the file "obs" never gets requested from the NOAA server ??

Can anyone help me with this.

8
  • Can you use something like Fiddler to see what requests are being sent out by OpenLayers? I can't see anything wrong with your code so it might help to see what request is being sent by OpenLayers and what response you are getting from the server.
    – CHenderson
    Jul 26, 2012 at 22:41
  • I am developing from a Mac so that is not really an option for me. Is their a mac equivalent ??
    – MB.
    Jul 26, 2012 at 23:37
  • The closest equivalent that I am aware of is Wireshark - http:// www.wireshark.org
    – CHenderson
    Jul 27, 2012 at 0:46
  • For debuggin in Mac you can use development tools: developer.apple.com/technologies/safari/developer-tools.html
    – drnextgis
    Jul 27, 2012 at 3:15
  • @MB. have you solved your problem?
    – drnextgis
    Jul 27, 2012 at 4:30

1 Answer 1

4

Here is working code:

options = {
    div: "map",
    zoom: 5,
    center: [-10796366.372312, 4426748.6429884],
    layers: [
        new OpenLayers.Layer.OSM()
    ],
    projection: "EPSG:3857"
};
map = new OpenLayers.Map(options);

var noaaRdr = new OpenLayers.Layer.WMS(
    "Latest Radar",
    "http://nowcoast.noaa.gov/wms/com.esri.wms.Esrimap/obs?",
    {
        layers: 'RAS_RIDGE_NEXRAD',
        transparent: true
    },
    {
        isBaseLayer: false,
        singleTile: true,
        opacity: 0.7
    }
);

map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addLayer(noaaRdr);

Live example HERE.

6
  • 1
    Another example ian01.geog.psu.edu/geoserver/www/maps/jessica-groups.html
    – Ian Turton
    Jul 27, 2012 at 13:16
  • that example doesn't show radar for me....
    – MB.
    Jul 28, 2012 at 0:04
  • doesn't work using firefox either ??
    – MB.
    Jul 28, 2012 at 0:07
  • Ok So downloaded the latest version of openLayers 2-12 and deleted all the previous files from my website and added the new just in case it was related to that no fix. one difference is that the projection you are using is projection: "EPSG:3857" could it be that ???
    – MB.
    Jul 31, 2012 at 16:15
  • From GetCapabilities response: nowcoast.noaa.gov/wms/com.esri.wms.Esrimap/… you can see that WMS server supports only 3857 and 4326 projections, not 900913, so using EPSG:3857 is mandatory.
    – drnextgis
    Aug 1, 2012 at 0:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.