Sorry, I haven't been clear. Let's say that I have a map that stacks these elements in this order from top to bottom:
- symbols & captions
- highways
- water bodies
- land cover
Currently in MF all these elements are painted on top of each other, then the resulting bitmap is stored in the cache as a single RGBA PNG. If I turn off some stuff (using mapstyles), as you say, the whole cache has to be cleared because MF can't subtract from the cached image the stuff I turned off. Now, there are two cases:
1) this stuff has different z-indexes. For example I turn off the display of forests which means areas, with a very low z-index, and their labels, with a higher z-index.
2) this stuff has the same z-index. For example I turn off the display of hotels, or water taps.
In the first case, unless we cache every element separately (which is probably suicidal), we have to redraw everything, and that's fine.
In the second case, however, the hotels or the water taps could be conveniently cached separately. Toggling them on/off would not require any clearing/redrawing of the cache, so it could be almost instant. Given the nature of the image (mostly empty areas that compress like crazy) the size overhead would be small.
Of course it should be up to the theme designer to define what has to be drawn on a separate layer. I want to stress that I'm not criticizing the current system, the ability to filter on a category across very different z-indexes (like in the first case) is a powerful tool, it just doesn't fit every situation.
Another advantage of defining physically separate layers is that we could use creative blending modes on the whole layer. If the integration with raster data (hillshading) eventually comes to MF that will be almost necessary. A typical situation would be a bottom layer with landcover (that can be multiplied with the raster hill-shading), a mid layer with the bulk of the map, an some symbol/label layers on top.