Problem while adding WMS and ArcIMS service in Flex 2.1 . Was working fine in Flex 1.

1019
0
11-26-2010 10:46 AM
nidhiarora
New Contributor
We need to dynamically add  WMS and ArcIMS service in Flex Viewer. The code was working fine in 1.3 . 



Using  following code:

if ( cbNewServices.selectedItem == "ArcGIS Map Service")
    {
     // Add the layer
     var dynlayer:ArcGISDynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer(serviceUrl.text);
     dynlayer.name = NameTxt.text;
     dynlayer.id = NameTxt.text;
     dynlayer.visible = true;
     dynlayer.alpha = 1;    
     map.addLayer(dynlayer);      
    }
    else if ( cbNewServices.selectedItem == "ArcIMS Service")
    {
     // Add IMS
     var imslayer:ArcIMSMapServiceLayer = new ArcIMSMapServiceLayer(serviceUrl.text, serviceName.text);
     imslayer.id = NameTxt.text;
     imslayer.name = NameTxt.text;
     imslayer.visible = true;
     imslayer.alpha = 1;
     map.addLayer(imslayer);
    }
    else if ( cbNewServices.selectedItem == "WMS Service")
    {
     // Add WMS
     var wmslayer:WMSLayer;
     wmslayer = new WMSLayer();
     wmslayer.url = serviceUrl.text;
     wmslayer.proxyURL =  configData.proxyUrl;
     wmslayer.id =  NameTxt.text;
     wmslayer.name = NameTxt.text;
     wmslayer.visible = true;
     wmslayer.alpha = 1; 
     map.addLayer(wmslayer);    
    }

We are  using this code to add the services dynamically using the widget. We are  facing the problems in the above (using the flex api 2.1):

�?� Adding the ArcGIS map service 9.3/10.0 is working fine.

�?� While adding the ArcIMS layer:
o serviceHost = http://www.geographynetwork.com;
o serviceName = Census_Population
can see the layers being added in the TOC containing all the sub layers. But nothing get displayed on the screen.

�?� While adding WMS layer :
o url = http://rmgsc.cr.usgs.gov/arcgis/services/nhss_haz/MapServer/WMSServer?request=GetCapabilities&servic...
can see the layer in the TOC, but no sub layers appear and neither they got displayed on the map.




Thanks in anticipation of your help
Tags (2)
0 Kudos
0 Replies