ArcGIS Viewer for Flex and Geoserver

3661
3
07-28-2014 10:13 AM
RicardoSilva
New Contributor

Hi everybody,
I'm developing a thesis on WebGIS and I'm building some Web Map Applications to show the results.


I'm manipulating all the data in ArcGIS Desktop and I have experience with ArcGIS Server and ArcGIS Viewer for Flex. The thing is that know I don't have access to the university's ArcGIS Server and I'm developing everything on localhost, through GeoServer. The GeoServer is up and running, but I don't know how to add it to ArcGIS Viewer for Flex (3.6), something that is aggravated by the fact that I don’t know too much about .xml. I searched a lot, including here in GeoNet, and some people say it’s easier to add it in the config.xml, but I’m looking for more recent and simpler answers.


So, first, I want to know if it is possible to add the GeoServer service, for instance WMS, directly in ArcGIS Viewer for Flex interface. Secondly, where can I find the GeoServer link to a specific service, for example like adding ArcGIS Server operational layer in ArcGIS Viewer for Flex: http://server/arcgis/rest/services... ? I tried to connect through http://localhost:8080/geoserver/web http://localhost:8080/geoserver or even with the Service Capabilities from GeoServer and I tried everything in this thread https://community.esri.com/thread/44313 with no success. The maximum I got was ArcGIS Viewer for Flex asking me the GeoServer credentials…
Finally, if what I’m asking is not possible, then, I would like to know how to add a service from GeoServer in ArcGIS Viewer for Flex.

 

 

Thank you in advance,

 

Ricardo Silva

Tags (1)
0 Kudos
3 Replies
AnthonyGiles
Frequent Contributor II

Ricardo,

It is definitely possible to add a wms from geo server to the flex viewer.  You will probably have to do it by manually amending the xml file, you will add the layer as a wms layer type by adding the following:

<layer label="roads" type="wms" visible="true" skipgetcapabilities="true"
wkid="4326" format="image/png" visiblelayers="roads" version="1.1.1"
url="http://localhost:8080/geoserver/wms"/>

The visible layers tags needs to include the exact layer names of the layers you want to add

0 Kudos
RicardoSilva
New Contributor

Hi Anthony,

Thanks for the quick answer. I had already try what you suggest and tried it again with no positive results. It must be something related with my config.xml because everything is working with GeoServer. I even had a WMS Server to ArcCatalog and I can see and manipulate the WMS layer in ArcGIS. So, check my config please, because I don't understand much about .xml:

<?xml version="1.0"?>

<configuration>

     <title>SMAS LOURES</title>

     <logo>assets/images/logo.png</logo>

     <style>

          <colors>0xcee7f4,0x39628c,0x355d89,0x294867,0xcee7f4</colors>

          <alpha>0.8</alpha>

          <font name="Verdana"/>

          <titlefont name="Verdana"/>

          <subtitlefont name="Verdana"/>

     </style>

     <!-- replace the following url with your own geometryservice -->

     <geometryservice url="https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer"/>      <subtitle>Sistema de Gestão de Resíduos Sólidos Urbanos</subtitle>

     <widget url="widgets/Navigation/NavigationWidget.swf" top="50" left="10" config="widgets/Navigation/NavigationWidget.xml"/>

     <widget url="widgets/OverviewMap/OverviewMapWidget.swf" config="widgets/OverviewMap/OverviewMapWidget.xml" bottom="0" right="0"/>

     <widget url="widgets/MapSwitcher/MapSwitcherWidget.swf" top="55" config="widgets/MapSwitcher/MapSwitcherWidget.xml" right="20"/>

     <widget url="widgets/HeaderController/HeaderControllerWidget.swf" top="0" left="0" config="widgets/HeaderController/HeaderControllerWidget.xml"/>

     <map top="40" portalurl="https://www.arcgis.com/" wkid="102100" initialextent="-1065101.4568858757 4682867.22433295 -973759.2080852132 4719709.8719663555" addarcgisbasemaps="true" wraparound180="true" zoomslidervisible="false" scalebar="metric" scalebarvisible="true" openhandcursorvisible="false" esrilogovisible="false" attributionvisible="false">

          <operationallayers>

               <layer url="http://localhost:8080/geoserver/wms" wkid="3857" version="1.1.1" visiblelayers="teste" format="image/png" skipgetcapabilities="true" visible="true" type="wms" label="teste"/>

          </operationallayers>

     </map>

     <widgetcontainer layout="float"/>

     <widgetcontainer initialstate="open" paneltype="bottom">

          <widget url="widgets/AttributeTable/AttributeTableWidget.swf" config="widgets/AttributeTable/AttributeTableWidget.xml" label="Tabela de Atributos" icon="assets/images/TableOpen32.png"/>

     </widgetcontainer>

</configuration>

I tried

<layer label="teste" type="wms" visible="true" skipgetcapabilities="true"
wkid="3857" format="image/png" visiblelayers="teste" version="1.1.1"
url="http://localhost:8080/geoserver/wms"/>

but it keeps changing it to what is on the top, everytime I close ArcGIS Viewer for Flex. And instead of "teste" as layer name I tried "Aquifero" too.

Here is my service:

Capture2.PNG

And here is the result:

Capture.PNG

Thanks a lot. I really need this to end my Master.

0 Kudos
AnthonyGiles
Frequent Contributor II

Ricardo,

try typing http://localhost:8080/geoserver/wms?request=getcapabilities in your browser this should provide the capabilities for the wms, in here you will see the layer name you will need to use. It maybe be teste:Aquifero

you will not see any attributes in your attribute table as this is not supported for wms layers

0 Kudos