deleted-user-UKF_P8JO51q_

Trouble adding WMS layer (different projection than basemap) to map

Discussion created by deleted-user-UKF_P8JO51q_ on Jul 21, 2011
Hi,

I'm trying to add a WMS layer to a web map.  The WMS layer is in a different projection than the basemap and other data I want to use.  Below is a simplified version of my code.  Any suggestion for why I can't see the WMS layer? 

Many thanks!

function init() {

        var initExtent = new esri.geometry.Extent(-16034000, 2906000, -10233000, 6037000, new esri.SpatialReference({"wkid":102100}));
        map = new esri.Map("map",{extent:initExtent});
        dojo.connect(map, "onLoad", initFunctionality);
        var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer", {id:"baseMap"});


        var layer1 = new esri.layers.WMSLayerInfo({name:"3LIGHTS_point(LIGHTS)",title:"3_LIGHTS"});
        var layer2 = new esri.layers.WMSLayerInfo({name:"3SAFE WATER BUOY(BOYSAW)",title:"3_SAFE WATER BUOY"});
        var layer3 = new esri.layers.WMSLayerInfo({name:"3CARDINAL BUOY_point(BOYCAR)",title:"3_CARDINAL BUOY"});
        var layer4 = new esri.layers.WMSLayerInfo({name:"3LATERAL BUOY_point(BOYLAT)",title:"3_LATERAL BUOY"});
       
        var resourceInfo = {
          extent: esri.geometry.geographicToWebMercator(esri.geometry.Extent(-126,32,-117,43,{wkid: 4326})),
          layerInfos: [layer1,layer2,layer3,layer4],
          version: "1.1.1"
        };
        wmsLayer = new esri.layers.WMSLayer("http://ocs-spatial.ncd.noaa.gov:80/wmsconnector/com.esri.wms.Esrimap/encdirect_coastal?",
          {resourceInfo: resourceInfo,
          visibleLayer: ["3_LIGHTS","3_SAFE WATER BUOY","3_CARDINAL BUOY","3_LATERAL BUOY"]
          }
        );
        map.addLayers([wmsLayer]);





  }

Outcomes