Merge pull request #1550 from umap-project/choropleth-min-classes
fix: do not ask more classes than available values in choropleth mode
This commit is contained in:
commit
cfe3bad5a4
1 changed files with 1 additions and 0 deletions
|
@ -194,6 +194,7 @@ L.U.Layer.Choropleth = L.FeatureGroup.extend({
|
||||||
let mode = this.datalayer.options.choropleth.mode,
|
let mode = this.datalayer.options.choropleth.mode,
|
||||||
classes = +this.datalayer.options.choropleth.classes || 5,
|
classes = +this.datalayer.options.choropleth.classes || 5,
|
||||||
breaks
|
breaks
|
||||||
|
classes = Math.min(classes, values.length)
|
||||||
if (mode === 'manual') {
|
if (mode === 'manual') {
|
||||||
const manualBreaks = this.datalayer.options.choropleth.breaks
|
const manualBreaks = this.datalayer.options.choropleth.breaks
|
||||||
if (manualBreaks) {
|
if (manualBreaks) {
|
||||||
|
|
Loading…
Reference in a new issue