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.