ESRI.ArcGIS.ADF.Web.UI.WebControls
Refresh Method
See Also  Example
ESRI.ArcGIS.ADF.Web.UI.WebControls Namespace > Map Class : Refresh Method




Method to call when you need to redraw all the tiles in the Map control.

Syntax

Visual Basic (Declaration) 
Public Overrides Sub Refresh() 
Visual Basic (Usage)Copy Code
Dim instance As Map
 
instance.Refresh()
C# 
public override void Refresh()

Example

This code refreshes just the first map resource if the Map control uses browser blending. Otherwise, it refreshes the entire Map, since Web tier blending requires the server to refresh all map tiles.
C#Copy Code
if (Map1.ImageBlendingMode == 

    ESRI.ArcGIS.ADF.Web.UI.WebControls.ImageBlendingMode.Browser) 

         

    Map1.RefreshResource(MapResourceManager1.ResourceItems[0].Name); 

         

else 

  

    Map1.Refresh(); 

    
Visual BasicCopy Code
If Map1.ImageBlendingMode = _

    ESRI.ArcGIS.ADF.Web.UI.WebControls.ImageBlendingMode.Browser Then



    Map1.RefreshResource(MapResourceManager1.ResourceItems(0).Name)



Else



    Map1.Refresh()



End If

Remarks

This method refreshes the tiles for all resources (services). You need to refresh the map if you make a change to it, such as changing layer visibility or adding graphics to the map.

If you have only one resource (service) in the Map, this method has the same effect as RefreshResource for that resource.

When your map has multiple resources

If the MapResourceManager associated with your Map has more than one resource (service), it can often be more efficient to use RefreshResource to refresh an individual resource, rather than to use Refresh. If you make a change to just one resource, you can refresh just that resource. This may save considerable time and resources on both server and browser.

This applies also when using GraphicLayers in the Map/MapResourceManager. For example, if you create a custom tool that adds graphics to the Map, you can add the graphics to the GraphicsLayer resource, and then refresh just that resource. The background map need not be refreshed at that point.

Of course, if you make a change that affects all resources, you should do a full Refresh. For example, if you set the Map.Extent so that the scale changes, the browser must retrieve new tiles for all resources. You should call Refresh in this case.

Refreshing individual resources only works with ImageBlendingMode set to Browser. If that property is set to WebTier, you must use Refresh, since the server combines images for all resources and sends a single image to the browser.

See Also

© 2010 All Rights Reserved.