A new release of Leaflet.Deflate is now available. Leaflet.Deflate 2.1 introduces a new option,
greedyCollapse, to specify when features will collapse.
greedyCollapse set to
true, a feature collapses when either its width or height falls below the specified threshold. This is the default, and it matches the behaviour from previous versions. Set
false, and features will collapse only of both width and height fall below the specified threshold. This behaviour comes in handy when you have many “long” features on your map.
The following animation illustrates the behaviour:
The top polygon collapses when one of the sides’ length is below the threshold. This is the default behaviour. With
greedyCollapse: false, the bottom polygon collapses at a lower zoom level when both sides’ length are below the threshold.
My thanks to Simonas Gildutis for contributing the new feature.