コード例 #1
0
 protected void AddGeoMapLayer(GeoDataViewSource dataViewSource, GeoSeriesType seriesType)
 {
     if (dataViewSource.DataType == GeoDataType.Shapes && seriesType == GeoSeriesType.GeographicShapeSeries)
     {
         // AddGeoMapLayer(MapLayer as GeoShapeMapLayer);
     }
 }
コード例 #2
0
        protected void AddGeoMapLayer(GeoSymbolProportionalMapLayer mapLayer)
        {
            mapLayer.PropertyChanged += OnMapLayerChanged;

            var dataSourceKey = mapLayer.DataSourceKey;

            //var dataSource = this.DataViewModel.DataSources[dataSourceKey];
            GeoDataViewSource dataSource = null;

            if (dataSourceKey == DataViewModel.WorldCitiesKey)
            {
                dataSource = this.DataViewModel.WorldCities;
            }
            else if (dataSourceKey == DataViewModel.WorldCountriesKey)
            {
                dataSource = this.DataViewModel.WorldCountries;
            }
            else if (dataSourceKey == DataViewModel.WorldWeatherKey)
            {
                dataSource = this.DataViewModel.WorldWeather;
            }
            else if (dataSourceKey == DataViewModel.WorldEarthQuakesKey)
            {
                dataSource = this.DataViewModel.WorldEarthQuakes;
            }
            //else if (dataSourceKey == DataViewModel.UnitedStatesAirlineTrafficKey)
            //    dataSource = this.DataViewModel.UnitedStatesAirlineTraffic;

            if (dataSource != null)
            {
                mapLayer.DataViewSource = dataSource;

                mapLayer.SeriesView.Visibility  = mapLayer.Visibility;
                mapLayer.SeriesView.Title       = mapLayer.Title;
                mapLayer.SeriesView.Opacity     = mapLayer.Opacity;
                mapLayer.SeriesView.ItemsSource = mapLayer.DataViewSource.View; //WorldCountries.View;
                //mapLayer.SeriesView.ItemsSource = dataSource.View; //WorldCountries.View;

                //mapLayer.ActualSeriesView.MaximumMarkers = dataSource.DataItemsCount;
                mapLayer.ActualSeriesView.MaximumMarkers = mapLayer.DataViewSource.DataItemsCount;
                //mapLayer.ActualSeriesView.MarkerCollisionAvoidance = mapLayer.MarkersLayout;
                //mapLayer.ActualSeriesView.MarkerType = mapLayer.MarkerType;

                //mapLayer.ActualSeriesView.LongitudeMemberPath = mapLayer.LongitudeMemberPath;
                //mapLayer.ActualSeriesView.LatitudeMemberPath = mapLayer.LatitudeMemberPath;
                mapLayer.ActualSeriesView.RadiusMemberPath = mapLayer.RadiusMemberPath;
                mapLayer.ActualSeriesView.FillMemberPath   = mapLayer.FillMemberPath;
                //mapLayer.ActualSeriesView.FillScale.Brushes = mapLayer.FillValueScale.Brushes;
                //mapLayer.ActualSeriesView.FillScale. = mapLayer.FillValueScale;
                mapLayer.ActualSeriesView.FillScale = mapLayer.FillValueScale;


                //MapLayer.SeriesView.RadiusScale = MapLayer.RadiusScale;
                //MapLayer.SeriesView.FillScale = MapLayer.FillScale;

                if (mapLayer.LabelMemberPath != string.Empty)
                {
                    mapLayer.SeriesView.ToolTip = mapLayer.ToolTip;
                }

                //var windowRect = this.Map.GetZoomFromGeographic(mapLayer.DataViewSource.DataWorldRect.ToRect());
                //this.Map.WindowRect = windowRect;
                this.Map.Series.Add(mapLayer.SeriesView);
            }
        }