Merge pull request #1918 from snkashis/empty_interior_ring
Throw invalid GeoJSON error on Polygon with an empty interior
This commit is contained in:
commit
b313165cca
@ -99,6 +99,9 @@ L.extend(L.GeoJSON, {
|
||||
return new L.Polyline(latlngs);
|
||||
|
||||
case 'Polygon':
|
||||
if (coords.length === 2 && !coords[1].length) {
|
||||
throw new Error('Invalid GeoJSON object.');
|
||||
}
|
||||
latlngs = this.coordsToLatLngs(coords, 1, coordsToLatLng);
|
||||
return new L.Polygon(latlngs);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user