Ejemplo n.º 1
0
        private void Initialize(string layerName, SqlFeatureDataSource dataSource, RenderingApproach rendering,
                                RasterizationApproach toRasterTechnique, ScaleInterval visibleRange, Func <SqlFeature, VisualParameters> symbologyRule)
        {
            this.LayerId = Guid.NewGuid();

            this.DataSource = dataSource;

            this.Rendering = rendering;

            this.ToRasterTechnique = toRasterTechnique;

            var geometries = dataSource.GetGeometries();

            this.Type = LayerType.Feature | LayerType.FeatureLayer;

            //if (geometries?.Count > 0)
            //{
            //    this.Type = type | GetGeometryType(geometries.FirstOrDefault(g => g != null));
            //}
            //else
            //{
            //    this.Type = type;
            //}

            this.Extent = DataSource?.GetGeometries()?.GetBoundingBox() ?? sb.BoundingBox.NaN;

            this.LayerName = layerName;

            this.VisualParameters = new VisualParameters(null, null, 0, 1, Visibility.Visible);

            this.SymbologyRule = symbologyRule;

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

            //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;
        }
Ejemplo n.º 2
0
 public FeatureLayer(string layerName, SqlFeatureDataSource dataSource, RenderingApproach rendering,
                     RasterizationApproach toRasterTechnique, Func <SqlFeature, VisualParameters> symbologyRule, ScaleInterval visibleRange)
 {
     Initialize(layerName, dataSource, rendering, toRasterTechnique, visibleRange, symbologyRule);
 }