Select to view content in your preferred language

Adding a WMS Layer to ArcGIS Viewer for Flex

4630
4
Jump to solution
01-18-2012 04:15 PM
ShaunWeston
Frequent Contributor
For some reason I can't add an WMS layer to a Flex Viewer. I have this in the config file:

<layer label="NRCan"
    type="wms"
    skipgetcapabilities="true"
    url="http://mapping.gw.govt.nz/ArcGIS/services/GW/Our_Environment_P/MapServer/WMSServer"
    visible="true"
    visiblelayers="limits"
/>

However nothing shows?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Shaun,

   I am not sure where you got the layer name of "limits" from? If you add this url: http://mapping.gw.govt.nz/ArcGIS/services/GW/Our_Environment_P/MapServer/WMSServer?request=GetCapabi...
to ArcCatalog using the GIS Servers and then Add WMS Server and then click get layers you can then click on individual layers (not groups) and find their names and that is what has to be listed in the visiblelayers attribute.


<layer label="NRCan" type="wms" skipgetcapabilities="true" version="1.3.0" wkid="102100"                    url="http://mapping.gw.govt.nz/ArcGIS/services/GW/Our_Environment_P/MapServer/WMSServer"                    visible="true" visiblelayers="33,34,35,36,37,38,39,40"/>


Don't forget to click the top arrow (promote) and to click the Mark as answer check as shown below:

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Shaun,

   I am not sure where you got the layer name of "limits" from? If you add this url: http://mapping.gw.govt.nz/ArcGIS/services/GW/Our_Environment_P/MapServer/WMSServer?request=GetCapabi...
to ArcCatalog using the GIS Servers and then Add WMS Server and then click get layers you can then click on individual layers (not groups) and find their names and that is what has to be listed in the visiblelayers attribute.


<layer label="NRCan" type="wms" skipgetcapabilities="true" version="1.3.0" wkid="102100"                    url="http://mapping.gw.govt.nz/ArcGIS/services/GW/Our_Environment_P/MapServer/WMSServer"                    visible="true" visiblelayers="33,34,35,36,37,38,39,40"/>


Don't forget to click the top arrow (promote) and to click the Mark as answer check as shown below:
0 Kudos
ShaunWeston
Frequent Contributor
Oh ha I was getting that "limits" from an example, but I see how that works now, thanks heaps.
0 Kudos
JodiLuostarinen
Occasional Contributor
I was able to get wms layer to display in flex sample viewer, as follows:

<layer label="OpenStreetMap"
     type="wms"
     visible="true"
     skipgetcapabilities="true"
     version="1.1.1"
        url="http://maps.opengeo.org/geoserver/ows?"
       visiblelayers="countries"
        wkid="3857">
   </layer>
0 Kudos
mattijnvan_hoek
Emerging Contributor
If I copy the code from you guys I get the following:
For the code of Jodi Luostarinen:
I go to http://localhost/flexviewer/ and I get the error: 'A problem occurred while parsing the configuration file config.xml Error#1090'.

I've checked the url in ArcCatalog (Add WMS Server) and it works, but there it mentions the name of the layer as 'osm:countries'. Tried that as well, same error.

For the code of Robert Scheitlin (mapping.gw.govt.nz etc..)
I go to http://localhost/flexviewer/ and it will show the flexviewer, if I go to 'More..' I can see the layer, but when I click 'Zoom to'. It zooms out to full extent and further nothing.

I tried to add a layer from GeoServer via http://localhost:8080/geoserver/wms?, (got visiblelayers="tiger:giant_polygon", from WMS Service Properties in ArcCatalog) but also no luck. What ever I try it is or Error#1090 or it zooms out to full extent by clicking 'Zoom to'.

I even desperately add a crossdomain.xml in my webroot folder eventhough I use the tag skipgetcapabilities.

My last thought: do I need to use a live server instead of localhost?
0 Kudos