Most modern Web maps use raster or vector tiles to allow zooming to very large scales while only loading a fraction of the whole map. The projection of choice for these tiles is the Mercator projection, and they are typically arranged in the form of a recursively subdivided quadtree.
It would be a shame to limit ourselves to a single map projection, when there are so many to choose from! But how do we figure out which tiles to retrieve?
My initial attempts involved inverting the viewport polygon to figure out which tiles overlap with it. It worked, but slowed down with larger zoom levels.
Starting with a single large tile covering most of the globe, this recursively rejects large swathes of the quadtree, and is very fast even at a zoom level of 18!