public VectorTileLayer(ITileSource tileSource, RenderGetStrategy renderStrategy = null) { _tileSource = tileSource; _tileFetcher = new TileFetcher(_tileSource, _tileCache, 1, 4, _fetchStrategy); _tileFetcher.DataChanged += TileFetcherOnDataChanged; _tileFetcher.PropertyChanged += TileFetcherOnPropertyChanged; _renderStrategy = renderStrategy ?? new RenderGetStrategy(); }
public void GetFeaturesWithPartOfOptimalResolutionTilesMissing() { // arrange var schema = new GlobalSphericalMercator(); var box = schema.Extent.ToBoundingBox(); const int levelId = 3; var resolution = schema.Resolutions[levelId.ToString(CultureInfo.InvariantCulture)]; var memoryCache = PopulateMemoryCache(schema, new MemoryCache <Feature>(), levelId); var renderGetStrategy = new RenderGetStrategy(); // act var tiles = renderGetStrategy.GetFeatures(box, resolution.UnitsPerPixel, schema, memoryCache); // assert Assert.True(tiles.Count == 43); }
public override IEnumerable <IFeature> GetFeaturesInView(BoundingBox box, double resolution) { var dictionary = new Dictionary <TileIndex, IFeature>(); if (Schema == null) { return(dictionary.Values); } var levelId = BruTile.Utilities.GetNearestLevel(Schema.Resolutions, resolution); RenderGetStrategy.GetRecursive(dictionary, Schema, _memoryCache, box.ToExtent(), levelId); var sortedDictionary = (from entry in dictionary orderby entry.Key ascending select entry).ToDictionary(pair => pair.Key, pair => pair.Value); return(sortedDictionary.Values); }