ArcGIS Runtime SDK for WPF - Library Reference
MaximumResolution Property
See Also  Example
ESRI.ArcGIS.Client Namespace > Map Class : MaximumResolution Property

Gets or sets the maximum resolution (map units per pixel) one can zoom out.

Syntax

Visual Basic (Declaration) 
Public Property MaximumResolution As Double
C# 
public double MaximumResolution {get; set;}

Remarks

If the Map contains one or more tiled layers, the default MaximumResolution value will be the maximum resolution of the tiled layers. If the Map does not contain any tiled layers, the default MaximumResolution value will be constant System.Double.MaxValue.

System.Double.MaxValue represents the largest possible positive value of a Double. This field is constant. The System.Double.MaxValue = 1.7976931348623157E+308. This value is considered to be infinity by the Operating System.

Setting the Map.MaximumResolution and the Map.MinimumResolution to the same value essentially locks the Map to a specific scale; meaning that you can only Pan around.

The ESRI.ArcGIS.Client.Toolkit.Navigation Control contains a slider to zoom in and out, interactive elements in a ring to rotate the map, and a set of buttons to zoom, pan, zoom to full extent, and reset rotation. The behavior of the Navigation control at runtime depends on the content and properties of the Map Control to which it is bound. The zoom slider will only be displayed if the Map.MinimumResolution and Map.MaximumResolution resolution on the Map control have been defined. If a ESRI.ArcGIS.Client.TiledMapServiceLayer is present in the Map's layer collection, in most cases the minimum and maximum resolution will be set for you. If a Map only contains ESRI.ArcGIS.Client.DynamicLayer , you must set the minimum and maximum resolution explicitly.

For some Tiled map services, the Map.MaximumResolution may be set to a low value resulting in not being able to see the full extent of all the tiles in the Map Control. Developers must override this default MaximumResolution value by setting it to a higher number so that all the tiles can be seen. The code example in this document provides a demonstration of how to address this common issue.

Example

How to use:

Click the various buttons to see the effect of setting the MaximumResolution Property on a Tiled Layer.

The XAML code in this example is used in conjunction with the code-behind (C# or VB.NET) to demonstrate the functionality.

The following screen shot corresponds to the code example in this page.

Demonstrating how to adjust the MaximumResolution Property to see all the tiles in a Tiled Layer.

XAMLCopy Code
<Grid x:Name="LayoutRoot">
  
  <!-- Add a Map control with an ArcGISTiledMapServiceLayer. -->
  <esri:Map Background="Blue" HorizontalAlignment="Left" Margin="12,88,0,0" 
            Name="Map1" VerticalAlignment="Top" Height="216" Width="247">
    <esri:ArcGISTiledMapServiceLayer ID="MyTiledLayer" 
                   Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
  </esri:Map>
  
  <!-- Add a Map control with an ArcGISTiledMapServiceLayer. -->
  <esri:Map Background="Blue" HorizontalAlignment="Left" Margin="282,88,0,0" 
            Name="Map2" VerticalAlignment="Top" Height="216" Width="247">
    <esri:ArcGISTiledMapServiceLayer ID="MyTiledLayer" 
                   Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
  </esri:Map>
  
  <!-- Add a button with instructions and a label. -->
  <Button Height="57" HorizontalAlignment="Left" Margin="12,12,0,0" 
          Name="Button_Step1" VerticalAlignment="Top" Width="247" Click="Button_Step1_Click">
    <Button.Content>
      <TextBlock Text="Step 1 - Click me to show the initial MaximumResolution and then zoom out to the maximum extent possible." 
                 TextWrapping="Wrap" />
    </Button.Content>
  </Button>
  <sdk:Label Height="20" HorizontalAlignment="Left" Margin="12,68,0,0" Name="Label1" VerticalAlignment="Top" 
             Width="120" Content="MaximumResolution:" />
  <sdk:Label Height="20" HorizontalAlignment="Left" Margin="133,68,0,0" Name="Label_Initial_MaximumResolution" 
             VerticalAlignment="Top" Width="126" />
  
  <!-- Add a button with instructions and a label. -->
  <Button Height="57" HorizontalAlignment="Left" Margin="282,12,0,0" 
          Name="Button_Step2" VerticalAlignment="Top" Width="247" Click="Button_Step2_Click">
    <Button.Content>
      <TextBlock Text="Step 2 - Click me to set a larger MaximumResolution and then zoom out to the maximum extent possible." 
                 TextWrapping="Wrap" />
    </Button.Content>
  </Button>
  <sdk:Label Height="20" HorizontalAlignment="Left" Margin="282,68,0,0" Name="Label2" VerticalAlignment="Top" 
             Width="120" Content="MaximumResolution:"/>
  <sdk:Label Height="20" HorizontalAlignment="Left" Margin="408,68,0,0" Name="Label_Set_Large_MaximumResolution" 
             VerticalAlignment="Top" Width="121"/>
</Grid>
C#Copy Code
private void Button_Step1_Click(object sender, System.Windows.RoutedEventArgs e)
{
  // Display the initial Map.MaximumResolution value.
  Label_Initial_MaximumResolution.Content = Map1.MaximumResolution;
 }
            
private void Button_Step2_Click(object sender, System.Windows.RoutedEventArgs e)
{
  // Set the Map.MaximumResolution value to a higher number than the default.
  Map2.MaximumResolution = 2.0;
  Label_Set_Large_MaximumResolution.Content = Map2.MaximumResolution;
}
VB.NETCopy Code
Private Sub Button_Step1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
  ' Display the initial Map.MaximumResolution value.
  Label_Initial_MaximumResolution.Content = Map1.MaximumResolution
End Sub
  
Private Sub Button_Step2_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
  ' Set the Map.MaximumResolution value to a higher number than the default.
  Map2.MaximumResolution = 2.0
  Label_Set_Large_MaximumResolution.Content = Map2.MaximumResolution
End Sub

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8

See Also

© ESRI, Inc. All Rights Reserved.