var wgs84Sphere = new ol.Sphere(6378137); var getGeodesicArea = function(polygon) { var geom = (polygon.clone().transform('EPSG:3857', 'EPSG:4326')); var area = Math.abs(wgs84Sphere.geodesicArea(geom.getLinearRing(0).getCoordinates())); return area; };

Pass a polygon geometry to the function and you'll get a value in m2. The magic number used to construct the sphere is the radius of the earth. abs is needed because the result is puzzlingly sometimes negative and sometimes positive; that doesn't seem to depend on the order of the coordinates, since my polygons are all properly wound. I can now go on to calculating intersection areas.

]]>