From 125aa72785457a79f7d84c7cd8e9e4fdc92861a1 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Mon, 19 Jun 2023 19:03:51 +0200 Subject: [PATCH] Make choropleth mode work with lines --- umap/static/umap/js/umap.features.js | 3 ++- umap/static/umap/js/umap.layer.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/umap/static/umap/js/umap.features.js b/umap/static/umap/js/umap.features.js index 427a8756..5b3b8f7b 100644 --- a/umap/static/umap/js/umap.features.js +++ b/umap/static/umap/js/umap.features.js @@ -1,5 +1,5 @@ L.U.FeatureMixin = { - staticOptions: {mainColor: 'color'}, + staticOptions: { mainColor: 'color' }, initialize: function (map, latlng, options) { this.map = map @@ -948,6 +948,7 @@ L.U.Polyline = L.Polyline.extend({ staticOptions: { stroke: true, fill: false, + mainColor: 'color', }, isSameClass: function (other) { diff --git a/umap/static/umap/js/umap.layer.js b/umap/static/umap/js/umap.layer.js index eda199a6..dd7e569a 100644 --- a/umap/static/umap/js/umap.layer.js +++ b/umap/static/umap/js/umap.layer.js @@ -132,7 +132,7 @@ L.U.Layer.Choropleth = L.FeatureGroup.extend({ _getValue: function (feature) { const key = this.datalayer.options.choropleth.property || 'value' - return feature.properties[key] + return +feature.properties[key] // TODO: should we catch values non castable to int ? }, computeLimits: function () {