Hi David,
for polygons there already exists the method Area. But it only is correct for convex polygons.
I just implemented a new method boundingBox, which will be be available in tonight’s nightly build.
From this you easily can determine width and height. The documentation of the method will be:
/**
* Returns bounding box of a polygon. The bounding box is an array of four numbers: the first two numbers
* determine the upper left corner, the last two number determine the lower right corner of the bounding box.
*
* The width and height of a polygon can then determined like this:
* @example
* var box = polygon.boundingBox();
* var width = box[2] - box[0];
* var height = box[1] - box[3];
*
* @returns {Array} Array containing four numbers: [minX, maxY, maxX, minY]
*/
Volunteers to implement an area method for arbitrary polygons are highly welcome…
Best wishes,
Alfred