Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rectangle shapes #2

Closed
Karpyshyn opened this issue Jan 20, 2014 · 2 comments
Closed

Rectangle shapes #2

Karpyshyn opened this issue Jan 20, 2014 · 2 comments

Comments

@Karpyshyn
Copy link

Your code is not working correctly for rectangle shapes with 4 points.
Try first this coordinates
var coords = [
{'lat' : '50.157913235507706', 'lon' : '29.900512524414125'},
{'lat' : '50.74029471119741', 'lon' : '31.146087475586'},
{'lat' : '50.74029471119741', 'lon' : '29.900512524414125'},
{'lat' : '50.15791323550770611', 'lon' : '31.146087475586'}

];

var centrePoint = new google.maps.LatLng(50.5, 30.0);

This example works incorrectly

And than change a little last point lat. F.e.
{'lat' : '50.17791323550770611', 'lon' : '31.146087475586'}

This one is good

@Karpyshyn
Copy link
Author

Just change
if (this.reverse){
if (angle > 0) {
angle += 360;
}
}else{
if (angle < 0) {
angle += 360;
}
}

To
if (this.reverse){
if (angle >= 0) {
angle += 360;
}
}else{
if (angle <= 0) {
angle += 360;
}
}

@brian3kb
Copy link
Owner

@Karpyshyn Thank you for the bug report, very much appreciated! I've pushed the change and added a 4th example and test.
Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants