-
Notifications
You must be signed in to change notification settings - Fork 38
render min-tile-zoom & max-tile-zoom #65
Comments
We discussed this too and decided to leave it out for now. In most instances where we show/hide features based on zoom level, the vector tile doesn't actually contain any data for zoom levels where we want to hide the data, so this seems like no big issue. Are you seeing instances of data where this is not the case? |
@kkaefer one particular example is POIs which get loaded on zoom 15 but are too dense on this level and usually appear later in styles (e.g. starting z16.5 in outdoors). |
I think this assumes that the style being created is very similar to the Mapbox Streets style. If you want to create something very different, this is often not the case. There's variability across styles on when a lot of features first show up: buildings, roads/bridges/tunnels of various classes and lengths, minor features such as barriers and aeroways, many labels, and more. Also, I chatted with @yhahn last night about a couple examples of where min/max zooms would be helpful for switching render properties of features at certain zoom levels. E.g.: Switching from Switching from a marker on a point + translated text to non-translated text on a point: ^ This particular example also has |
We agreed to implement this now, as it's a low hanging fruit. |
I think this was stated in chat, but just to confirm: for styles involving render property switches, implementing this would allow us to create two different layers for the same feature, and set the max zoom for layer1 equal to the min zoom of layer2? |
@nickidlugash Yes. However, you have to specify exclusive ranges like this:
to ensure that feature 1 and 2 are never visible at the same time. |
@kkaefer in your example, what happens between zoom 14 and 15? Does feature 1 remain enabled? |
in this example, a number always covers |
@ansis says that it might make a lot of sense to move out those properties to the layer level, out of |
Is this property going to be inherited with |
How does this work when overzooming? E.g. you specify a |
@kkaefer layer |
The source's maxZoom? |
@kkaefer yeah, the one that is grabbed from tileJson, e.g. 14 in this case. This assumes that when you overzoom, a new tile will get loaded unless it's a zoom after vector tile's maxZoom. If you see a better approach to this, let me know — this could probably be improved. |
In other words, the only minor issue with this approach is that e.g. when a layer has minZoom = 12 and you zoom in past 12, the layer still won't appear until a new tile is loaded (and corresponding buckets parsed). But this looks like an expected behavior. |
We need to be able to define the zoom range of tiles a feature appears/gets processed on (in render options).
Currently we hide features when when not needed with opacity = 0, but it's not a good practice (since transparent features still get processed, placed, etc., wasting CPU time).
Should we call this
min-tile-zoom
? Or justmin-zoom
? Or have it prefixed, likeicon-min-zoom
?The text was updated successfully, but these errors were encountered: