Select to view content in your preferred language

How to get WMSLayer to work

723
3
12-08-2010 12:19 PM
RoyceSimpson
Frequent Contributor
Trying to get WMSLayer to work using the following mxml.  Does anyone have the trick?  In the console window I get this repeating message until I kill the session.
[SWF] /cgi-bin/wms/nexrad/n0r.cgi - 0 bytes after decompression

<esri:WMSLayer id="weatherMap" url="http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi" 
         visibleLayers="{new ArrayList(['nexrad-n0r'])}" />
Tags (2)
0 Kudos
3 Replies
Drew
by
Frequent Contributor
I tested your code and it seems to work for me..
Below is a sample using the agslib 2.1 with your WMS layer added.


<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
      xmlns:s="library://ns.adobe.com/flex/spark" 
      xmlns:esri="http://www.esri.com/2008/ags"
      xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
 <fx:Script>
  <![CDATA[
   import mx.collections.ArrayList;
  ]]>
 </fx:Script>
 <fx:Declarations>
  <!-- Place non-visual elements (e.g., services, value objects) here -->
 </fx:Declarations>
 
 
 <esri:Map id="map"  top="76" bottom="10" left="9" right="10">
  <esri:WMSLayer id="weatherMap" url="http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi" visibleLayers="{new ArrayList(['nexrad-n0r'])}" />
 </esri:Map>
 
</s:Application>



Drew
0 Kudos
DasaPaddock
Esri Regular Contributor
This works for me too:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:esri="http://www.esri.com/2008/ags">
    
    <esri:Map id="map">
        <esri:WMSLayer id="weatherMap" url="http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi">
            <esri:visibleLayers>
                <s:ArrayList>
                    <fx:String>nexrad-n0r</fx:String>
                </s:ArrayList>
            </esri:visibleLayers>
        </esri:WMSLayer>
    </esri:Map>

</s:Application>


Can you show more of your Map code like what is the base layer and what is the Map's extent and spatial reference?
0 Kudos
RoyceSimpson
Frequent Contributor
This works for me too:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:esri="http://www.esri.com/2008/ags">
    
    <esri:Map id="map">
        <esri:WMSLayer id="weatherMap" url="http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi">
            <esri:visibleLayers>
                <s:ArrayList>
                    <fx:String>nexrad-n0r</fx:String>
                </s:ArrayList>
            </esri:visibleLayers>
        </esri:WMSLayer>
    </esri:Map>

</s:Application>


Can you show more of your Map code like what is the base layer and what is the Map's extent and spatial reference?


I played my moron card for the day.  I forgot about ye old spatial reference.  Base layer is in state plane.  Thanks for your time guys.
0 Kudos