public TZPlayback(MapElementPlayback mpp) { InitializeComponent(); this._mpp = mpp; this._mpp.LineSymbol = (Symbol)this.Resources["DefaultLineSymbol"]; this._mpp.MovingPointMapTip = new MovingPointMapTip(); this._mpp.StayPointMapTip = new StayPointMapTip(); this.speedSlider.Value = 7; this.StartTime = DateTime.Now.AddHours(-2); this.EndTime = DateTime.Now; }
public void PlayBack(string url, string icon) { this.map.Layers.Clear(); //_mapElementCategoryID = mapElementCategoryID; //_id = id; Bindmap(); _url = url; Image imgMapMarker = new Image() { Width = 34, Height = 50, Source = new BitmapImage(new Uri(icon, UriKind.RelativeOrAbsolute)), Margin = new Thickness(0, -30, 0, 0) }; PictureMarkerSymbol stayPointSymbol = (PictureMarkerSymbol)this.LayoutRoot.Resources["StayPointSymbol"]; MapElementPlayback mpp = new MapElementPlayback(this.map) { MarkerElement = imgMapMarker, StayPointSymbol = stayPointSymbol, IsDisplayStayPoint = true, IsFilterStayPoint = true }; _tzPlayback = new TZPlayback(mpp); _tzPlayback.Playing += _tzPlayback_Playing; double browserWidth = Convert.ToDouble(HtmlPage.Document.Body.GetProperty("clientWidth")); double browserHeight = Convert.ToDouble(HtmlPage.Document.Body.GetProperty("clientHeight")); double top = (browserHeight - 120); double left = ((browserWidth / 2) - 300); RadWindow tzPlaybackWindow = new RadWindow() { WindowStartupLocation = Telerik.Windows.Controls.WindowStartupLocation.Manual, Left = left, //Top = top, Header = "轨迹回放", Foreground = new SolidColorBrush(Colors.White), Content = this._tzPlayback, HideMaximizeButton = true, ResizeMode = ResizeMode.CanMinimize }; tzPlaybackWindow.Closed += TzPlaybackWindow_Closed; tzPlaybackWindow.Show(); }