Flex Viewer cached map services resolution different than JavaScript Viewer

1645
17
08-09-2012 10:49 AM
MeadeTurner
New Contributor
Can someone please let me know if there should be a consistent display of cached map services between the JavaScript Viewer vs. the Flex Viewer.  I have created a cached map service and the quality degrades substantially when viewing the same map service in the Flex viewer (3.0) vs. the JavaScript viewer.  Any thoughts on this would be much appreciated.

Thanks!
Tags (2)
0 Kudos
17 Replies
MehrshadNourani
New Contributor III
Robert,
Clarification: I still have the "dynamic" vs "tiled" issue where I cannot view the cached layers (5 layers are fused) as "tiled"; the cached service is viewable only when the Flex Viewer is set to "dynamic". Thank you again for your time and advice!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Mehrshad,

   Well that explains the difference in the resolution then... For you to be able to use the layer as a tiled layer than it will have to be cached at the same LODs and Spatial reference as the other cached layers you are using in the map.
0 Kudos
MeadeTurner
New Contributor
One option I explored to see if this is a caching problem vs. a Flexviewer problem was to make a simple Flex app and pull in the map service.  I did this and the map service draws perfectly just as it does in the Javascript API and the ArcGIS Online map.  Here is the code I wrote below.  So, could there be something behind the scene that the Flexviewer is doing that cannot be explained?

Simple Flex program that displays the local tiled map service and an ESRI basemap. 

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:esri="http://www.esri.com/2008/ags"
      pageTitle="A tiled map service">

<esri:Map>
  <esri:ArcGISTiledMapServiceLayer url="http://webapps.did.census.gov:8399/arcgis/rest/services/Pop/04_NHW_p_point_chg/MapServer"/>
  <esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>
</esri:Map>

</s:Application>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Meade,

  Can you provide a screen shot of the quality difference you are seeing?
0 Kudos
MeadeTurner
New Contributor
Robert,

Attached is the comparison image when viewing the map service in the Flex Viewer 3.0 vs. viewing in the map service Javascript API.  The only way I can get the tiled map service to draw in the Flex viewer is to set the layer type to "dynamic" and that is when the image looks degraded.  If I switch to "titled" layer type the service does not render at ALL!

To test the map service will render properly I made a simple Flex api as I mentioned in my previous reply and it draws just fine.  This leads me to believe that there is some conflict within the Flex viewer.  My $0.02.
0 Kudos
DasaPaddock
Esri Regular Contributor
Meade,

Were you able to try any of my suggestions from post #6 above?
0 Kudos
MeadeTurner
New Contributor
Dasa,

Finally got the resolution to come out as it should!!!  The combination that ultimately fixed the issue was to set the layer type="dynamic" (even though the service is cached) and I added imageformat="png32".  If I switch type to tiled the service does not show up.  So I am going to stick with this configuration because it works and I don't know what else to try.

Thank you for you assistance!!!
0 Kudos
MehrshadNourani
New Contributor III
Dasa,

I echo Meade's thanks as well. I used the same approach and was able to resolve the resolution issue. Thanks, again for your support. This forum is a FANTASTIC resource!
0 Kudos