betsyjsg

Adding WMS layer from a non-Esri WMS server

Discussion created by betsyjsg on Dec 19, 2012
Latest reply on May 22, 2014 by jeff.pace
Has anyone had any success adding a layer from a non-esri wms server?  I have no trouble adding a wms layers via the WMSLayer command if the WMS server being accessed is an ArcGIS server.  For example, I can add the rivers layer from http://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer by doing the following:
  var layer1 = new esri.layers.WMSLayerInfo({name:"1",title:"Rivers"});
  var resourceInfo = { extent: new esri.geometry.Extent(-126.40869140625,31.025390625,-109.66552734375,41.5283203125,{wkid: 4326}), layerInfos: [layer1] };
  var lyr = new esri.layers.WMSLayer("http://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer",{resourceInfo:resourceInfo, visibleLayers: ["1"]});
  map.addLayer(lyr);

But if I try to add a layer from non-esri WMS server, I get nothing.  For example, I tried adding a layer from a USGS WMS server - (http://mrdata.usgs.gov/services/porcu?request=getCapabilities&service=wms):
  var layer1 = new esri.layers.WMSLayerInfo({name:"porcu",title:"porcu"});
  var resourceInfo = { extent: new esri.geometry.Extent(-179,-89,179,89,{wkid: 4326}), layerInfos: [layer1] };
  var lyr = new esri.layers.WMSLayer("http://mrdata.usgs.gov/services/porcu",{resourceInfo:resourceInfo, visibleLayers: ["porcu"] });
  map.addLayer(lyr);

Has anyone else had this issue?

Outcomes