Make choropleth mode work with lines

This commit is contained in:
Yohan Boniface 2023-06-19 19:03:51 +02:00
parent 7b68c52a15
commit 125aa72785
2 changed files with 3 additions and 2 deletions

View file

@ -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) {

View file

@ -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 () {