Select to view content in your preferred language

Displaying Tiled and Dynamic Service in flex app

848
4
11-29-2010 02:20 PM
JonGottsegen
Deactivated User
I've been having trouble getting a tiled and dynamic service to appear in a flex app. I did the trick of treating the tiled service as a dynamic one, and that worked, but it's not optimal since it loses the benefit of caching. The tiled and dynamic services are the same spatial reference (26913), but not the same extents. The tiled service has multiple layers.

In addition I changed the display order in the flex app, so the tiled service is listed first and shows up under the dynamic service. This works, but the extents seem all out of whack. According to the information when I look at the services catalog, the extent is XMin: 110306.01101, YMin: 4075302.785275, XMax: 786318.43799, YMax: 4569188.437425. However, when I use these parameters as the extent in the flex app, it makes the maximum extent one small portion of the area I'm interested in. This happens even if I don't enter an extent explicitly. It's sort of like the tiled service is on a different coordinate system than what it says in the services catalog...

After poking around a bit, I realize the max extent that shows up when I list the tiled service first is consistent with the smallest map scale at which I've cached the service. So if I want to use a cached service in my app, can I force the extent to be much larger than the extent displayed at the largest (smallest map scale) cache level?

Last, I'd like the tiled service to display on top of the dynamic service. I don't know if this is possible.

Any help in treating the tiled service as tiled and displaying it with a dynamic service would be appreciated.
Tags (2)
0 Kudos
4 Replies
Venkata_RaoTammineni
Regular Contributor
hi
 
  Please find the below code

<?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:mx="library://ns.adobe.com/flex/mx"
               xmlns:esri="http://www.esri.com/2008/ags"
               pageTitle="Combining dynamic maps and projected map tiles">

    <s:controlBarContent>
        <s:Label width="100%"
                 fontSize="14"
                 text="This map combines a street map (tiles) with a dynamic service showing census block points (blue markers)."/>
    </s:controlBarContent>

    <esri:Map>
        <esri:extent>
            <esri:WebMercatorExtent id="lowerManhatten"
                                    minlon="-74.03" minlat="40.70" maxlon="-73.99" maxlat="40.72"/>
        </esri:extent>
        <esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
        <esri:ArcGISDynamicMapServiceLayer url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer">
            <esri:visibleLayers>
                <s:ArrayCollection>
                    <fx:Number>0</fx:Number>
                    <!-- Show census block points only -->
                </s:ArrayCollection>
            </esri:visibleLayers>
        </esri:ArcGISDynamicMapServiceLayer>
    </esri:Map>
</s:Application>
0 Kudos
JonGottsegen
Deactivated User
Thanks for the response, but that doesn't get me what I want. I'm trying to display my cached and dynamic services with the tiled service on top of the dynamic service. It seems when I have the cached service after (on top) of the dynamic service it doesn't actually display.
0 Kudos
KenBuja
MVP Esteemed Contributor
What you could do is use Venka's example, but add the tiled service a second time after the dynamic service. Set the first tiled service's visibility to false. This first tiled service will set the LODs and scaling for the map and the second tiled service will be drawn over the dynamic layer.

<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" visible="false"/>
        <esri:ArcGISDynamicMapServiceLayer  url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer">
               <esri:visibleLayers>
                     <s:ArrayCollection>
                           <fx:Number>0</fx:Number>
                           <!-- Show census block points only -->
                     </s:ArrayCollection>
               </esri:visibleLayers>
        </esri:ArcGISDynamicMapServiceLayer>
<esri:ArcGISTiledMapServiceLayer  url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" visible="true"/>
0 Kudos
DasaPaddock
Esri Regular Contributor
0 Kudos