Configuring a WMS as an Operational Layer in the Flex Viewer (v2.5)

2776
1
05-10-2012 10:35 AM
deleted-user-iTiq4MAkIxq6
New Contributor
This is a general cry for help. I have been through the Esri help documentation, the Esri forums, Adobe forums, etc...shoot, I even have an open ticket with Esri Support on this, but they apparently don't know how either.

I can find no complete sample code for adding a WMS as an operational layer in the Flex Viewer (v 2.5). I've tried to apply what I've read in the forums, but no dice. I'm really looking for a good source for a full example of the structure of the operational layer tag when using a WMS.

The WMS I'm trying to add can be found at the following location:  http://activefiremaps.fs.fed.us/wms.php?op=wms&service=conus&wms=2010-wms

I use that WMS frequently in ArcMap through ArcCatalog, but it eludes me as to how I can add it to a flex viewer app.

Thanks in advance for any help,

Eric
Tags (2)
0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus
Eric,

    Flex Viewer and/or Widget Questions belong in the Flex Viewer Forum and not here in the Flex API forum:

Flex Viewer forum:
http://forums.arcgis.com/forums/111-ArcGIS-Viewer-for-Flex

Here is the complete main config.xml for viewing that wms service. You need to be aware that the service is in EPSG:4269  and thus is not going to work with esri tiled basemaps, so I made streetmap dynamic.

<?xml version="1.0" ?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
// Read more about ArcGIS Viewer for Flex - http://links.esri.com/flexviewer
//
////////////////////////////////////////////////////////////////////////////////
-->
<configuration>
    <title>ArcGIS Viewer for Flex</title>
    <subtitle>a configurable web mapping application</subtitle>
    <logo>assets/images/logo.png</logo>
    <style>
        <colors>0xFFFFFF,0x333333,0x101010,0x000000,0xFFD700</colors>
        <alpha>0.8</alpha>
    </style>
    <!-- replace the following url with your own geometryservice -->
    <geometryservice url="http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer" />

    <!-- UI elements -->
    <widget left="10"  top="50"    config="widgets/Navigation/NavigationWidget.xml" url="widgets/Navigation/NavigationWidget.swf"/>
    <widget right="-2" bottom="-2" config="widgets/OverviewMap/OverviewMapWidget.xml" url="widgets/OverviewMap/OverviewMapWidget.swf"/>
    <widget right="20" top="55"    config="widgets/MapSwitcher/MapSwitcherWidget.xml" url="widgets/MapSwitcher/MapSwitcherWidget.swf"/>
    <widget left="0"   top="0"     config="widgets/HeaderController/HeaderControllerWidget.xml" url="widgets/HeaderController/HeaderControllerWidget.swf"/>

    <map wraparound180="true" top="40" wkid="4269" units="{Units.DECIMAL_DEGREES}" initialextent="-125.000000 24.650000 -66.800000 49.500000">
        <basemaps>
             <layer label="Streets" type="dynamic" visible="true"  alpha="1" imageformat="jpg" dpi="96"
                   url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
        </basemaps>
        <operationallayers>
            <layer label="Current MODIS Fire Detection Locations" type="wms"
                skipgetcapabilities="true"
                url="http://activefiremaps.fs.fed.us/cgi-bin/mapserv.exe?map=conus.map&amp;SERVICE=WMS"
                version="1.1.1"
                visible="true"
                visiblelayers="Current Large incidents,Cities,Capital Cities,Roads,Last 6 hour fire detections,Last 12 hour fire detections,Last 24 hour fire detections,Cumulative Fire Detections"/>
        </operationallayers>
    </map>

    <!-- widgets organized into widget containers that manage close/open etc -->
    <!-- supported layout property options: horizontal(default)|float|vertical|fix-->
    <widgetcontainer layout="float">
    </widgetcontainer>
</configuration>


Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:
0 Kudos