Select to view content in your preferred language

Define Cache area.  v.10

899
2
07-30-2010 06:54 AM
AlexProtyagov
Emerging Contributor
I am new to esri. Maybe someone could tell me how on a mobile device define what map area (I guess that is what they call extent) should be cached. Ideally we need
  1. Query (if possible) the ArgGIS server (ver.10) for a route.

  2. Base on the query result set area of the map that we need to download.

  3. Download and store map that contains the route to a cache on device for off-line use.

Currently I have code to download and store map:

ServiceConn.Url = @"http://192.168.244.9/ArcGIS/services/tt/MapServer/MobileServer";
_cache.DeleteCache( );
ServiceConn.CreateCache( _cache );
_cache.Open( );                    
MobileCacheSyncAgent agent = new MobileCacheSyncAgent( _cache, ServiceConn );
agent.DownloadExtent( _cache.GetInitialExtent( ), 0, 0 );
map.MapLayers.AddRange( _cache );


However, I do not know how to define area. The _cache.GetInitialExtent() or _cache.GetExtent() give me the same result always. How do I define boundaries of a map that needs to be pulled?
0 Kudos
2 Replies
MaximilianGlas
Esri Contributor
I don't know 10 yet, but with 9.3 the InitialExtent and the FullExtent (or like it named here: Extent) depends on the settings of the map document. It is fixed in the document and normally will not change.

What you are looking for is an individual extent. You have to create an envelope (which contains your area) and to give this as parameter instead of the InitialExtent.

Storing should be no problem, thats the point of mobile map caches. The only thing is to NOT delete the map cache when no update is running.
0 Kudos
AlexProtyagov
Emerging Contributor
I don't know 10 yet, but with 9.3 the InitialExtent and the FullExtent (or like it named here: Extent) depends on the settings of the map document. It is fixed in the document and normally will not change. 


You right, I noticed that. InitialExtent and Full Extent are set on the server. That is fine I think.


What you are looking for is an individual extent. You have to create an envelope (which contains your area) and to give this as parameter instead of the InitialExtent. 

Storing should be no problem, thats the point of mobile map caches. The only thing is to NOT delete the map cache when no update is running.


That is what I want to do, - setup an envelop and then pull the data. However, to setup the envelop I have to know what should be inluded. For example, I need a map of road with all of the signs along the road. The signs could be a layer that contains Point objects. So, I have to make an envelop that contains all of those signs. However, I do not know how to run a query, I used QueryFilter object, to query those layers on the server and only after, based on the query result, make an envelop that should be used in the DownloadExtent function.
0 Kudos