From a576af649304b5b42cffd8b85db8a12b4e99a4a3 Mon Sep 17 00:00:00 2001 From: Erno Aapa Date: Thu, 8 Sep 2016 11:51:26 +0300 Subject: [PATCH] Updated MultiPolygon 'polygons' prop to allow polygons with holes (#218) Like 'Polygon' already allows passing array of arrays to make holes, also MultiPolygon should allow it. Even though not read in Leaflet MultiPolygon documentation, it supports it because Polygon support it. --- src/MultiPolygon.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/MultiPolygon.js b/src/MultiPolygon.js index 70d02217..f94da41f 100644 --- a/src/MultiPolygon.js +++ b/src/MultiPolygon.js @@ -8,7 +8,12 @@ import Path from './Path' export default class MultiPolygon extends Path { static propTypes = { - polygons: PropTypes.arrayOf(latlngListType).isRequired, + polygons: PropTypes.arrayOf( + PropTypes.oneOfType([ + latlngListType, + PropTypes.arrayOf(latlngListType), + ]) + ).isRequired, }; componentWillMount () {