Update the cache associated with the layer according to the given extent, between the from-scale to the target-scale and according to the update-mode.
[Visual Basic .NET] Public Sub Update ( _ ByVal Extent As IEnvelope, _ ByVal fromMapScale As Double, _ ByVal targetMapScale As Double, _ ByVal updateMode As esriMapCacheUpdateMode _ )
[C#] public void Update ( IEnvelope Extent, double fromMapScale, double targetMapScale, esriMapCacheUpdateMode updateMode );
[C++]
HRESULT Update(
IEnvelope* Extent,
double fromMapScale,
double targetMapScale,
esriMapCacheUpdateMode updateMode
);
[C++]Parameters
Extent [in]Extent is a parameter of type IEnvelope
fromMapScale [in] fromMapScale is a parameter of type double targetMapScale [in] targetMapScale is a parameter of type double updateMode [in]updateMode is a parameter of type esriMapCacheUpdateMode
Product Availability
Remarks
Passing a null extent will result in update of the cache for the entire layer extent, according to the layer’s area of interest.
Normally, the values for both fromMapScale and targetMapScale are set to greater than zero. In case of extreme values such as zero or less, the following behaviors are expected:
- If fromMapScale value is less or equal to zero, all scales up to targetMapScale will get updated.
- If targetMapScale value is less or equal to zero, all scales starting from the fromMapScale value will get udated.
- If both fromMapScale and targetMapScale values are less or equal to zero, all the caches possible scales will be updated.
The updateMode is to replace missing tiles, overwrite outdated tiles, or delete tiles for a given layer within a given extent and scale reange. There are three modes of operation:
- esriMapCacheUpdateRecreateAll -- all tiles, including existing tiles, will be replaced. Use this mode when updating the entire cche or generating entire cache from scratch.
- esriMapCacheUpdateRecreateMissing -- Only tiles that are missing will be created. Use this mode when the cache extent has changed so that new tiles will be added to the new area. Existing tiles will be left unchanged.
- esriMapCacheUpdateDelete -- All tiles will be deleted.
The following C# code shows how to update the cache associated with the layer, for the entire layer’s area of interest, for all scales up to the current map scale, and updating only missing tiles. It assumes that you already have a valid Map Control. Please note that you must initialize the cache manager with the given map and layer in order to use any methods and properties on IDynamicCacheLayerManager interface.
IMap map = axMapControl1.Map;
IDynamicCacheLayerManager dynamicCacheLayerManager = new DynamicCacheLayerManagerClass();
ILayer layer = map.get_Layer(0);
if (layer is IDynamicLayer) {return ;}
dynamicCacheLayerManager.Init(map, layer);
dynamicCacheLayerManager.Update(layer.AreaOfInterest, 0, map.MapScale, esriMapCacheUpdateMode.esriMapCacheUpdateRecreateMissing);
The following code shows how to update the cache associated with the layer, for the entire layer’s area of interest, for all scales up to the current map scale, and updating only missing tiles. It assumes that you already have a valid Map Control. Please note that you must initialize the cache manager with the given map and layer in order to use any methods and properties on IDynamicCacheLayerManager interface.
Dim map As axMapControl1.Map
Dim dynamicCacheLayerManager As IDynamicCacheLayerManager = New DynamicCacheLayerManagerClass()
Dim layer As ILayer = map.Layer(0)
If (TypeOf layer is IDynamicLayer) Then
Return
End If
dynamicCacheLayerManager.Init(map, layer)
dynamicCacheLayerManager.Update(layer.AreaOfInterest, 0, map.MapScale, esriMapCacheUpdateMode.esriMapCacheUpdateRecreateMissing)