private void RaiseAngleChanged(DependencyPropertyChangedEventArgs e) { if (this.AngleChanged != null) { this.AngleChanged(this, e); } this.LoadContinuousLayersInView(false); if (this.mapRotateThrottler == null) { this.mapRotateThrottler = new ThrottleTimer(250, delegate { this.LoadLayersInView(false, this.GetFullViewBounds()); }); } this.mapRotateThrottler.Invoke(); }
private void Map_SizeChanged(object sender, SizeChangedEventArgs e) { currentSize = e.NewSize; #if SILVERLIGHT isChanged = Application.Current.Host.Content.ZoomFactor != 1.0; if (isChanged) { foreach (Layer layer in this.Layers) { if (layer is TiledLayer) { layer.Container.InvalidateArrange(); } } } #endif ScreenContainer.Width = e.NewSize.Width; ScreenContainer.Height = e.NewSize.Height; if (this.mapResizeThrottler == null) { this.mapResizeThrottler = new ThrottleTimer(250, delegate { if (this.isDesignMode) { this.zoomTo(this.designViewBounds, true); } else { this.LoadLayersInView(false, this.GetFullViewBounds()); } this.RaiseViewBoundsChanged(); }); } this.mapResizeThrottler.Invoke(); }
/// <summary>${mapping_Map_constructor_None_D}</summary> public Map() { ZoomEffectEnabled = true; Theme = null; Metadata = new Dictionary<string, string>(); mapResolution = double.NaN; maxResolution = double.MaxValue; minResolution = double.Epsilon; maxScale = double.MaxValue; minScale = double.Epsilon; origin = Point2D.Empty; previousViewBounds = Rectangle2D.Empty; cacheViewBounds = Rectangle2D.Empty; zoomThrottleTimer = new ThrottleTimer(200); currentSize = new Size(0, 0); base.DefaultStyleKey = typeof(Map); Layers = new LayerCollection(); Popup = new Popup(); EnableDblClick = true; EnableKey = true; EnableWheel = true; base.Loaded += new RoutedEventHandler(Map_Loaded); #if WINDOWS_PHONE this.ManipulationCompleted += new EventHandler<ManipulationCompletedEventArgs>(Map_ManipulationCompleted); this.ManipulationDelta += new EventHandler<ManipulationDeltaEventArgs>(Map_ManipulationDelta); this.ManipulationStarted += new EventHandler<ManipulationStartedEventArgs>(Map_ManipulationStarted); Touch.FrameReported += new TouchFrameEventHandler(Touch_FrameReported); #endif }