From f981f5e94f2a0f86278514ac8a958825776efd39 Mon Sep 17 00:00:00 2001 From: Mathieu Berbegal Date: Wed, 1 Apr 2020 12:31:32 +0200 Subject: [PATCH 1/2] Add legend option --- src/datamap.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/datamap.jsx b/src/datamap.jsx index 37a94ba..6b38c9a 100644 --- a/src/datamap.jsx +++ b/src/datamap.jsx @@ -23,6 +23,7 @@ export default class Datamap extends React.Component { graticule: PropTypes.bool, height: PropTypes.any, labels: PropTypes.bool, + legend: PropTypes.bool, responsive: PropTypes.bool, style: PropTypes.object, updateChoroplethOptions: PropTypes.object, @@ -77,6 +78,7 @@ export default class Datamap extends React.Component { data, graticule, labels, + legends, updateChoroplethOptions, ...props } = this.props; @@ -108,6 +110,10 @@ export default class Datamap extends React.Component { if (labels) { map.labels(); } + + if (legend) { + map.legend(); + } } resizeMap() { From da66507527e383b6fcce4968553b5fb81a7e991a Mon Sep 17 00:00:00 2001 From: toben Date: Thu, 2 Apr 2020 11:33:58 +0200 Subject: [PATCH 2/2] Update "legends" prop typo Co-Authored-By: Brandon Mills --- src/datamap.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datamap.jsx b/src/datamap.jsx index 6b38c9a..2f1d5e4 100644 --- a/src/datamap.jsx +++ b/src/datamap.jsx @@ -78,7 +78,7 @@ export default class Datamap extends React.Component { data, graticule, labels, - legends, + legend, updateChoroplethOptions, ...props } = this.props;