Esempio n. 1
0
        protected void AddGeoMapLayer(GeoSymbolMapLayer mapLayer)
        {
            mapLayer.PropertyChanged += OnMapLayerChanged;
            var dataSourceKey = mapLayer.DataSourceKey;

            if (dataSourceKey == DataViewModel.UnitedStatesAirlineTrafficKey)
            {
                var dataSource = this.DataViewModel.DataSources[dataSourceKey] as AirlineTrafficDataViewSource;
                //dataSource.PropertyChanged += OnAirlineTrafficDataViewSourceChanged;


                //var dataSource = this.DataViewModel.UnitedStatesAirlineTraffic;
                mapLayer.DataViewSource = dataSource;
                //mapLayer.SeriesView.ItemsSource = dataSource.ActualFlights;
                mapLayer.SeriesView.PropertyChanged       += new PropertyChangedEventHandler(SeriesView_PropertyChanged);
                mapLayer.ActualSeriesView.PropertyUpdated += new PropertyUpdatedEventHandler(ActualSeriesView_PropertyUpdated);
                //TODO add airports - prop series
                //TODO add flights - symbol series
                var tooltipLabel = new TextBlock {
                    Margin = new Thickness(5)
                };
                tooltipLabel.SetBinding(TextBlock.TextProperty, new Binding("Item.Label"));
                var tooltip = new Border {
                    Opacity = 0.8
                };
                tooltip.Background = NamedColors.White.ToBrush();
                tooltip.Child      = tooltipLabel;
                //mapLayer.SeriesView.ToolTip = tooltip;

                mapLayer.ActualSeriesView.ItemsSource = dataSource.ActualAirports;
                //mapLayer.SeriesView.ItemsSource = dataSource.ActualAirports;
                //mapLayer.SeriesView.ItemsSource = dataSource.AirportsDataSource;
                this.Map.Series.Add(mapLayer.ActualSeriesView);
            }
        }
 private void ShowMapEditor(GeoSymbolMapLayer mapLayer)
 {
     if (mapLayer.DataViewSource is AirlineTrafficDataViewSource)
     {
         var mapLayerBinding = new Binding {
             Source = mapLayer, Mode = BindingMode.OneWay
         };
         var mapLayerEditor = new GeoMotionFrameworkLayerEditor();
         mapLayerEditor.SetBinding(GeoMapLayerEditor.MapLayerProperty, mapLayerBinding);
         this.MapLayerControls.Child      = mapLayerEditor;
         this.MapLayerControls.Visibility = Visibility.Visible;
     }
 }