Select to view content in your preferred language

How can you set the overviewmap to SnapToLevels when using a cached layer source?

1007
2
Jump to solution
05-31-2012 04:54 AM
LanceCrumbliss
Frequent Contributor
Interpolating between levels can look pretty bad and unpolished so i was hoping there was a way to SnapToLevels in the overviewmap without having to roll my own control.

Lance
0 Kudos
1 Solution

Accepted Solutions
DominiqueBroux
Esri Frequent Contributor
You can style the overviewmap control and set the SnapToLevels option for the inner map.

Something like:
<Style TargetType="local:OverviewMap">     <Setter Property="Template">         <Setter.Value>             <ControlTemplate TargetType="local:OverviewMap">                 <Grid Background="{TemplateBinding Background}" >                     <esri:Map x:Name="OVMapImage" WrapAround="{Binding Map.WrapAround, RelativeSource={RelativeSource TemplatedParent}}" Margin="0"                                  SnapToLevels="True" IsHitTestVisible="False" IsLogoVisible="False" />                     <Grid x:Name="AOI" Width="9" Height="9" Visibility="Collapsed" HorizontalAlignment="Left" VerticalAlignment="Top" >                         <Border Background="#3333FFFF" BorderBrush="Red" BorderThickness="2" Margin="0" >                             <!--Crosshair-->                             <Canvas Width="9" Height="9" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Visible" >                                 <Line X1="0" X2="9" Y1="4" Y2="4" Stroke="Red" StrokeThickness="1" />                                 <Line X1="4" X2="4" Y1="0" Y2="9" Stroke="Red" StrokeThickness="1" />                             </Canvas>                         </Border>                     </Grid>                 </Grid>             </ControlTemplate>         </Setter.Value>     </Setter> </Style>

View solution in original post

0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
You can style the overviewmap control and set the SnapToLevels option for the inner map.

Something like:
<Style TargetType="local:OverviewMap">     <Setter Property="Template">         <Setter.Value>             <ControlTemplate TargetType="local:OverviewMap">                 <Grid Background="{TemplateBinding Background}" >                     <esri:Map x:Name="OVMapImage" WrapAround="{Binding Map.WrapAround, RelativeSource={RelativeSource TemplatedParent}}" Margin="0"                                  SnapToLevels="True" IsHitTestVisible="False" IsLogoVisible="False" />                     <Grid x:Name="AOI" Width="9" Height="9" Visibility="Collapsed" HorizontalAlignment="Left" VerticalAlignment="Top" >                         <Border Background="#3333FFFF" BorderBrush="Red" BorderThickness="2" Margin="0" >                             <!--Crosshair-->                             <Canvas Width="9" Height="9" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Visible" >                                 <Line X1="0" X2="9" Y1="4" Y2="4" Stroke="Red" StrokeThickness="1" />                                 <Line X1="4" X2="4" Y1="0" Y2="9" Stroke="Red" StrokeThickness="1" />                             </Canvas>                         </Border>                     </Grid>                 </Grid>             </ControlTemplate>         </Setter.Value>     </Setter> </Style>
0 Kudos
LanceCrumbliss
Frequent Contributor
Great, thanks!

Lance
0 Kudos