1.0.6 • Published 6 years ago

react-native-polygon-round-edge v1.0.6

Weekly downloads
4
License
ISC
Repository
github
Last release
6 years ago

React Native Maps Polygon/Rectangle Round Edges

With this library it is possible to input 4 points of a rectangle and get back all points you need for a rectangle with round edges.

Installing

npm i react-native-polygon-round-edge

Use

Import:

import roundPolygon from "react-native-polygon-round-edge";

There are two functions:

roundPolygon.smoothPointsLatLong(...)
roundPolygon.smoothLatLong(...)

which returns an Array<LatLng> or anArray<XY>. These arrays outline the points of the rectangle with round edges.

Arguments:

Important: The order of the points is essential. Start with the lower left corner and continue clockwise.

ArgumentTypeNote
pointsArray<LatLng> or Array<XY>4 points of the rectangle
numberOfPointsBetweenPositive Numberhow many points are on the circle orbit(How round is the circle)
radiusPositive Number

Types:

type LatLng {
  latitude: Number,
  longitude: Number,
}

type XY {
  x: Number,
  y: Number,
}

Authors

  • Jonathan Zimmermann - Initial work