Example #1
0
        public BaseLayer()
        {
            this.Id = Guid.NewGuid();

            this.VisibleRange = ScaleInterval.All;

            this.VisualParameters = VisualParameters.CreateNew(1);
        }
Example #2
0
        public VectorLayer(string layerName, List <SqlGeometry> features, VisualParameters parameters, LayerType type, RenderingApproach rendering, RasterizationApproach toRasterTechnique)
        {
            if (features == null || features.Count == 0)
            {
                throw new NotImplementedException();
            }

            Initialize(layerName, new MemoryDataSource <object>(features), parameters, type, rendering, toRasterTechnique, ScaleInterval.All, null, null);
        }
Example #3
0
        private PolyBezierLayer(VisualParameters parameters)
        {
            this.Id = Guid.NewGuid();

            this.VisibleRange = ScaleInterval.All;

            //this.VisualParameters = new VisualParameters(Colors.Black, Colors.Gray, 2, .9);
            this.VisualParameters = parameters ?? VisualParameters.CreateNew(1);
        }
Example #4
0
        /// <summary>
        /// In case of PolyBezierMode, control points must be included
        /// </summary>
        /// <param name="pointCollection"></param>
        /// <param name="extent"></param>
        /// <param name="polyBezierMode"></param>
        public SpecialLineLayer(Geometry symbol, VisualParameters parameters, List <Point> pointCollection, bool canEdit = true, bool polyBezierMode = true)
        {
            if (!polyBezierMode)
            {
                throw new NotImplementedException();
            }

            this.VisualParameters = parameters ?? VisualParameters.CreateNew(1);

            Update(symbol, pointCollection, canEdit, polyBezierMode);
        }
Example #5
0
        //FeatureType _featureType;
        //private string layerName_2;
        //private CartographyParameters parameters;
        //private LayerType layerType;

        //private FeatureType featureType;

        public MapLegendItem(string layerName, IRI.Jab.Cartography.VisualParameters parameters, LayerType type)
        {
            InitializeComponent();

            //this._featureType = featureType;
            //this.isFeatureType = false;

            this.type = type;

            Initialize(layerName, parameters);
        }
 public static VisualParameters GetDefaultForMeasurements()
 {
     return(new VisualParameters(
                BrushHelper.Create(ColorHelper.ToWpfColor("#FBB03B"), 0.3),
                BrushHelper.Create("#FBB03B"),
                3,
                1,
                System.Windows.Visibility.Visible)
     {
         DashStyle = VisualParameters.GetDefaultDashStyleForMeasurements()
     });
 }
Example #7
0
        private void Initialize(string layerName, IFeatureDataSource dataSource, VisualParameters parameters, LayerType type, RenderingApproach rendering,
                                RasterizationApproach toRasterTechnique, ScaleInterval visibleRange,
                                SimplePointSymbol pointSymbol, LabelParameters labeling)
        {
            this.Id = Guid.NewGuid();

            this.DataSource = dataSource;

            this.Rendering = rendering;

            this.ToRasterTechnique = toRasterTechnique;

            var geometries = dataSource.GetGeometries();

            if (geometries.Count > 0)
            {
                this.Type = type | GetGeometryType(geometries.FirstOrDefault());
            }
            else
            {
                this.Type = type;
            }

            this.Extent = geometries.GetBoundingBox();

            this.LayerName = layerName;

            this.VisualParameters = parameters;

            this.PointSymbol = pointSymbol ?? new SimplePointSymbol()
            {
                SymbolWidth = 4, SymbolHeight = 4
            };

            //this.PositionFunc = positionFunc;

            this.Labels = labeling;

            //Check for missing visibleRange
            if (this.Labels != null)
            {
                if (this.Labels.VisibleRange == null)
                {
                    this.Labels.VisibleRange = visibleRange;
                }
            }

            this.VisibleRange = (visibleRange == null) ? ScaleInterval.All : visibleRange;
        }
Example #8
0
 public VectorLayer(string layerName, IFeatureDataSource dataSource, VisualParameters parameters, LayerType type, RenderingApproach rendering,
                    RasterizationApproach toRasterTechnique, ScaleInterval visibleRange, SimplePointSymbol pointSymbol = null, LabelParameters labeling = null)
 {
     Initialize(layerName, dataSource, parameters, type, rendering, toRasterTechnique, visibleRange, pointSymbol, labeling);
 }
        public static VisualParameters GetDefaultForDrawing(DrawMode mode)
        {
            var result = new VisualParameters(mode == DrawMode.Polygon ? DefaultDrawingFill : null, DefaultDrawingStroke, 2, .7);

            return(result);
        }
Example #10
0
        //public MapLegendItem(string layerName, CartographyParameters parameters, FeatureType featureType)
        //{
        //    InitializeComponent();

        //    this.type = LayerType.Feature;

        //    this.featureType = featureType;

        //    this.isFeatureType = true;

        //    Initialize(layerName, parameters);
        //}

        private void Initialize(string layerName, IRI.Jab.Cartography.VisualParameters parameters)
        {
            this.layerName.Text = layerName;

            this.layerName.ToolTip = layerName;

            this.layerOpacity.Value = parameters.Opacity;

            this.layerVisibility.IsChecked = parameters.Visibility == System.Windows.Visibility.Visible;

            if (this.type != LayerType.Feature)
            {
                this.layerSymbol.Child = new Rectangle()
                {
                    HorizontalAlignment = System.Windows.HorizontalAlignment.Center,
                    VerticalAlignment   = System.Windows.VerticalAlignment.Center,
                    Stroke          = parameters.Stroke,
                    StrokeThickness = 1.0,
                    Fill            = new SolidColorBrush(Colors.LightBlue),
                    Width           = 5,
                    Height          = 5
                };

                return;
            }

            Shape featuer;

            //this.type = featureType;

            if (this.type == LayerType.Polyline)
            {
                featuer = new Line()
                {
                    StrokeThickness = 3,
                    X1 = 0,
                    Y1 = 10,
                    X2 = 10,
                    Y2 = 10,
                    //Stretch = Stretch.Fill,
                    Stroke = parameters.Stroke,
                    //Fill = parameters.FillBrush,
                    HorizontalAlignment = System.Windows.HorizontalAlignment.Center,
                    VerticalAlignment   = System.Windows.VerticalAlignment.Center
                };
            }
            else if (this.type == LayerType.Point)
            {
                featuer = new Rectangle()
                {
                    HorizontalAlignment = System.Windows.HorizontalAlignment.Center,
                    VerticalAlignment   = System.Windows.VerticalAlignment.Center,
                    Stroke          = parameters.Stroke,
                    StrokeThickness = 1.0,
                    Fill            = parameters.Fill,
                    Width           = 5,
                    Height          = 5
                };
            }
            else if (this.type == LayerType.Polygon)
            {
                featuer = new Path()
                {
                    Data = Geometry.Parse("F1 M 0.499,10.500L 9.769,10.500L 6.342,6.005L 9.825,1.230L 4.264,0.499L 0.837,4.938L 0.499,10.500 Z"),
                    HorizontalAlignment = System.Windows.HorizontalAlignment.Center,
                    VerticalAlignment   = System.Windows.VerticalAlignment.Center,
                    Stroke          = parameters.Stroke,
                    StrokeThickness = parameters.StrokeThickness,
                    Fill            = parameters.Fill,
                    Width           = 15,
                    //Height = 15
                };
            }
            else
            {
                throw new NotImplementedException();
            }

            this.layerSymbol.Child = featuer;
        }
Example #11
0
        public static PolyBezierLayer Create(string name, List <Ham.SpatialBase.Point> mercatorPolyBezierPoints, Transform toScreen, System.Windows.Media.Geometry decoration, VisualParameters parameters)
        {
            if (mercatorPolyBezierPoints?.Count() < 2)
            {
                throw new NotImplementedException();
            }

            if ((mercatorPolyBezierPoints.Count - 1) % 3 != 0)
            {
                throw new NotImplementedException();
            }

            PolyBezierLayer result = new PolyBezierLayer(parameters);

            result.LayerName = name;

            result._toScreen = toScreen;

            result.mercatorPolyline = new List <Ham.SpatialBase.Point>();

            //this.mercatorPolyline = mercatorPolyline;

            result._decorateLayer = new SpecialLineLayer(decoration, parameters, null);

            result.mercatorPolyline.Add(mercatorPolyBezierPoints.First());

            var numberOfSegments = (mercatorPolyBezierPoints.Count - 1) / 3;

            for (int i = 0; i < numberOfSegments; i++)
            {
                result.mercatorPolyline.Add(mercatorPolyBezierPoints[i * 3 + 3]);
            }

            result.Initialize();

            for (int i = 0; i < numberOfSegments; i++)
            {
                result._controlLocateables[2 * i].X = mercatorPolyBezierPoints[i * 3 + 1].X;
                result._controlLocateables[2 * i].Y = mercatorPolyBezierPoints[i * 3 + 1].Y;

                result._controlLocateables[2 * i + 1].X = mercatorPolyBezierPoints[i * 3 + 2].X;
                result._controlLocateables[2 * i + 1].Y = mercatorPolyBezierPoints[i * 3 + 2].Y;
            }

            return(result);
        }
Example #12
0
        public PolyBezierLayer(List <Ham.SpatialBase.Point> mercatorPolyline, Transform toScreen, System.Windows.Media.Geometry decoration, VisualParameters parameters) : this(parameters)
        {
            this._toScreen = toScreen;

            if (mercatorPolyline?.Count() < 2)
            {
                throw new NotImplementedException();
            }

            this.mercatorPolyline = mercatorPolyline;

            this._decorateLayer = new SpecialLineLayer(decoration, parameters, null);

            Initialize();
        }