Select to view content in your preferred language

Problem using WMS service in Flex Viewer 2.1

4452
16
09-28-2010 12:34 PM
PaulHeinrich
Emerging Contributor
Hello,

I'm trying to use the Arizona Geologic Survey geologic map service in a Flex Viewer project.  The service is a WMS service.  When I add it as a operational layer it does not display.  I'm wondering if there is a problem with the service or the way in which I'm referencing it?

Here's the service link..

http://services.azgs.az.gov/arcgis/services/OneGeology/AZGS_Arizona_Geology/MapServer/WMSServer

Here's the web site for the service.. http://www.azgs.state.az.us/services_azgeomap.shtml

and here's my tag from my Flex Viewer project..

<layer label="Arizona Geology" type="dynamic" visible="false" alpha="1" url="http://services.azgs.az.gov/arcgis/services/OneGeology/AZGS_Arizona_Geology/MapServer/WMSServer"/>

cheers,  Paul
Tags (2)
0 Kudos
16 Replies
AdrianComan1
Emerging Contributor
Hi All,

Please give me clear instructions to add map services to flexviewer 2.1; I whant to add in <operationallayers>...</operationallayers> a wms service that connect to geoserver 2.0.2, something like:

<layer label="Map2" type="dynamic" visible="true" alpha="1" url="http:localhost:8080/geoserver/wms"/>

or

<mapservice label="map2" type="wms" visible="true" alpha="1"  format="image/png" layer="map2" format_options="antialias:none" crs="EPSG:900913"  icon="com/esri/solutions/flexviewer/assets/images/icons/i_shuttle.png">http://localhost:8080/geoserver/wms?</mapservice> ---this was for flex 1.3 and its working, but i whant to use 2.1;

Please tell me what file i have to modify, to add wms service to work;


Thank you
0 Kudos
LukePecoraro
Emerging Contributor
I have the same question as adrian.  specifically, I am trying to see if I can get layers from this WMS service to show up in 2.2 as an operational layer.

http://donmeltz.dyndns.org:8080/geoserver/wms?service=wms&version=1.1.1&request=GetCapabilities

I tried but can't seem to get anything to display.  Any help on this would be appreciated.  This is what I currently have:

  [HTML]          <layer label="Counties"
                   type="wms"
                   imageformat="openlayers"
                   visible="false"
                   visiblelayers="StockportWatershed:CountyBoundaries"
                   url="http://donmeltz.dyndns.org:8080/geoserver/wms?service=wms&version=1.1.1&request=GetCapabilities"
                   skipgetcapabilities="true"
                   version="1.1.1"/>[/HTML]

Thanks,
Eric
0 Kudos
DasaPaddock
Esri Regular Contributor
Eric,

The url should not include the service, version or request parameters. You could configure it more like this:

<layer label="Counties"
                   type="wms"
                   visible="false"
                   visiblelayers="StockportWatershed:CountyBoundaries"
                   url="http://donmeltz.dyndns.org:8080/geoserver/wms"
                   skipgetcapabilities="true"
                   version="1.1.1"/>


If you try adding this to the default config.xml it still won't work though because the server returns this error "Error occurred decoding the espg code EPSG:102100". You can see this if you use a tool like HttpFox or Fiddler.

This error means that the service doesn't support the 102100 spatial reference (SR). The capabilities show that it does support the equivalent SR of 900913 as well as 4326 and 2260. In the next release you'll be able to configure the layer to use it's own SR instead of using the map's SR so then you could set it to use 900913.

In the current 2.2 release you'll need to change your map to only use 4326 or 2260 layers if you want to use this WMS service.
0 Kudos
JonFisher
Emerging Contributor
I thought that visiblelayers had to use the numeric format (e.g. visiblelayers="0,1,2" to show the first three layers, identified as queryable=1, etc.). Not so?
0 Kudos
DasaPaddock
Esri Regular Contributor
Jon,

WMS uses strings for layer names instead of numbers.
0 Kudos
JonFisher
Emerging Contributor
Jon,

WMS uses strings for layer names instead of numbers.


Strange, at least for consuming ArcGIS Server map services in the WMS format, when I use visiblelayers="0,1,2" it works for me in FlexViewer 2.2. Maybe WMS from other servers wouldn't work that way though.
0 Kudos
DasaPaddock
Esri Regular Contributor
Yes, the names of the Layers in an ArcGIS Server WMS service are still numbers.

e.g.

http://sampleserver1.arcgisonline.com/arcgis/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServe...

Has:
<Name>0</Name>
0 Kudos