private void ShowMapEditor(GeoShapeMapLayer mapLayer) { var mapLayerBinding = new Binding() { Source = mapLayer, Mode = BindingMode.OneWay }; var mapEditor = new GeoShapeLayerEditor(); mapEditor.SetBinding(GeoMapLayerEditor.MapLayerProperty, mapLayerBinding); this.MapLayerControls.Child = mapEditor; this.MapLayerControls.Visibility = Visibility.Visible; }
private void AddWorldCountriesLayer() { this.AddWorldCountriesShapesButton.IsEnabled = false; var mapLayer = new GeoShapeMapLayer(); mapLayer.DataSourceKey = DataViewModel.WorldCountriesKey; mapLayer.DataSourceTrademark = CommonStrings.SourceData_USNA; mapLayer.Title = AppStrings.MapLayer_WorldCountries; mapLayer.LabelMemberPath = "Label"; mapLayer.ActualSeriesView.ShapeMemberPath = "ShapePoints"; mapLayer.Opacity = 0.75; this.ViewModel.MapLayers.Insert(0, mapLayer); }
protected void AddGeoMapLayer(GeoShapeMapLayer mapLayer) { mapLayer.PropertyChanged += OnMapLayerChanged; var dataSourceKey = mapLayer.DataSourceKey; var dataSource = this.DataViewModel.DataSources[dataSourceKey]; // if (dataSource != null) { dataSource.FilterSettings.ItemsSourceKey = dataSourceKey; mapLayer.DataViewSource = dataSource; //MapLayer.SeriesView.Visibility = MapLayer.Visibility; //MapLayer.SeriesView.Opacity = MapLayer.Opacity; //MapLayer.SeriesView.ShapeStyleSelector = MapLayer.ShapeStyleSettings.ShapeStyleSelector; //mapLayer.SeriesView.Title = mapLayer.Title; //MapLayer.SeriesView.Brush = NamedColors.Orange.ToBrush(); mapLayer.ShapeStyleSettings.ShapeStyleSelectorType = StyleSelectorType.SingleShapeStyle; mapLayer.ShapeStyleSettings.ShapeFill = NamedColors.GreenYellow.BrushOpacity(0.5); //var style = new Style(typeof(Path)); //style.Setters.Add(new Setter(Path.FillProperty, NamedColors.DodgerBlue.ToBrush())); //style.Setters.Add(new Setter(Path.StrokeProperty, NamedColors.White.ToBrush())); //style.Setters.Add(new Setter(Path.StrokeThicknessProperty, 0.75)); //MapLayer.SeriesView.ShapeStyle = style; mapLayer.ActualSeriesView.ShapeStyle = mapLayer.ShapeStyleSettings.GetShapeStyle(); //mapLayer.SeriesView.ShapeStyle = mapLayer.ShapeStyleSettings.GetShapeStyle(); //MapLayer.SeriesView.ShapeMemberPath = MapLayer.ShapeMemberPath; //mapLayer.SeriesView.Opacity = mapLayer.Opacity; //mapLayer.SeriesView.ItemsSource = dataSource.View; //WorldCountries.View; mapLayer.SeriesView.ItemsSource = dataSource.View; //WorldCountries.View; mapLayer.ActualSeriesView.ToolTip = mapLayer.ToolTip; //TODO recalculate based on points of shapes //var windowRect = this.Map.GetZoomFromGeographic(dataSource.DataWorldRect.ToRect()); //this.Map.WindowRect = windowRect; this.Map.Series.Add(mapLayer.SeriesView); } //var series = new GeographicShapeSeries(); //series.Name = "WorldCountries"; //if (this.DataSources.ContainsKey(dataSourceKey)) //{ // MapLayer.SeriesView.ItemsSource = this.DataSources[dataSourceKey].View; //WorldCountries.View; //} //series.ShapeMemberPath = MapLayer.SeriesShapeMemberPath; //series.Brush = new SolidColorBrush(Colors.Red); //series.Opacity = 0.6; //series.ShapeFilterResolution = 10; //MapLayer.SeriesView = series; //this.MapLayers.Add(MapLayer); }