jscastro
jscastro

Reputation: 3780

minzoom seems not to work with custom layers in mapbox

I have used the mapbox example from Add a 3D model but when I add minzoom : 17, property the layer definition is not hidden once the zoom out is lower, but it works well with other fill or fill extrusion layers. Is this a know bug or by design decision?

Here's the test fiddle

Upvotes: 2

Views: 508

Answers (1)

jscastro
jscastro

Reputation: 3780

I found a way to make it run, but must be after the layer is created through addLayer. You must execute setLayerZoomRange explicitly, the attribute in the addLayer creation doesn't work for custom layers.
map.setLayerZoomRange('layername', 17, 24);

Upvotes: 1

Related Questions