Ejemplo n.º 1
0
        internal DrawingItemLayer(
            string title,
            Geometry geometry,
            VisualParameters visualParameters = null,
            int id = int.MinValue,
            FeatureDataSource source = null)
        {
            this.Extent = geometry.GetBoundingBox();

            this.VisualParameters = visualParameters ?? VisualParameters.GetDefaultForDrawingItems();

            //this.VisualParameters.OnVisibilityChanged += (sender, e) => { this.RequestChangeVisibility?.Invoke(this); };

            HighlightGeometryKey = Guid.NewGuid();

            //this.OriginalSymbology = VisualParameters.Clone();

            var featureType =
                (geometry.Type == GeometryType.Point || geometry.Type == GeometryType.MultiPoint) ? LayerType.Point :
                ((geometry.Type == GeometryType.LineString || geometry.Type == GeometryType.MultiLineString) ? LayerType.Polyline :
                 (geometry.Type == GeometryType.Polygon || geometry.Type == GeometryType.MultiPolygon) ? LayerType.Polygon : LayerType.None);

            this.Type = LayerType.Drawing | featureType;

            this.Rendering = RenderingApproach.Default;

            this.ToRasterTechnique = RasterizationApproach.GdiPlus;

            this.Id = id;

            this.OriginalSource = source;

            this.ZIndex = int.MaxValue;

            //this.DataSource = new MemoryDataSource(new List<SqlGeometry>() { geometry.AsSqlGeometry() });

            //this.Title = title;

            this.LayerName = title;

            this.Geometry = geometry;

            this.Commands = new List <ILegendCommand>();

            this.OnIsSelectedInTocChanged += (sender, e) =>
            {
                this.RequestHighlightGeometry?.Invoke(this);
            };

            this.OnVisibilityChanged += (sender, e) =>
            {
                this.RequestChangeVisibility?.Invoke(this);
            };
        }
Ejemplo n.º 2
0
        public ConnectedSqlFeatureSet(List <T> features, FeatureDataSource <T> dataSource, string title) : base(features)
        {
            this.DataSource = dataSource;

            this.Title = title;
        }