Make choropleth mode work with lines
This commit is contained in:
parent
7b68c52a15
commit
125aa72785
2 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
L.U.FeatureMixin = {
|
L.U.FeatureMixin = {
|
||||||
staticOptions: {mainColor: 'color'},
|
staticOptions: { mainColor: 'color' },
|
||||||
|
|
||||||
initialize: function (map, latlng, options) {
|
initialize: function (map, latlng, options) {
|
||||||
this.map = map
|
this.map = map
|
||||||
|
@ -948,6 +948,7 @@ L.U.Polyline = L.Polyline.extend({
|
||||||
staticOptions: {
|
staticOptions: {
|
||||||
stroke: true,
|
stroke: true,
|
||||||
fill: false,
|
fill: false,
|
||||||
|
mainColor: 'color',
|
||||||
},
|
},
|
||||||
|
|
||||||
isSameClass: function (other) {
|
isSameClass: function (other) {
|
||||||
|
|
|
@ -132,7 +132,7 @@ L.U.Layer.Choropleth = L.FeatureGroup.extend({
|
||||||
|
|
||||||
_getValue: function (feature) {
|
_getValue: function (feature) {
|
||||||
const key = this.datalayer.options.choropleth.property || 'value'
|
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 () {
|
computeLimits: function () {
|
||||||
|
|
Loading…
Reference in a new issue