Select to view content in your preferred language

WMS layer in flex viewer 2.5

572
5
12-07-2012 06:12 AM
MickaelVADIN
New Contributor
I try to connect to WMS http://cartorisque.prim.net/wms/67? in flex viewer 2.5. Here is the code in config.xml file :

<layer label = "Cartorisque WMS 67" type = "wms" visible = "false" alpha = "1" wkid = "2154" skipgetcapabilities = "true" visiblelayers = "ALEA_INONDATION_SYNTHESE,ALEA_SEISME_SYNTHESE" version = "1.3.0"
url = "http://cartorisque.prim.net/wms/67?">
</ layer>

The projection of my Basemaps are EPSG:3948, but the WMS server only supports EPSG:2154.

But it does not work. I get an crossdomain.xml error on the WMS server (seen in Fiddler). I thought the argument skipgetcapabilities = "true" allowed around it.

Thank you in advance.

Sasha Weber
Tags (2)
0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus
Sasha,

   The WMS Service has:

Supported SRS:
EPSG:2154, EPSG:4326, EPSG:27582

And you map is in EPSG:3948 then this layer is not going to work for you as WMS service do not get reprojected to your maps WKID. You would have to move your map into one of the WMS supported SRSs.

I can get the WMS to show up fine when I put the Maps WKID in 4326 (one of the WMS layers supported SRS).

    <map wraparound180="true" initialextent="-5.524470 41.275700 10.699800 51.090200" top="40" addarcgisbasemaps="false">
        <basemaps>
            <layer label="Streets" type="tiled" visible="true"
                   url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
        </basemaps>
        <operationallayers>
            <layer label="Cartorisque WMS 67" type="wms" visible="false" alpha="1"
                skipgetcapabilities="true" version="1.1.0"
                visiblelayers="ALEA_SEISME_SYNTHESE,ALEA_SEISME_SYNTHESE" 
                url="http://cartorisque.prim.net/wms/67?" />
        </operationallayers>
    </map>
0 Kudos
MickaelVADIN
New Contributor
Thanks for your response.

This actually works when I reproject my layers in a projection supported by the WMS (with attribute 'wkid' in Map tag)
Two questions:
- I have cached Basemaps in EPSG: 3948 (non supported by WMS server). How can I ask to Arcgis server to reproject the tiles in EPSG: 2154 supported by WMS server ?
- I visualize WMS layers, but I dont access details of the layers in the widget LayerList. The user is therefore not possible to show or disable layers. I think this is the argument skipgetcapabilities = "true". How to get around this?

Thank you in advance

Sacha
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Sacha,

- I have cached Basemaps in EPSG: 3948 (non supported by WMS server).  How can I ask to Arcgis server to reproject the tiles in EPSG: 2154  supported by WMS server ?
Cached map services can not be reprojected. The whole point in cached/tiled map services is that it builds thousands of images that make up the map at different scales. Raster reprojection is very slow and that is why you are not given the option.

- I visualize WMS layers, but I dont access details of the layers in the  widget LayerList. The user is therefore not possible to show or disable  layers. I think this is the argument skipgetcapabilities = "true". How  to get around this?

Your WMS layer should definitely appear in the layer list widget (the main WMS layer). The sub layer in the WMS layer will not though.

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

0 Kudos
MattGiles
New Contributor
Hi Robert,

Sorry for posting in Flex Viewer section, but I noticed this thread was still unanswered so i figured i'd give you a second chance to get the points you deserve from it!

I am using Tom Hills TOC from ArcScripts that was written for Flex API, which the Flex Viewer Layer List widget seems to be based on. I am looking to adapt my TOC to show WMS sublayers in a tree similar to the way dynamic layers appear. I am wondering if you know why this is not supported in Flex Viewer, and if its worth me attempting, or if its simply not possible due to wms functionality.

Thanks!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Matt,

   Yes the LayerList widget did start off way back when using the toc component from Tom Hill, but it is has been altered quite a bit. I don't use WMS at all on my end so I can not give much guidence to you on them (besides the basics of how to add them to the viewer).
0 Kudos