Skip to content

Commit e36153f

Browse files
committed
Fix legend colorisation with zero values in slices definition
1 parent 04ec7c0 commit e36153f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

js/jquery.mapael.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,8 @@
571571
}
572572

573573
for (var id in elems) {
574-
if ((!legendOptions.slices[i].min || elems[id].value >= legendOptions.slices[i].min)
575-
&& (!legendOptions.slices[i].max || elems[id].value < legendOptions.slices[i].max)
574+
if ((typeof legendOptions.slices[i].min == 'undefined' || elems[id].value >= legendOptions.slices[i].min)
575+
&& (typeof legendOptions.slices[i].max == 'undefined' || elems[id].value < legendOptions.slices[i].max)
576576
) {
577577
(function(id) {
578578
if (!label.hidden) {
@@ -730,8 +730,8 @@
730730
*/
731731
$.fn.mapael.getLegendSlice = function (value, legend) {
732732
for(var i = 0, length = legend.slices.length; i < length; ++i) {
733-
if ((!legend.slices[i].min || value >= legend.slices[i].min)
734-
&& (!legend.slices[i].max || value < legend.slices[i].max)
733+
if ((typeof legend.slices[i].min == 'undefined' || value >= legend.slices[i].min)
734+
&& (typeof legend.slices[i].max == 'undefined' || value < legend.slices[i].max)
735735
) {
736736
return legend.slices[i];
737737
}

0 commit comments

Comments
 (0)