Skip to content Skip to sidebar Skip to footer

Limit Zoom To A 'maximum' In D3 Geo Tiles

When you use certain tile-sets (e.g. .tiles.mapbox.com/v3/mapbox.natural-earth-2/) the zoom on d3 geo tiles should be limited to a maximum, otherwise those tiles do not exist, cann

Solution 1:

One easy approach to this is to limit the zoom by setting a maximum scaling factor.

For instance in clicked you could add a line like this:

scale = Math.min(1 << 14, scale);

(based your previous scale extent of [1 << 11, 1 << 14])

Here's the updated fiddle: https://jsfiddle.net/5Lf0w3sm/17/

Post a Comment for "Limit Zoom To A 'maximum' In D3 Geo Tiles"