Mapsui.Providers.MemoryProvider.GetFeaturesInView C# (CSharp) Method

GetFeaturesInView() public method

public GetFeaturesInView ( BoundingBox box, double resolution ) : IEnumerable
box BoundingBox
resolution double
return IEnumerable
        public virtual IEnumerable<IFeature> GetFeaturesInView(BoundingBox box, double resolution)
        {
            if (box == null) throw new ArgumentNullException(nameof(box));

            lock (_syncRoot)
            {
                var features = Features.ToList();

                // Use a larger extent so that symbols partially outside of the extent are included
                var grownBox = box.Grow(resolution*SymbolSize*0.5);

                foreach (var feature in features)
                {
                    if (feature.Geometry == null)
                        continue;

                    var boundingBox = feature.Geometry.GetBoundingBox();
                    if (boundingBox!= null && grownBox.Intersects(boundingBox))
                    {
                        yield return feature;
                    }
                }
            }
        }