AGoyal-esristaff

Binding Navigation Control to Tiled Map Service Scales

Discussion created by AGoyal-esristaff Employee on Feb 10, 2012
Latest reply on Feb 13, 2012 by AGoyal-esristaff
I want to bind the Navigation toolkit control to the Bing tiled map layer. It seems that the navigation has extra ticks beyond the lat tile level. In other words if I zoom to last tile level, the navigation control still lets me zoom in beyond that. Is there a way to constraint the navigation and map to the last tile level. Here is my XAML-

<Style x:Key="SMARTNavigationStyle" TargetType="{x:Type esri:Navigation}">
                <Setter Property="Background" Value="#FF949494"/>
                <Setter Property="Foreground" Value="#FF333333"/>
                <Setter Property="BorderBrush" Value="White"/>
                <Setter Property="HorizontalAlignment" Value="Left"/>
                <Setter Property="VerticalAlignment" Value="Top"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type esri:Navigation}">
                            <Grid x:Name="LayoutRoot" Background="Transparent" HorizontalAlignment="Left" MinWidth="148" MinHeight="125" RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}" VerticalAlignment="Top">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="20"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RenderTransform>
                                    <ScaleTransform CenterY="0" CenterX="0"/>
                                </Grid.RenderTransform>
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal">
                                            <Storyboard>
                                                <DoubleAnimation Duration="0:0:0.1" To="0.75" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)" Storyboard.TargetName="LayoutRoot"/>
                                                <DoubleAnimation Duration="0:0:0.1" To="0.75" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Storyboard.TargetName="LayoutRoot"/>
                                                <DoubleAnimation BeginTime="0" Duration="0:0:0.1" To="0.25" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutRoot"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="MouseOver">
                                            <Storyboard>
                                                <DoubleAnimation BeginTime="0" Duration="0:0:0.1" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)" Storyboard.TargetName="LayoutRoot"/>
                                                <DoubleAnimation BeginTime="0" Duration="0:0:0.1" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Storyboard.TargetName="LayoutRoot"/>
                                                <DoubleAnimation BeginTime="0" Duration="0:0:0.1" To="0.75" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutRoot"/>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Grid x:Name="ZoomContainer" Margin="0" VerticalAlignment="Center">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Rectangle Grid.ColumnSpan="4" Fill="{TemplateBinding Background}" Margin="0" RadiusY="3" RadiusX="3" Grid.RowSpan="4" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                    <Button x:Name="ZoomInButton" Content="+" Foreground="{TemplateBinding Foreground}" FontSize="8" Height="16" Margin="2,2,2,0" Grid.Row="0" ToolTip="Zoom In" Width="14"/>
                                    <Rectangle Fill="White" HorizontalAlignment="Center" Height="3" Grid.Row="1" VerticalAlignment="Center" Width="2"/>
                                    <Slider x:Name="ZoomSlider" Cursor="Hand" Height="89" LargeChange="1" Maximum="15" Minimum="0" Orientation="Vertical" Grid.Row="1" SmallChange="1" ToolTip="Drag to zoom in or out" Value="0" VerticalAlignment="Top" HorizontalAlignment="Center"/>
                                    <Button x:Name="ZoomOutButton" Content="-" Foreground="{TemplateBinding Foreground}" FontSize="8" Height="16" Margin="2,0,2,2" Grid.Row="2" ToolTip="Zoom Out" Width="14"/>
                                </Grid>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>



<esri:Map x:Name="SMARTMap" WrapAround="True" Extent="-14845297.1729313940, 771252.4065809906, -5401390.1535723, 7067190.4194870535" SnapToLevels="True" extensions:MapExtentHelper.MapZoomGeometry="{Binding ZoomGeometry}">
            <bing:TileLayer ID="BingLayer" LayerStyle="AerialWithLabels"  Visible="True"
     ServerType="Staging"
     Token="" />
  </esri:Map>
<esri:Navigation x:Name="SMARTNavigation"  Margin="5" HorizontalAlignment="Left" VerticalAlignment="Top" MinHeight="125" Style="{DynamicResource SMARTNavigationStyle}"/>

Any help is appreciated.

Thanks

Apurva

Outcomes