Select to view content in your preferred language

API 2  vs. 2.4 - Really weird problem with switching tiled map services

684
5
11-02-2011 11:50 AM
CarmenDurham
Frequent Contributor
Hello all,

We have quite a few Flex (non SFV and SFV) apps that switch between an ESRI streetmap to our imagery at certain scales that work fine. 

Was working on a new application and decided to use some features in 2.4 api.  Have gotten pretty far writing the application when I noticed a quirk when it switched from streetmap to our imagery.

At the point when it switches to the imagery (or vice versa), the graphics scale, but the tiled map service will not rescale until I pan just a little.  Only affected when switching between the two.

After hours of trying to figure out WHAT I could have altered in the code to affect this, it boiled down to the 2.0 API and the 2.4 API.

You can view the difference in the links below where I have stripped the code down to mostly just 2 tiled map services (both web mercator) and the graphic of the City/County.  The only difference between the two is the API being used:

2.0 API: look at this first so you know what it should look like.  Look at the cloverleaf interstate interchange at the far right of the non-hatched area for comparison.  Zoom in and out just so the photo turns on and off.  Works beautifully.
http://gis.greenvillesc.gov/TestAPI2/

2.4API:  Do the same here and notice the tiled map service will not scale accordingly until you pan just a little (try zooming in and out a few times to really see):
http://gis.greenvillesc.gov/TestAPI24/

Built in FB 4.0 with SDK 4.0 and using Flash Player 10.2.152.32

Anyone have any idea what could be causing this?

Thanks,
Carmen
Tags (2)
0 Kudos
5 Replies
IanWatkins
Emerging Contributor
Hi Carmen,

I cannot say why this is happening, but can confirm it is doing so.

Safari browser on Mac, running Flash Player 10,2,161,22

Cheers

Ian
0 Kudos
CarmenDurham
Frequent Contributor
Thanks for trying and letting me know you see the same thing!

I have tried it at home with the latest version of Flash Player with the same results.  It is bad!  I can't use 2.4 API with this issue, but my code relies on 2.4 for some features.  Surely someone else has run into this if it is a bug?  I hope it is something I have done, but cannot figure out what.

Anyone from ESRI tried the two links?

If I don't hear by Friday, will submit to technical support. 

Thanks,
Carmen
0 Kudos
CarmenDurham
Frequent Contributor
I submitted to Tech Support and it is a bug. Their response:

I appreciate your patience with this issue. After further analysis, it appears that the error 984141 is a bug. I was able to reproduce it at my end with a sample code. I have logged it in with development for further research and clarification. You can reference this bug using [#NIM075577 Scaling issue for the tiles when switching between ESRI StreetMap and ESRI Imagery Map.

Thank you for bringing this issue to our attention. I have marked this issue as a medium priority issue.
(in my case, I was switching from the ESRI StreetMap to the City's Orthos - both tiled mapservices)

For me, it is a high priority issue. Since the tiled mapservice will scale correctly after "just panning a tiny little bit", anyone know how I can do this programmatically without it repeatedly calling the "extentChange" event? Have asked Tech support this question also.

Thanks,
Carmen
0 Kudos
DasaPaddock
Esri Regular Contributor
This bug should be fixed in the 2.5 release.

This bug has to do with changing the visible property of the tiled layer in the extentChange event handler. An alternative to doing this is to just use the minScale and maxScale properties available on Layer.

<?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">

    <esri:Map>
        <esri:extent>
            <esri:Extent xmin="-9208569" ymin="4109241" xmax="-9138323" ymax="4152198">
                <esri:SpatialReference wkid="102100"/>
            </esri:Extent>
        </esri:extent>
        <esri:ArcGISTiledMapServiceLayer id="tile_layer"
                                         maxScale="37000"
                                         url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
        <esri:ArcGISTiledMapServiceLayer id="image_layer"
                                         minScale="37000"
                                         url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"/>
    </esri:Map>

</s:Application>
0 Kudos
CarmenDurham
Frequent Contributor
Dasa,

Yes, we were using the visibility property within an extent change handler b/c we have lots of other stuff being changed at different scales. 

Thank you for the obvious alternative!  Well, it was obvious once you pointed it out.  Sometimes one (ie. me) can't see the forest for the trees.  Works fine in our application now.

Carmen
0 Kudos