Add toggle to disable squares on low zoom levels, fix maxzoom property

This commit is contained in:
Pieter Vander Vennet 2021-10-13 00:43:19 +02:00
parent 6330bd5bfd
commit 9e7dec0101
5 changed files with 43 additions and 24 deletions

View file

@ -153,13 +153,18 @@ export class TileHierarchyAggregator implements FeatureSource {
}
}
getCountsForZoom(locationControl: UIEventSource<{ zoom : number }>, cutoff: number = 0) : FeatureSource{
getCountsForZoom(clusteringConfig: {maxZoom: number}, locationControl: UIEventSource<{ zoom : number }>, cutoff: number = 0) : FeatureSource{
const self = this
const empty = []
return new StaticFeatureSource(
locationControl.map(loc => {
const features = []
const targetZoom = loc.zoom
if(targetZoom > clusteringConfig.maxZoom){
return empty
}
const features = []
self.visitSubTiles(aggr => {
if(aggr.totalValue < cutoff) {
return false