Inheritance: MarkerSymbol
		/// <summary>
		/// Initializes a new instance of the <see cref="GpsLayer"/> class.
		/// </summary>
		public GpsLayer()
		{
			location = new Graphic();
			GeoPositionWatcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
			System.Windows.Media.RadialGradientBrush brush = new System.Windows.Media.RadialGradientBrush()
			{
				Center = new Point(.25, .25),
				GradientOrigin = new Point(.25, .25),
				RadiusX = 1,
				RadiusY = 1
			};

			LocationMarkerSymbol = new Gps.GpsSymbol();
			
			accuracyCircle = new Graphic {  Geometry = new Circle() };
			AccuracyCircleSymbol = new SimpleFillSymbol() {
					BorderBrush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(90, 255, 255, 255)),
					Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(20, 65, 76, 249)),
					BorderThickness = 3
				};
			Graphics.Add(accuracyCircle);
			Graphics.Add(location);
			location.SetZIndex(1);

			IsHitTestVisible = false;
			
			animationTimerLocation = new DispatcherTimer();
			animationTimerLocation.Interval = TimeSpan.FromMilliseconds(33);
			animationTimerLocation.Tick += animationTimerLocation_Tick;

			animationTimerAccuracy = new DispatcherTimer();
			animationTimerAccuracy.Interval = TimeSpan.FromMilliseconds(33);
			animationTimerAccuracy.Tick += animationTimerAccuracy_Tick;
		}
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GpsLayer"/> class.
        /// </summary>
        public GpsLayer()
        {
            location           = new Graphic();
            GeoPositionWatcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
            System.Windows.Media.RadialGradientBrush brush = new System.Windows.Media.RadialGradientBrush()
            {
                Center         = new Point(.25, .25),
                GradientOrigin = new Point(.25, .25),
                RadiusX        = 1,
                RadiusY        = 1
            };

            LocationMarkerSymbol = new Gps.GpsSymbol();

            accuracyCircle = new Graphic {
                Geometry = new Circle()
            };
            AccuracyCircleSymbol = new SimpleFillSymbol()
            {
                BorderBrush     = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(90, 255, 255, 255)),
                Fill            = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(20, 65, 76, 249)),
                BorderThickness = 3
            };
            Graphics.Add(accuracyCircle);
            Graphics.Add(location);
            location.SetZIndex(1);

            IsHitTestVisible = false;

            animationTimerLocation          = new DispatcherTimer();
            animationTimerLocation.Interval = TimeSpan.FromMilliseconds(33);
            animationTimerLocation.Tick    += animationTimerLocation_Tick;

            animationTimerAccuracy          = new DispatcherTimer();
            animationTimerAccuracy.Interval = TimeSpan.FromMilliseconds(33);
            animationTimerAccuracy.Tick    += animationTimerAccuracy_Tick;
        }