[Mapbender-commits] r1724 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Oct 12 01:44:59 EDT 2007
Author: christoph
Date: 2007-10-12 01:44:59 -0400 (Fri, 12 Oct 2007)
New Revision: 1724
Modified:
trunk/mapbender/http/javascripts/geometry.js
Log:
new function getBbox4
Modified: trunk/mapbender/http/javascripts/geometry.js
===================================================================
--- trunk/mapbender/http/javascripts/geometry.js 2007-10-11 08:10:59 UTC (rev 1723)
+++ trunk/mapbender/http/javascripts/geometry.js 2007-10-12 05:44:59 UTC (rev 1724)
@@ -270,7 +270,26 @@
}
return [min, max];
};
+
/**
+ * gets the bounding box of this {@link MultiGeometry} as a polygon of four points
+ *
+ * @return the bounding box
+ * @type MultiGeometry
+ */
+MultiGeometry.prototype.getBBox4 = function() {
+ var bbox = this.getBBox();
+ var realBox = new MultiGeometry(geomType.polygon);
+ realBox.addGeometry(geomType.polygon);
+ realBox.get(-1).addPointByCoordinates(bbox[0].x, bbox[0].y);
+ realBox.get(-1).addPointByCoordinates(bbox[0].x, bbox[1].y);
+ realBox.get(-1).addPointByCoordinates(bbox[1].x, bbox[1].y);
+ realBox.get(-1).addPointByCoordinates(bbox[1].x, bbox[0].y);
+ realBox.get(-1).close();
+ return realBox;
+}
+
+/**
* gets the center of the bounding box of this {@link MultiGeometry}.
*
* @return the center of the bounding box
More information about the Mapbender_commits
mailing list