diff --git a/packages/turf-mask/README.md b/packages/turf-mask/README.md index 33f65c9a63..20033a6fe8 100644 --- a/packages/turf-mask/README.md +++ b/packages/turf-mask/README.md @@ -8,31 +8,44 @@ Takes any type of [polygon][1] and an optional mask and returns a [polygon][1] e **Parameters** -- `polygon` **([FeatureCollection][2] \| [Feature][3]<([Polygon][4] \| [MultiPolygon][5])>)** GeoJSON Polygon used as interior rings or holes. -- `mask` **[Feature][3]<[Polygon][4]>?** GeoJSON Polygon used as the exterior ring (if undefined, the world extent is used) +- `polygon` **([FeatureCollection][2] \| [Feature][3]<([Polygon][4] \| [MultiPolygon][5])>)** GeoJSON Polygon used as interior rings or holes. +- `mask` **[Feature][3]<[Polygon][4]>?** GeoJSON Polygon used as the exterior ring (if undefined, the world extent is used) **Examples** ```javascript -var polygon = turf.polygon([[[112, -21], [116, -36], [146, -39], [153, -24], [133, -10], [112, -21]]]); -var mask = turf.polygon([[[90, -55], [170, -55], [170, 10], [90, 10], [90, -55]]]); +var polygon = turf.polygon([ + [ + [112, -21], + [116, -36], + [146, -39], + [153, -24], + [133, -10], + [112, -21], + ], +]); +var mask = turf.polygon([ + [ + [90, -55], + [170, -55], + [170, 10], + [90, 10], + [90, -55], + ], +]); var masked = turf.mask(polygon, mask); //addToMap -var addToMap = [masked] +var addToMap = [masked]; ``` Returns **[Feature][3]<[Polygon][4]>** Masked Polygon (exterior ring with holes). [1]: https://tools.ietf.org/html/rfc7946#section-3.1.6 - [2]: https://tools.ietf.org/html/rfc7946#section-3.3 - [3]: https://tools.ietf.org/html/rfc7946#section-3.2 - [4]: https://tools.ietf.org/html/rfc7946#section-3.1.6 - [5]: https://tools.ietf.org/html/rfc7946#section-3.1.7