Select to view content in your preferred language

WMS and TMS Layers in Flex viewer?

1273
5
02-18-2012 06:22 AM
PawelGajewski
Emerging Contributor
I have a question and I will be greatful for help.

Using ArcGIS flex viewer 2.5 how can i publish my own multiple wms services in that viewer.

For example my layers will come in
2180  ETRS_1989_Poland_CS92

From geoserver, map server, or TMS service from tilecache.

I would like them to display as base layers, or operational (without ArcGIS online layers because they can not be projected)

I would be very greatful for a simple conf sample of "how to connect WMS and TMS services from geoserver etc."

Ps. Can i connect this WMS? : http://wms.hgis.cartoninjas.net/?source=wig2180&map=wigAllnsr or http://sdi.geoportal.gov.pl/wms_dzkat/wmservice.aspx

Is there a simple way to connect any WMS server in same projection?
Tags (2)
0 Kudos
5 Replies
PawelGajewski
Emerging Contributor
Currently my code for my wms layers is:

<map wkid="4326" units="{Units.FEET}" esrilogovisible="true" openhandcursorvisible="true" scalebarvisible="true" zoomslidervisible="false" wraparound180="true" initialextent="14.122885 49.002025 24.145893 54.835812" top="40">
        <basemaps>
            <layer type="wms" label="Test1" url="http://localhost:8080/geoserver/Pl/wms" visible="true"/>
            <layer type="wms" label="Test2" url="http://localhost:8080/geoserver/Pl/wms?" visible="true"/>
          
  </basemaps>
        <operationallayers>
            <layer type="kml" label="Wrotków" alpha="0.61" url="https://sites.google.com/site/geoinformacjagajewski/Dzialki%20we%20wladaniu%20G%20i%20L.kml" visible="true"/>
            <layer type="kml" label="GlebyWawolnica" url="https://sites.google.com/site/geoinformacjagajewski/GlebyWawolnica.kml" visible="true"/>
   <layer type="wms" label="Imagery with Labels" url="http://localhost:8080/geoserver/Pl/wms" visible="true"/>
        </operationallayers>
    </map>


WMS layer is local Geoserver WMS service running. I don't get any error or anything, WMS is not visible. Only two KML's
0 Kudos
BjornSvensson
Esri Regular Contributor
Hi Pawel,
Ps. Can i connect this WMS? : http://wms.hgis.cartoninjas.net/?source=wig2180&map=wigAllnsr or http://sdi.geoportal.gov.pl/wms_dzkat/wmservice.aspx


You need to specify the service names as well.  What are your service ("SERVICE") names?  For example, trying to get the capabilities (to find out supported projections as well as its layers), I tried something like:
http://wms.hgis.cartoninjas.net/?source=wig2180&map=wigAllnsr&REQUEST=GetCapabilities
http://sdi.geoportal.gov.pl/wms_dzkat/wmservice.aspx?request=GetCapabilities

Note 1: These two servers do not have crossdomain.xml files, so you will need to set skipgetcapabilities to true.

Note 2: By default WMS do not show any layers, so you need to use the visiblelayers property to list them (based on the layer names)

Tip: Ask the WMS to return its exceptions using "EXCEPTIONS=INIMAGE". This often provides useful information (assuming the server supports it), if for example you specify an incorrect layer name.

For example:
<layer type="wms" 
       label="WMS example"
       visiblelayers="0,1"
       url="http://sampleserver1.arcgisonline.com/arcgis/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer?EXCEPTIONS=INIMAGE" 
       visible="true"/>
0 Kudos
PawelGajewski
Emerging Contributor
Thanks for the tips. But still no luck.

I'm trying this WMS addres: http://sdi.geoportal.gov.pl/wms_prg/wmservice.aspx

It does not have a crossdomain for sure. It's in WGS1984 EPSG:4326 , given extent is in decimal degrees for area of Poland.

Code is below:

<map wkid="4326" units="{Units.DECIMAL_DEGREES}" esrilogovisible="true" openhandcursorvisible="true" scalebarvisible="true" zoomslidervisible="false" wraparound180="true" initialextent="14.122885 49.002025 24.145893 54.835812" top="40">
        <basemaps>
            <layer type="wms" label="WMS example" skipgetcapabilities="true" visiblelayers="1,3,11,Wojewodztwa" url="http://sdi.geoportal.gov.pl/wms_prg/wmservice.aspx" visible="true"/>
        </basemaps>
        <operationallayers>
            <layer type="kml" label="Wrotków" alpha="0.61" url="https://sites.google.com/site/geoinformacjagajewski/Dzialki%20we%20wladaniu%20G%20i%20L.kml" visible="true"/>
            <layer type="kml" label="GlebyWawolnica" url="https://sites.google.com/site/geoinformacjagajewski/GlebyWawolnica.kml" visible="true"/>
   <layer type="wms" label="WMS example2" skipgetcapabilities="true" visiblelayers="1,3,11,Wojewodztwa" url="http://sdi.geoportal.gov.pl/wms_prg/wmservice.aspx" visible="true"/>
        </operationallayers>
    </map>



As an attachment you have all layers in this WMS.


Paul.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Paul,

   You are confusing layer ids with layer names.

This works fine:

    <map wkid="4326" units="{Units.DECIMAL_DEGREES}" esrilogovisible="true" openhandcursorvisible="true" scalebarvisible="true" zoomslidervisible="false" wraparound180="true" initialextent="14.122885 49.002025 24.145893 54.835812" top="40">
        <basemaps>
            <layer type="wms" label="WMS example" version="1.3.0" skipgetcapabilities="true" visiblelayers="Gminy,Nazwa_wojewodztwa,Nazwa_powiatu,Nazwa_gminy,Powiaty,Wojewodztwa"
                   url="http://sdi.geoportal.gov.pl/wms_prg/wmservice.aspx" visible="true"/>
        </basemaps>
        <operationallayers>
            <layer type="kml" label="Wrotków" alpha="0.61" url="https://sites.google.com/site/geoinformacjagajewski/Dzialki%20we%20wladaniu%20G%20i%20L.kml" visible="true"/>
            <layer type="kml" label="GlebyWawolnica" url="https://sites.google.com/site/geoinformacjagajewski/GlebyWawolnica.kml" visible="true"/>
        </operationallayers>
    </map>


Don't forget to click the Mark as answer check and to click the top arrow (promote) as shown below:
0 Kudos
PawelGajewski
Emerging Contributor
That's true. Thank you for your help and regards from Polish University of Marie Curie-Sk�?odowska in Lublin.
0 Kudos