Add geodesic option for measure

This commit is contained in:
Bart van den Eijnden
2015-02-10 13:01:22 +01:00
parent 776ffa925f
commit c5c24f209a
5 changed files with 85 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -264,8 +264,30 @@ describe('ol.Sphere', function() {
});
describe('Vincenty area', function() {
var geometry;
before(function(done) {
afterLoadText('spec/ol/format/wkt/illinois.wkt', function(wkt) {
try {
var format = new ol.format.WKT();
geometry = format.readGeometry(wkt);
} catch (e) {
done(e);
}
done();
});
});
it('results match the expected area of Ilinois', function() {
var coords = geometry.getPolygon(0).getLinearRing(0).getCoordinates();
expect(ol.sphere.WGS84.geodesicArea(coords)).to.equal(145978332359.37125);
});
});
});
goog.require('goog.math');
goog.require('ol.Sphere');
goog.require('ol.sphere.WGS84');
goog.require('ol.format.WKT');