FlexViewer, config.xml and GeoServer WMS

3895
4
Jump to solution
01-27-2012 03:49 AM
StephenHallett
New Contributor II
Hope someone can help. I am trying to get the FlexViewer (2.5) to use a wms feed from GeoServer (2.1.0) with no luck.
I am just trying to get one of the default GeoServer layers (tiger:tiger_roads) to show up

In the FlexViewer config.xml, an an operational layer I am trying:

<layer label="Tiger_Roads" type="wms" visible="true" alpha="0.6" skipgetcapabilities="true"
         crs="EPSG:4326" format="image/png" visiblelayers="tiger:tiger_roads"
         url="http://<server>:8080/geoserver/tiger/wms"/>

In Geoserver, the valid wms URL is
http://<server>:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=tiger:tiger_roads&styles=&bbox=-74.02722,40.684221,-73.907005,40.878178&width=317&height=512&srs=EPSG:4326&format=image/jpeg

Menu item appears, but with no data and 'zoom to layer' zooms out to whole world. Any help appreciated!
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
StephenHallett
New Contributor II
Dasa - thanks, I solved my problem - in the end the usual issue of projections!!

First, Charles Proxy & HttpFox are good suggestions. I actually used Chrome which has similar http traffic inspection tool (F12 -> Developer tools -> Resources/Network). Great for inspecting responses from wms requests. Using this I saw the bounding box coordinates were the problem (for FlexViewer they need to be in projected web-mercator not geographic wgs84). Changing the FlexViewer wkid as below solved problem.

<layer label="Tiger_Roads" type="wms" visible="true" skipgetcapabilities="true"
wkid="3857" format="image/png" visiblelayers="tiger:tiger_roads" version="1.1.0"
url="http://<server>:8080/geoserver/tiger/wms"/>

The other useful clue was in the forum discussion on projections here http://forums.esri.com/Thread.asp?c=93&f=984&t=288607

View solution in original post

0 Kudos
4 Replies
DasaPaddock
Esri Regular Contributor
0 Kudos
StephenHallett
New Contributor II
Dasa - thanks for your reply. Still no luck I'm afraid. Here is current, edited connection string:

<layer label="Tiger_Roads" type="wms" visible="true" skipgetcapabilities="true"
crs="EPSG:4326" format="image/png" visiblelayers="tiger:tiger_roads" version="1.1.0"
url="http://<server>:8080/geoserver/tiger/wms"/>

The Geoserver instance is on the same server as flexviewer to try to sidestep crossdomain issues. Geoserver is serving up wms data correctly using full url posted earlier. Is there any diagnostic I can use to see if FlexViewer is receiving anything?
0 Kudos
DasaPaddock
Esri Regular Contributor
Try a tool like Charles Proxy or HttpFox to see the HTTP request and response.
0 Kudos
StephenHallett
New Contributor II
Dasa - thanks, I solved my problem - in the end the usual issue of projections!!

First, Charles Proxy & HttpFox are good suggestions. I actually used Chrome which has similar http traffic inspection tool (F12 -> Developer tools -> Resources/Network). Great for inspecting responses from wms requests. Using this I saw the bounding box coordinates were the problem (for FlexViewer they need to be in projected web-mercator not geographic wgs84). Changing the FlexViewer wkid as below solved problem.

<layer label="Tiger_Roads" type="wms" visible="true" skipgetcapabilities="true"
wkid="3857" format="image/png" visiblelayers="tiger:tiger_roads" version="1.1.0"
url="http://<server>:8080/geoserver/tiger/wms"/>

The other useful clue was in the forum discussion on projections here http://forums.esri.com/Thread.asp?c=93&f=984&t=288607
0 Kudos