原文 http://www.cnblogs.com/thinkaspx/archive/2012/08/08/2628214.html
转载请注明文章出处:http://www.cnblogs.com/thinkaspx
地图是读取的谷歌图层。。
主要是导航工具 做出来费劲呀。。
马上上代码
namespace ZoomwayWebGis.Controls.Generic
{
[TemplatePart(Name = "PanLeft", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "PanRight", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "PanUp", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "PanDown", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "ZoomSlider", Type = typeof(Slider))]
[TemplatePart(Name = "ZoomInButton", Type = typeof(Button))]
[TemplatePart(Name = "ZoomOutButton", Type = typeof(Button))]
[TemplatePart(Name = "InstanceMark", Type = typeof(Button))]
public class MapNavigator : ContentControl
{
FrameworkElement PanLeft;
FrameworkElement PanRight;
FrameworkElement PanUp;
FrameworkElement PanDown;
Button ZoomInButton;
Button ZoomOutButton;
Slider ZoomSlider; private double _panFactor = 0.5;
private const double MaxResolution = 23218.433769164774;
private const double MinResolution = 0.59716428347743467; public MapNavigator()
{
this.DefaultStyleKey = typeof(MapNavigator);
} public override void OnApplyTemplate()
{
base.OnApplyTemplate(); PanLeft = GetTemplateChild("PanLeft") as FrameworkElement;
PanRight = GetTemplateChild("PanRight") as FrameworkElement;
PanUp = GetTemplateChild("PanUp") as FrameworkElement;
PanDown = GetTemplateChild("PanDown") as FrameworkElement;
ZoomSlider = GetTemplateChild("ZoomSlider") as Slider;
ZoomInButton = GetTemplateChild("ZoomInButton") as Button;
ZoomOutButton = GetTemplateChild("ZoomOutButton") as Button; enablePanElement(PanLeft);
enablePanElement(PanRight);
enablePanElement(PanUp);
enablePanElement(PanDown); // Set control's flow direction to LTR to avoid flipping East and West keys:
this.FlowDirection = System.Windows.FlowDirection.LeftToRight; if (ZoomSlider != null)
{
if (Map != null)
{
SetupZoom();
} ZoomSlider.Minimum = ;
ZoomSlider.Maximum = ;
ZoomSlider.SmallChange = .;
ZoomSlider.LargeChange = .;
ZoomSlider.LostMouseCapture += ZoomSlider_LostMouseCapture;
ZoomSlider.LostFocus += ZoomSlider_LostMouseCapture;
}
if (ZoomInButton != null)
ZoomInButton.Click += ZoomInButton_Click;
if (ZoomOutButton != null)
ZoomOutButton.Click += ZoomOutButton_Click; bool isDesignMode = System.ComponentModel.DesignerProperties.GetIsInDesignMode(this);
if (isDesignMode)
mouseOver = isDesignMode;
ChangeVisualState(false);
} private void ZoomOutButton_Click(object sender, RoutedEventArgs e)
{
Map.Zoom( / Map.ZoomFactor);
} private void ZoomInButton_Click(object sender, RoutedEventArgs e)
{
Map.Zoom(Map.ZoomFactor);
} private void Map_ExtentChanged(object sender, ExtentEventArgs args)
{
if (!double.IsNaN(Map.Resolution) && ZoomSlider != null)
ZoomSlider.Value = ResolutionToValue(Map.Resolution);
} #region State management private bool mouseOver = false; protected override void OnMouseLeave(MouseEventArgs e)
{
mouseOver = false;
if (!trackingRotation)
ChangeVisualState(true);
base.OnMouseLeave(e);
} protected override void OnMouseEnter(MouseEventArgs e)
{
mouseOver = true;
ChangeVisualState(true);
base.OnMouseEnter(e);
} private void ChangeVisualState(bool useTransitions)
{
if (mouseOver)
{
GoToState(useTransitions, "MouseOver");
}
else
{
GoToState(useTransitions, "Normal");
}
} private bool GoToState(bool useTransitions, string stateName)
{
return VisualStateManager.GoToState(this, stateName, useTransitions);
} #endregion #region Rotation Point startMousePos;
private double angle = ;
private bool trackingRotation = false; private double GetAngle(Point a, Point b)
{
if (a == null || b == null) return ;
return Math.Atan2((b.X - a.X), (a.Y - b.Y)) / Math.PI * ;
} #endregion #region Zoom private void ZoomSlider_LostMouseCapture(object sender, EventArgs e)
{
Map.ZoomToResolution(ValueToResolution(ZoomSlider.Value));
} #endregion private void enablePanElement(FrameworkElement element)
{
if (element == null) return;
element.MouseLeave += panElement_MouseLeftButtonUp;
element.MouseLeftButtonDown += panElement_MouseLeftButtonDown;
element.MouseLeftButtonUp += panElement_MouseLeftButtonUp;
} private void panElement_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (Map == null || sender == null) return; Envelope env = Map.Extent;
if (env == null) return;
double x = , y = ;
MapPoint oldCenter = env.GetCenter();
MapPoint newCenter = null;
var height = env.Height * _panFactor;
var width = env.Width * _panFactor;
// if units are degrees (the default), limit or alter panning to the lat/lon limits
if (sender == PanUp) // North
{
y = oldCenter.Y + height;
newCenter = new MapPoint(oldCenter.X, y);
}
else if (sender == PanRight) // East
{
x = oldCenter.X + width;
newCenter = new MapPoint(x, oldCenter.Y);
}
else if (sender == PanLeft) // West
{
x = oldCenter.X - width;
newCenter = new MapPoint(x, oldCenter.Y);
}
else if (sender == PanDown) // South
{
y = oldCenter.Y - height;
newCenter = new MapPoint(oldCenter.X, y);
} if (newCenter != null)
Map.PanTo(newCenter); } private void panElement_MouseLeftButtonUp(object sender, MouseEventArgs e)
{
if (Map == null) return;
} private double ValueToResolution(double value)
{
double max = Math.Log10(MaxResolution);
double min = Math.Log10(MinResolution);
double resLog = ( - value) * (max - min) + min;
return Math.Pow(, resLog);
} private double ResolutionToValue(double resolution)
{
double max = Math.Log10(MaxResolution);
double min = Math.Log10(MinResolution);
double value = - ((Math.Log10(resolution) - min) / (max - min));
return Math.Min(, Math.Max(value, )); //cap values between 0..1
} public void SetupZoom()
{
if (ZoomSlider != null && Map != null)
{
if (!double.IsNaN(MinResolution) && !double.IsNaN(MaxResolution) &&
MaxResolution != double.MaxValue &&
MinResolution != double.Epsilon &&
!double.IsNaN(Map.Resolution))
{
ZoomSlider.Value = ResolutionToValue(Map.Resolution);
}
}
} #region Properties public static readonly DependencyProperty MapProperty = DependencyProperty.Register("Map", typeof(Map), typeof(MapNavigator), new PropertyMetadata(OnMapPropertyChanged)); private static void OnMapPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
MapNavigator nav = d as MapNavigator;
Map map = e.NewValue as Map;
Map oldmap = e.OldValue as Map; if (oldmap != null)
{
oldmap.RotationChanged -= nav.Map_RotationChanged;
oldmap.ExtentChanged -= nav.Map_ExtentChanged;
oldmap.ExtentChanging -= nav.Map_ExtentChanged;
if (oldmap.Layers != null)
oldmap.Layers.LayersInitialized -= nav.Layers_LayersInitialized;
}
if (map != null)
{
map.RotationChanged += nav.Map_RotationChanged;
map.ExtentChanged += nav.Map_ExtentChanged;
map.ExtentChanging += nav.Map_ExtentChanged;
if (map.Layers != null)
map.Layers.LayersInitialized += nav.Layers_LayersInitialized;
nav.SetupZoom();
}
} private void Layers_LayersInitialized(object sender, EventArgs args)
{
SetupZoom();
} public Map Map
{
get { return GetValue(MapProperty) as Map; }
set { SetValue(MapProperty, value); }
} public Double PanFactor { get { return _panFactor; } set { _panFactor = value; } } private void Map_RotationChanged(object sender, DependencyPropertyChangedEventArgs e)
{
double value = (this.FlowDirection == System.Windows.FlowDirection.LeftToRight) ? (double)e.NewValue : -(double)e.NewValue;
angle = (double)e.NewValue;
} #endregion
}
<Style TargetType="nmap:MapNavigator">
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="#F0999988" />
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value=""/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="nmap:MapNavigator">
<Grid x:Name="NavigatorRootGrid" Background="Transparent" RenderTransformOrigin="0.5,0.5" Opacity="">
<Grid.Resources>
<RadialGradientBrush x:Key="CircleButtonGradientBrush" GradientOrigin="0.25,0.25">
<GradientStop Offset="0.25" Color="#99CCCCCC"/>
<GradientStop Offset="1.00" Color="#99000000"/>
</RadialGradientBrush> <SolidColorBrush x:Key="HoverShineBrush" Color="#749dd2" />
<DropShadowEffect x:Key="HoverShineEffect" Color="#749dd2" BlurRadius="" ShadowDepth="" /> <LinearGradientBrush x:Key="ThumbGradientBrush" EndPoint="0.5,0.95" StartPoint="0.5,0.05">
<GradientStop Color="#749dd2" Offset="" />
<GradientStop Color="#749dd2" Offset="" />
</LinearGradientBrush> <LinearGradientBrush x:Key="ThumbPressedBrush" EndPoint="0.5,0.95" StartPoint="0.5,0.05">
<GradientStop Color="#99CCCCCC" Offset="" />
<GradientStop Color="#99333333" Offset="" />
</LinearGradientBrush> <!--Circle Button Style-->
<Style TargetType="Button" x:Key="CircleButtonStyle" >
<Setter Property="Background" Value="#F0CCCCCC" />
<Setter Property="Foreground" Value="#FF000000" />
<Setter Property="BorderBrush" Value="#F0333333" />
<Setter Property="BorderThickness" Value="" />
<Setter Property="Padding" Value=""/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" TargetType="Button">
<Grid x:Name="ButtonRootGrid" Background="Transparent">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates" >
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="HoverShineShape" Storyboard.TargetProperty="Opacity" To="1.0" Duration="0:0:0.1" />
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed" />
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="DisabledMask" Storyboard.TargetProperty="Opacity" To="0.7" Duration="0:0:0.1" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Ellipse x:Name="BackgroundShape" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"
Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}"
StrokeThickness="{TemplateBinding BorderThickness}"/>
<Ellipse x:Name="HoverShineShape" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"
Fill="{StaticResource HoverShineBrush}" Stroke="#00FFFFFF" StrokeThickness=""
Effect="{StaticResource HoverShineEffect}" Opacity="0.0" />
<ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" />
<Ellipse x:Name="DisabledMask" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"
Fill="#F0999999" Stroke="#00FFFFFF" StrokeThickness="" Opacity="0.0" IsHitTestVisible="false"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style> <!-- Zoom Bar Thumb Style-->
<Style TargetType="Thumb" x:Key="ZoomBarThumbStyle">
<Setter Property="Background" Value="{StaticResource ThumbGradientBrush}" />
<Setter Property="BorderThickness" Value="" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Thumb">
<Grid x:Name="ThumbRootGrid" Background="Transparent">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver" />
<VisualTransition GeneratedDuration="00:00:00.1" To="Pressed" />
<VisualTransition From="Normal" GeneratedDuration="00:00:00.25" To="MouseOver" />
<VisualTransition From="MouseOver" GeneratedDuration="00:00:00.25" To="Normal" />
<VisualTransition From="MouseOver" GeneratedDuration="00:00:00.25" To="Pressed" />
<VisualTransition From="Pressed" GeneratedDuration="00:00:00.25" To="MouseOver" />
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="HoverShineBorder" Storyboard.TargetProperty="Opacity" To="1.0" Duration="0:0:0.1" />
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="PressedBorder" Storyboard.TargetProperty="Opacity" To="1.0" Duration="0:0:0.1" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="DisabledBorder" Storyboard.TargetProperty="Opacity" To="0.5" Duration="0:0:0.1" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="BackgroundBorder" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="" />
<Border x:Name="HoverShineBorder" Background="{StaticResource HoverShineBrush}"
BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="" Opacity="" />
<Border x:Name="PressedBorder" Background="{StaticResource ThumbPressedBrush}"
BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="" Opacity="" />
<Border x:Name="DisabledBorder" Background="#F0999999" IsHitTestVisible="false" CornerRadius="" Opacity="" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style> <!-- Zoom Slider Style-->
<Style TargetType="Slider" x:Key="ZoomSliderStyle">
<Setter Property="BorderThickness" Value="" />
<Setter Property="BorderBrush" Value="#99666666" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="#99666666" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Maximum" Value="" />
<Setter Property="Minimum" Value="" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Slider">
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.Resources>
<ControlTemplate x:Key="RepeatButtonTemplate1">
<Grid x:Name="Root" Opacity="" Background="Transparent" />
</ControlTemplate>
<ControlTemplate x:Key="RepeatButtonTemplate2">
<Grid x:Name="Root" Opacity="" Background="{StaticResource HoverShineBrush}" />
</ControlTemplate>
</Grid.Resources>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver" />
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(UIElement.Opacity)">
<SplineDoubleKeyFrame KeyTime="" Value="0.5" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="HorizontalTemplate" Margin="0,0,0,0" Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Rectangle Margin="0,4,0,4" Grid.Column="" Grid.ColumnSpan="" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" Opacity="0.8" RadiusX="" RadiusY="" />
<RepeatButton x:Name="HorizontalTrackLargeChangeDecreaseRepeatButton" Margin="0,4,0,4" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate2}" Grid.Column="" />
<RepeatButton x:Name="HorizontalTrackLargeChangeIncreaseRepeatButton" Margin="0,4,0,4" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate1}" Grid.Column="" />
<Thumb x:Name="HorizontalThumb" Height="{TemplateBinding Height}" Width="" Grid.Column="" IsTabStop="True" Style="{StaticResource ZoomBarThumbStyle}" />
</Grid>
<Grid x:Name="VerticalTemplate" Margin="0,0,0,0" Visibility="Collapsed" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Rectangle Margin="4,0,4,0" Grid.Row="" Grid.RowSpan="" Fill="{TemplateBinding Background}"
Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" Opacity="0.8" RadiusX="" RadiusY="" />
<RepeatButton x:Name="VerticalTrackLargeChangeDecreaseRepeatButton" Margin="4,0,4,0" IsTabStop="False"
Template="{StaticResource RepeatButtonTemplate2}" Grid.Row="" />
<RepeatButton x:Name="VerticalTrackLargeChangeIncreaseRepeatButton" Margin="4,0,4,0" IsTabStop="False"
Template="{StaticResource RepeatButtonTemplate1}" Grid.Row="" BorderBrush="{StaticResource HoverShineBrush}" />
<Grid Margin="6,2,6,2" Grid.Row=""
Grid.RowSpan="" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" IsHitTestVisible="False"
Background="#FFFBF9FA" >
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
<Rectangle Grid.Row="" Fill="{TemplateBinding Foreground}" Stroke="#F0FFFFFF" StrokeThickness="" Margin="" RadiusX="" RadiusY="" Height="" />
</Grid>
<Thumb x:Name="VerticalThumb"
Width="{TemplateBinding Width}" Grid.Row="" Height="" IsTabStop="True"
Style="{StaticResource ZoomBarThumbStyle}" >
<Thumb.BorderBrush>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFA3AEB9" Offset=""/>
<GradientStop Color="#FF8399A9" Offset="0.375"/>
<GradientStop Color="#FF718597" Offset="0.375"/>
<GradientStop Color="#FF6C84A4" Offset=""/>
</LinearGradientBrush>
</Thumb.BorderBrush>
<Thumb.Background>
<RadialGradientBrush>
<GradientStop Color="#FF749DD2" Offset=""/>
<GradientStop Color="#FF749DD2" Offset=""/>
</RadialGradientBrush>
</Thumb.Background>
</Thumb>
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources> <Grid.RowDefinitions>
<RowDefinition Height="" />
<RowDefinition Height="" />
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions> <VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates" >
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="NavigatorRootGrid" Storyboard.TargetProperty="Opacity" To="1.0" Duration="0:0:0" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups> <Grid x:Name="Navigator" Grid.Row="" Width="" Height="" Background="Transparent" RenderTransformOrigin="0.5,0.5" Margin="0,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid.RenderTransform>
<RotateTransform x:Name="TransformRotate" Angle=""/>
</Grid.RenderTransform>
<Ellipse x:Name="RotateRing1" Width="" Height="" HorizontalAlignment="Center"
VerticalAlignment="Center" StrokeThickness="{TemplateBinding BorderThickness}"
Stroke="#FFA6A6A6">
<Ellipse.Fill>
<RadialGradientBrush>
<GradientStop Color="#FFFBF9FA" Offset=""/>
<GradientStop Color="#FFFBF9FA" Offset=""/>
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
<local:ButtonGrid x:Name="PanUp" Margin="0,2,0,0"
BackgroundShape="M0.0,4.0 A10,3.0 0 0 1 20,4.0 L16,16 A8.0,4.0 0 0 0 4.0,16 L0.0,4.0 z"
ForegroundShape="M0.0,1.0 L0.5,0.0 L1.0,1.0 z" Width="" Height="" ForeBorderBrush="Transparent"
ForeBorderThick="" ForeShapeFill="{TemplateBinding Foreground}" MouseOverBackFill="#F0999999"
MouseOverForeFill="Cyan" VerticalAlignment="Top" HorizontalAlignment="Center"
ToolTipService.ToolTip="向上平移" Cursor="Hand" />
<local:ButtonGrid x:Name="PanDown" Margin="0,0,0,2" BackgroundShape="M20,12 A10,3.0 0 0 1 0.0,12 L4.0,0.0 A8.0,4.0 0 0 0 16,0.0 L20.0,12 z"
ForegroundShape="M0.0,0.0 L0.5,1.0 L1.0,0.0" Width="" Height=""
ForeBorderBrush="{TemplateBinding Foreground}" MouseOverBackFill="#F0999999" MouseOverForeBorderBrush="Cyan"
VerticalAlignment="Bottom" HorizontalAlignment="Center" ToolTipService.ToolTip="向下平移" Cursor="Hand"/>
<local:ButtonGrid x:Name="PanLeft" Margin="2,0,0,0" BackgroundShape="M4.0,0.0 L16,4.0 A4.0,8.0 0 0 0 16,16 L4.0,20 A3.0,10 0 0 1 4.0,0.0 z"
ForegroundShape="M1.0,0.0 L0.0,0.5 L1.0,1.0" Width="" Height=""
ForeBorderBrush="{TemplateBinding Foreground}" MouseOverBackFill="#F0999999" MouseOverForeBorderBrush="Cyan"
HorizontalAlignment="Left" VerticalAlignment="Center" ToolTipService.ToolTip="向左平移" Cursor="Hand"/>
<local:ButtonGrid x:Name="PanRight" Margin="0,0,2,0" BackgroundShape="M12,0 A3.0,10 0 0 1 12,20 L0.0,16 A4.0,8.0 0 0 0 0.0,4.0 L12.0,0.0 z"
ForegroundShape="M0.0,0.0 L1.0,0.5 L0.0,1.0" Width="" Height=""
ForeBorderBrush="{TemplateBinding Foreground}" MouseOverBackFill="#F0999999" MouseOverForeBorderBrush="Cyan"
HorizontalAlignment="Right" VerticalAlignment="Center" ToolTipService.ToolTip="向右平移" Cursor="Hand"/>
<Button x:Name="ResetRotation" Margin="0,0,0,0" Visibility="Collapsed" Style="{StaticResource CircleButtonStyle}" Height="" Width=""
HorizontalAlignment="Center" VerticalAlignment="Center" Background="#F0FFFFFF" BorderBrush="Transparent" BorderThickness=""
ToolTipService.ToolTip="Reset Map North" Cursor="Hand">
<Image Source="../Images/icons/i_nav.png" Width="" Height="" Stretch="Uniform" />
</Button>
</Grid> <Grid x:Name="ZoomHistoryPanel" Grid.Row="" Margin="0,8,0,8" Visibility="Collapsed" Background="Transparent" HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width=""/>
<ColumnDefinition Width=""/>
<ColumnDefinition Width=""/>
</Grid.ColumnDefinitions>
<local:ButtonGrid x:Name="ZoomBackButton" Grid.Column="" Margin="1,0,-1,0"
BackgroundShape="M4.0,0.0 L16,4.0 A4.0,8.0 0 0 0 16,16 L4.0,20 A3.0,10 0 0 1 4.0,0.0 z"
ForegroundShape="M1.0,0.0 L0.0,0.5 L1.0,1.0" Width="" Height="" BackShapeFill="{TemplateBinding Background}"
ForeBorderBrush="{TemplateBinding Foreground}" MouseOverBackFill="#F0666666" MouseOverForeBorderBrush="Cyan"
HorizontalAlignment="Left" VerticalAlignment="Center" ToolTipService.ToolTip="Zoom to Previous Extent" Cursor="Hand"/>
<Button x:Name="ZoomFullButton" Grid.Column="" Margin="0,0,0,0" Height="" Width="" Style="{StaticResource CircleButtonStyle}" Background="#F0FFFFFF" BorderBrush="Transparent" BorderThickness="" HorizontalAlignment="Center" VerticalAlignment="Center" ToolTipService.ToolTip="Zoom to Full Extent" Cursor="Hand">
<Image Source="../Images/icons/i_globe.png" Width="" Height="" Stretch="Uniform" />
</Button>
<local:ButtonGrid x:Name="ZoomNextButton" Grid.Column="" Margin="-1,0,1,0" BackgroundShape="M12,0 A3.0,10 0 0 1 12,20 L0.0,16 A4.0,8.0 0 0 0 0.0,4.0 L12.0,0.0 z" ForegroundShape="M0.0,0.0 L1.0,0.5 L0.0,1.0" Width="" Height="" BackShapeFill="{TemplateBinding Background}" ForeBorderBrush="{TemplateBinding Foreground}" MouseOverBackFill="#F0666666" MouseOverForeBorderBrush="Cyan" HorizontalAlignment="Right" VerticalAlignment="Center" ToolTipService.ToolTip="Zoom to Next Extent" Cursor="Hand"/>
</Grid> <Border x:Name="ZoomSliderBorder" Grid.Row="" Background="Transparent"
BorderBrush="Transparent" BorderThickness="" CornerRadius="" HorizontalAlignment="Center">
<StackPanel x:Name="ZoomStack" Orientation="Vertical">
<Button x:Name="ZoomInButton" Height="" Width="" Margin="2,4,2,0" Foreground="Black"
BorderBrush="#FFA6A6A6" BorderThickness="" ToolTipService.ToolTip="Zoom In" Cursor="Hand" >
<Button.Background>
<RadialGradientBrush>
<GradientStop Color="#FFFBF9FA" Offset=""/>
<GradientStop Color="#FFFBF9FA" Offset=""/>
</RadialGradientBrush>
</Button.Background>
<Path Stroke="#a6a6a6" StrokeThickness=""
Width="" Height="" Stretch="Fill" Data="M0.0,0.5 L1.0,0.5 M0.5,0.0 L0.5,1.0"
Fill="#FF949494"/>
</Button>
<Grid x:Name="ZoomLevelGrid">
<Slider x:Name="ZoomSlider" Orientation="Vertical" Height="" Width="" Foreground="{StaticResource ThumbGradientBrush}"
Minimum="" Maximum="" SmallChange="" LargeChange=""
ToolTipService.ToolTip="拖动缩放" Style="{StaticResource ZoomSliderStyle}"
BorderBrush="#a6a6a6" RenderTransformOrigin="0,0" Cursor="SizeNS" Background="#fbf9fa" />
</Grid>
<Button x:Name="ZoomOutButton" Height="" Width="" Margin="2,0,2,4" Foreground="Black"
BorderBrush="#FFA6A6A6" BorderThickness="" ToolTipService.ToolTip="Zoom Out" Cursor="Hand">
<Button.Background>
<RadialGradientBrush>
<GradientStop Color="#FFFBF9FA" Offset=""/>
<GradientStop Color="White" Offset=""/>
</RadialGradientBrush>
</Button.Background>
<Path Stroke="#a6a6a6" StrokeThickness="" Width="" Height="" Stretch="Fill" Data="M0.0,0.5 L1.0,0.5"/>
</Button>
</StackPanel>
</Border> <ContentPresenter Grid.Row="" ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
Margin="{TemplateBinding Padding}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>