Add snapping abilities on circles
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
goog.provide('ol.test.coordinate');
|
||||
|
||||
goog.require('ol.coordinate');
|
||||
goog.require('ol.geom.Circle');
|
||||
|
||||
|
||||
describe('ol.coordinate', function() {
|
||||
@@ -89,6 +90,19 @@ describe('ol.coordinate', function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#closestOnCircle', function() {
|
||||
var center = [5, 10];
|
||||
var circle = new ol.geom.Circle(center, 10);
|
||||
it('can find the closest point on circle', function() {
|
||||
expect(ol.coordinate.closestOnCircle([-20, 10], circle))
|
||||
.to.eql([-5, 10]);
|
||||
});
|
||||
it('can handle coordinate equal circle center', function() {
|
||||
expect(ol.coordinate.closestOnCircle(center, circle))
|
||||
.to.eql([15, 10]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#closestOnSegment', function() {
|
||||
it('can handle points where the foot of the perpendicular is closest',
|
||||
function() {
|
||||
|
||||
Reference in New Issue
Block a user