Select to view content in your preferred language

how to clean featurelayer local cached features

2585
1
06-06-2012 07:09 PM
HongTang
Deactivated User
I am using ArcGIS server 10 with Flex to display a very large point feature class on the web.

I am using featurelayer with definition query and cluster symbols.

The query and display works well for the first one or two operation. However, it is getting slower and slower to display the features on the map.

I guess even I removed the  unused featurelayer  from map, the features are still in the local browser's cache.

So, my question is how can I clear the featurelayer cached feature when the featurelayer is removed from the map.

i also turned off the cache option. flayer.disableClientCaching = true; and use the onDemand mode.

here is the code:

querystring = "( STRIKEDATETIME between to_date('" + fromdate + "', 'YYYY-MM-DD HH24:MI:SS' ) AND to_date('" + todate + "', 'YYYY-MM-DD HH24:MI:SS' )) AND POLARITYIND LIKE '%" + polarity + "%'"
    flayer.definitionExpression = querystring;
      // flayer.id ="Lightning" + i.toString();
    flayer.name = "Lightning" + i.toString();
    flayer.mode = "onDemand";
    flayer.outFields =[];
    flayer.disableClientCaching = true;


Also, from the map.layers, how can I know what is the type of the layer (e.g, i want to know if the layer is featurelayer or general dynamic map layer).

is there a way to generate a layer as output image on the server side and transfer the whole image to the client side?

Thanks very much. I do have a lot of questions to deal with large set data over the internet.
0 Kudos
1 Reply
BjornSvensson
Esri Regular Contributor
So, my question is how can I clear the featurelayer cached feature when the featurelayer is removed from the map.

i also turned off the cache option. flayer.disableClientCaching = true;


"disableClientCaching" is meant to "disable client caching" so this should work. From the FeatureLayer API Reference:
"If true, adds a timestamp parameter ("_ts") to the REST request to prevent the request from being loaded from the browser's cache."
Can you use httpfox/fiddler/charles and see what http response you are getting for your request?

is there a way to generate a layer as output image on the server side and transfer the whole image to the client side?


Yes, using ArcGISDynamicMapServiceLayer will help with this.  The image gets created on the server instead of sending down all the features to the client.  Note that clustering only works with clientside features (featurelayer and graphicslayer), but not if the server is creating the image for you.
0 Kudos