Closed fishcharlie closed 3 years ago
One thing I forgot to mention, this is when numberOfEdges
is set to 4
.
Hi @fishcharlie , I get the correct rotation. Are you sure you spelled it correctly?
bearing: 45
Code:
circle([-105.0075602531433, 39.748670669322394], 100, { numberOfEdges: 4, bearing: 45 });
{
type: "Polygon",
coordinates: [
[
[-105.0067340774561, 39.74930587122309],
[-105.00838642883049, 39.74930587122309],
[-105.00838641359589, 39.748035461565095],
[-105.00673409269072, 39.748035461565095],
[-105.0067340774561, 39.74930587122309],
],
],
}
On map:
Code:
circle([-105.0075602531433, 39.748670669322394], 100, { numberOfEdges: 4 });
{
type: "Polygon",
coordinates: [
[
[-105.00756025314331, 39.74956898460652],
[-105.00872863123237, 39.74867066346578],
[-105.00756025314331, 39.74777235403828],
[-105.00639187505423, 39.74867066346578],
[-105.00756025314331, 39.74956898460652],
],
],
};
On map:
@johachi The issue here was poor documentation. In the README it lists bearing
as the 5th parameter. In reality, the function only accepts 3 parameters. The 3rd one being either a number representing numberOfEdges, OR an object.
No where other than the source code itself is this made clear. Maybe it'd be a good idea to update the README to make it more clear?
Your right, it is a little bit unclear unless one reads the source code. I have fixed it now. https://github.com/gabzim/circle-to-polygon/pull/40
Please feel free to contribute if you think there are more things that can be improved in the documentation 😄
Is there a way to rotate the output? Currently the output results in a diamond. Ideally I'd like to rotate it 45 degrees so that it represents a square as opposed to a diamond. The
bearing
option doesn't seem to do anything when I try to set that to 45.