Gets or sets a property indicating if the map's legend should be drawn when the map is drawn.
Syntax
Visual Basic (Declaration) | |
---|
Public Property RefreshLegend As Boolean |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As MapView
Dim value As Boolean
instance.RefreshLegend = value
value = instance.RefreshLegend |
C# | |
---|
public bool RefreshLegend {get; set;} |
Example
The following example sets the legend to redraw when the map draws, then draws the map and displays both map and legend in image controls. The example assumes an existing MapView.
C# | Copy Code |
---|
// Set legend to redraw when map draws
mapView.RefreshLegend = true;
// Set legend size to match image control (note this may cut off legend)
mapView.Legend.Height = Convert.ToInt32(imgLegend.Height.Value);
mapView.Legend.Width = Convert.ToInt32(imgLegend.Width.Value);
// Draw the map, which draws the legend
imgMap.ImageUrl = mapView.Draw().Url;
// Display the legend just drawn
imgLegend.ImageUrl = mapView.Legend.Image.Url; |
Visual Basic | Copy Code |
---|
' Set legend To redraw When map draws
mapView.RefreshLegend = True
' Set legend size To match image control (note this may cut off legend)
mapView.Legend.Height = Convert.ToInt32(imgLegend.Height.Value)
mapView.Legend.Width = Convert.ToInt32(imgLegend.Width.Value)
' Draw the map, which draws the legend
imgMap.ImageUrl = mapView.Draw().Url
' Display the legend just drawn
imgLegend.ImageUrl = mapView.Legend.Image.Url |
Remarks
Requirements
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family
See Also