From 8111cf55221c025c0c72e86dfca215a144168f64 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 24 Jan 2025 18:22:33 +0100 Subject: [PATCH] fix: add a label for default colors scheme in categorized layer type --- umap/static/umap/js/modules/rendering/layers/classified.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/umap/static/umap/js/modules/rendering/layers/classified.js b/umap/static/umap/js/modules/rendering/layers/classified.js index bf581288..039df186 100644 --- a/umap/static/umap/js/modules/rendering/layers/classified.js +++ b/umap/static/umap/js/modules/rendering/layers/classified.js @@ -88,7 +88,11 @@ const ClassifiedMixin = { }, getColorSchemes: function (classes) { - return this.colorSchemes.filter((scheme) => Boolean(colorbrewer[scheme][classes])) + const found = this.colorSchemes.filter((scheme) => + Boolean(colorbrewer[scheme][classes]) + ) + if (found.length) return found + return [['', translate('Default')]] }, }